|
|
Posted by Shelly on 10/30/07 00:54
"David Williams" <dw149@acmex.gatech.edu> wrote in message
news:fg5tsn$bre$1@news-int.gatech.edu...
> Rik Wasmus <luiheidsgoeroe@hotmail.com> wrote:
> Thank you so much Rik.
>
> I still do not really understand but am going to study what you wrote.
>
> The reason I kept overwriting was just to get this output
> correct. In my final code, I am writing to an array different values.
> But to take as much ambiguity out of the code that I could, I simplified
> it to that.
>
> Now, to the code:
>
>
> echo "abc='".addslashes($temp_image_name)."';";
>
> echo " blah "; // the code in its most simplest form
> which outputed will be a Java statement
No, what will be output is
abc="Hello" blah
if $temp_image_name is set to "Hello"
> echo "abc= <blah>"; // if php does not talk to JS, how does
> php know what abc is ?
That is is not what is output. All php does is process the stuff ON THE
SERVER and sends back an HTML page. So, IF you compose it correctly, what
the BROWSER will see is an HTML: file with the javascript code enclosed in
the proper <script> </script> block.
> The addslashes I suppose is to escape the double quotes around
> the "Hello"? Why?
From http://www.php.net/manual/en/function.addslashes.php
Returns a string with backslashes before characters that need to be quoted
in database queries etc. These characters are single quote ('), double quote
("), backslash (\) and NUL (the NULL byte).
>
> And the periods?
The period is the "append this string" operator to the previous string.
> I know you have already helped but me understanding why would go
> a long way.
Go to www.php.net or www.w3schools.net (and look for the PHP tutorial).
While you are at it, a tutorial in C and/or Java would help as well.
Shelly
Navigation:
[Reply to this message]
|