Results 1 to 2 of 2

Thread: PHP/Javascript Wierd combination - variable trouble

  1. #1

    Thread Starter
    Addicted Member BIOSTALL's Avatar
    Join Date
    Apr 2005
    Location
    Northampton, UK
    Posts
    180

    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&sectionid=$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

  2. #2
    Fanatic Member
    Join Date
    Sep 2000
    Posts
    770

    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
  •  



Click Here to Expand Forum to Full Width