Log in

View Full Version : Doing one thing in one page alters another?



lankinator
02-10-2007, 12:52 PM
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:

<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?

<script language="JavaScript">
function next() {
clearInterval(si);
document.location="mess.php";
}
si = setInterval(next,4000);
</script>

fileserverdirect
02-13-2007, 02:17 AM
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

cursed
02-13-2007, 02:34 AM
i think str_replace would be good to 'change the php code'

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