Re: Quotes?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/6/06, Gustav Wiberg <info@xxxxxxxxxxx> wrote:

I want to save this to a string...

<script language="javascript">
var uri = 'http://impse.tradedoubler.com/imp/img/16352388/1122503?' + new
String (Math.random()).substring (2, 11);
document.write('<a
href="http://clk.tradedoubler.com/click?p=48859&a=1122503&g=16352388";
target="_blank"><img src="'+uri+'" border=0></a>');
</script><br><br>


How could i type?

I've tried with ' and ".. but can't get it to work.

tested diffrent types..
$str = '<script language="javascript">';


this should work.

$str = 'var uri = 'http://impse.tradedoubler.com/imp/js/16350344/1122503?' +
new String (Math.random()).substring (2, 11);';


$str .= 'var uri = \'http://impse.tradedoubler.com/imp/js/16350344/1122503?\'
+ new String (Math.random()).substring (2, 11);';

$str = ""document.write('<sc'+'ript language="JavaScript" src="'+uri+'"
charset="ISO-8859-1"></sc'+'ript>');"";


$str .= "\"document.write('<sc'+'ript language=\"JavaScript\"
src=\"'+uri+'\"charset=\"ISO-8859-1\"></sc'+'ript>');\"";

$str = ""</script><br><br>"";


$str .= "\"</script><br><br>\"";

Best regards
/Gustav Wiberg
Stammis Internet

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


* use (.) dot to add another value to a string:
e.g.
$var = 'hello';
$var .= ' world';
echo $var;
// hello world
$var = 'foo' . ' bar';
echo $var;
// foo bar

* learn to escape character.


hth,

john

--
GMail Rocks!!!

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux