Jump to content

Is this a common thing? issue with "<?php echo $PHP_SELF;?>"


xwishmasterx

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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:)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.