|
-
Jul 27th, 2005, 05:15 PM
#1
Thread Starter
Addicted Member
PHP/Javascript Wierd combination - variable trouble
Hey... I'm having to mix PHP and Javascript but its turning out to be very complicated for me. I have written a code snippet and i was wondering whether someone would mind telling me if it will work?? I'm asking you before uploading it as i want to know whether i'm going about my problem the right way or not?!?
Here it is:
Code:
if ($_SERVER['HTTP_REFERER']=="http://www.scarredforlife.co.uk/ForumReplies?threadid=$threadid§ionid=$sectid") {
echo "<script>";
echo "var message = document.form1.replymessage.value;";
echo "document.writeln('<?php $_SESSION[message]=' + message + '?>'";
echo "</script>";
}
As you can see, i'm having to enclose javascript within PHP and then PHP withing this javascript. Can this be done??
Many thanks, BIOSTALL
-
Jul 27th, 2005, 07:46 PM
#2
Fanatic Member
Re: PHP/Javascript Wierd combination - variable trouble
This looks to be a problem:
Code:
<?php $_SESSION[message]=' + message + '?>
Did you already save data in a session? What are you trying to accomplish?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|