ricferr Posted October 22, 2009 Share Posted October 22, 2009 Hi all, I had this form running for a website and, apparently without any reason, it stopped working. When the submit button is pressed, it just reloads the page. I tried uploading an old version of the form, which I'm sure to be working fine when it was removed (more than a year ago) and it too doesn't work. It has been suggested that some new PHP patch may have been released and, thus, stopping my form is from running. I'm uploading the form just in case someone has any idea. thanks in advance regards Ricardo Ferreira [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
cbolson Posted October 22, 2009 Share Posted October 22, 2009 Hi there, First thing that I noticed is that the code uses the deprecated php short tags. ie <? rather than the (now) correct <?php Newer versions of php have the short tags turned off. Try changing all them and see if it works. Chris Quote Link to comment Share on other sites More sharing options...
cbolson Posted October 22, 2009 Share Posted October 22, 2009 OK, I have checked your site out and the page is working (ie no php errors)so it is not what I said though it would be a good idea to make that change anyway. So, it is probably due to the fact that you aren't referring to the posted variable correctly. The code uses the variable name directly "assuming" that php know what they are (again, a server side configuration setting) For example you have this: if ($Submit) That should be : if (isset($_POST["Submit"]) Likewise for all the variables within that conditioned section that is supposed to be reading the posted values. Chris Quote Link to comment Share on other sites More sharing options...
cags Posted October 22, 2009 Share Posted October 22, 2009 As cbolson has stated, your script relies on register_globals being set to on in the php.ini. The most likely thing thats happened is your webhost has realised the security hole this can be and has disabled it. You can check the setting using phpinfo. If it is disabled, cbolson has already provided the fix. Quote Link to comment Share on other sites More sharing options...
ricferr Posted October 25, 2009 Author Share Posted October 25, 2009 Thanks everyone for the help. The form is now working fine. However, a problem persists with the photo gallery. Before this PHP update, when clicking on a thumbnail, a new window would open with the full size version of the chosen pic. Now, the window opens but the pic is not found. I don't think the same solution applies to this problem as the variable from the thumbnails page is not sent with the POST method. I'm uploading both the thumbnails file and the pics file. Thanks in advance regards RF [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
cbolson Posted October 25, 2009 Share Posted October 25, 2009 Yes, it looks like exactly the same problem. The register_globals applies to all variables passed, be it via POST or GET. For the he photos you need to use $_GET as they are being passed via the url. Chris Quote Link to comment Share on other sites More sharing options...
ricferr Posted October 25, 2009 Author Share Posted October 25, 2009 Thanks! it worked great! regards RF Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.