Results 1 to 3 of 3

Thread: Doing one thing in one page alters another?

  1. #1
    Join Date
    Dec 2006
    Posts
    74
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Doing one thing in one page alters another?

    How can i go about making a page that when i click on the Submit button changes the php code to something else in a different php page?
    example:
    the code in index.php is:
    Code:
    <script language="JavaScript">
    	function next() {
    		clearInterval(si);
    		document.location="?off";
    	}
    	si = setInterval(next,4000);
    </script>
    then when i click on the submit button in a different page it would change the ?off part in to mess.php?
    Code:
    <script language="JavaScript">
    	function next() {
    		clearInterval(si);
    		document.location="mess.php";
    	}
    	si = setInterval(next,4000);
    </script>

  2. #2
    Join Date
    Nov 2006
    Location
    Northeast USA
    Posts
    408
    Thanks
    8
    Thanked 30 Times in 28 Posts

    Default

    I see your Problem...

    The best way I could think of it is using sessions. For Example, A user enters in "pie" for his favorite food. then using the .SESSION. value you can display it on other pages... or like you said "changing the php code on another page. So on the next page you could say "Your Favorite food is pie" or use it as a variable in the php script.
    -File Server Direct

  3. #3
    Join Date
    Aug 2006
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i think str_replace would be good to 'change the php code'

    http://us2.php.net/str_replace
    for more info

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •