PDA

View Full Version : works on one server, not on another


Ultragames
09-20-2004, 05:52 PM
Test page (http://www.armitrex.com/PHP%20TESTS/Store/store1.php)

This page works on my server. But not my school server. When i say 'works' what i mean, is that if you fill in only some of the feilds, and click submit, on my server, it will bring you back to the page, with the old information still in the forms, and tell you to fill in the rest. On my school server, no information is passed to the page again. it only in effect, refreshes the page.

if any one can figure out why this would work on one server and not another... thank you..
i know my server is PHP 5, and my school server is PHP 4.3 orsomething like that.

Bye

Spookster
09-20-2004, 06:11 PM
Without seeing any code we could only speculate what the problem might be.

Ultragames
09-20-2004, 06:22 PM
What parts of code would be needed. Im not sure if it would be safe to give out the entire code considering its use.

raf
09-21-2004, 12:23 AM
if you use the back-button or some javascript to go one page back in the history, then the formresetting is a serversetting. i remember reading about it and it has come up here a few times but i can't realy find it anymore :o

the way that you validate the form and redirect, is probably the real, underlying, problem.
i always use multipurpose pages, where the formprocessing and formbuilding happens in one page. If the form is not filed in correctly, it is reloaded with the posted values injected into the formfields (like
echo '<input type="text" name="foo" id="foo" value="'. $_POST['foo'] .'" />'
) The first time that it loads, no value will be injected since $_POST['foo'] wount be set, the second time, the posted value is injected, and you could keep reloading the form, the value will allways be there.

Ultragames
09-21-2004, 02:13 AM
True. But all of those things work in my powweb.com server. Just not on my school server. It works perfectly on the powweb one. And evidentaly, both servers have the same PHP versions.

fci
09-21-2004, 03:03 AM
is register globals on?

echo 'register globals....' . ini_get('register_globals');