xwishmasterx Posted May 20, 2012 Share Posted May 20, 2012 Hello I have a from that updates a few things in the db, and uses "<?php echo $PHP_SELF;?>". The form does update everything fine, however that page does not reflect it. If I refresh the page manually I can see the new values. Is this a common thing, and can anything be done to fix this? Quote Link to comment https://forums.phpfreaks.com/topic/262844-is-this-a-common-thing-issue-with/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 20, 2012 Share Posted May 20, 2012 That symptom generally indicates that the order of your logic on the page is backwards. Your code on the page is likely retrieving the data before you are updating/altering the data, so you get the initial data values displayed, not the updated ones. BTW, $PHP_SELF was depreciated and turned off by default 10 years ago, throws a depreciated error when turned on starting in php5.3 (where the depreciated errors were introduced), and has been completely removed in php5.4. You would use $_SERVER['PHP_SELF'] or more simply leave the action='' attribute blank to submit to the same page. Quote Link to comment https://forums.phpfreaks.com/topic/262844-is-this-a-common-thing-issue-with/#findComment-1347160 Share on other sites More sharing options...
xwishmasterx Posted May 20, 2012 Author Share Posted May 20, 2012 ofcourse, that makes perfect sense...as I update db after retrieving the current values..thanks a bunch. PS. thanks for letting me know that "$PHP_SELF was depreciated and turned off by default 10 years ago", maybe I should start paying attention to post dates when using tutorials:) Quote Link to comment https://forums.phpfreaks.com/topic/262844-is-this-a-common-thing-issue-with/#findComment-1347161 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.