phppup Posted July 18, 2022 Share Posted July 18, 2022 Within my PHP code is a section as follows echo '<form action="" method="POST"><button type="submit" name="xyz" value="123"> click to apply </button> </form>'; There were some issues with scripting that followed, and I thought I had them figured out. But when I implemented my solutions, the results were inconsistent. I went back to the drawing-board several times until I concluded that the problem wasn't so much with my solution as it was with the server/browser SAVE process. I went to the bottom of my file outside of the ?> tag and typed "TEST in HTML" and it appeared on my webpage I went to the top inside the <? and added echo "TEST PHP"; and it showed up at the top of my page. But when I CHANGE my button from "click to apply" to "never click this button ever ever ever" the "click to apply" remains constant. The characters I replace are not taking affect. I've cleared browser cache and viewed the saved webpage on THREE different PCs on different networks, yet the OLD version continues to appear. Is it me? The code? Seems VERY odd to me. Solution? PS: just REMOVED the entire form code, but the form did not vanish from my webpage Quote Link to comment https://forums.phpfreaks.com/topic/315055-changes-not-taking-affect/ Share on other sites More sharing options...
ginerjm Posted July 18, 2022 Share Posted July 18, 2022 (edited) It always amazes me when people tell us what they did to create a problem but NEVER show us the code that they can so easily see themselves. We are not mind-readers. Here's a little thing I add to most of my pages: <span class='smltxt yellow'>$ver_no</span> where the smltxt class is something that is usually set to 12px. I place this line immediately after my <body> tag and set the value of $ver_no at the top of my script. Then when I make a new change I alter that value, which usually contains the date as well. Something like: Ver. #1.0a 07/18/22 Edited July 18, 2022 by ginerjm Quote Link to comment https://forums.phpfreaks.com/topic/315055-changes-not-taking-affect/#findComment-1598339 Share on other sites More sharing options...
kicken Posted July 18, 2022 Share Posted July 18, 2022 (edited) 19 minutes ago, phppup said: Is it me? The code? Seems VERY odd to me. Solution? Sounds like the most likely cause is you accidentally uploaded the wrong file, uploaded to the wrong path, or edited the wrong file. If not that then maybe some server-side caching is in place that you need to either disable or find a way to clear. Edited July 18, 2022 by kicken Quote Link to comment https://forums.phpfreaks.com/topic/315055-changes-not-taking-affect/#findComment-1598341 Share on other sites More sharing options...
phppup Posted July 18, 2022 Author Share Posted July 18, 2022 (edited) @ginerjm And how is that supposed to help me? How does it even relate to the issue I described??? @kicken It's the right file (edited directly on the server and checked the path several times). Alternately, if it were the incorrect file or path, the other changes that DID show up would not have existed. Is there some way to check or clear the server cache? Or do I need to just wait in hopes that sometime in the future the hosting company flips a switch? Still, seems ODD that some changes are being "accepted". If it were cached, wouldn't everything be cached? Edited July 18, 2022 by phppup Quote Link to comment https://forums.phpfreaks.com/topic/315055-changes-not-taking-affect/#findComment-1598345 Share on other sites More sharing options...
ginerjm Posted July 18, 2022 Share Posted July 18, 2022 Just a tool to make it easier to recognize that your latest version/changes are up on the screen. If I wasted my time excuse me for trying to help you in your time of need. And if you showed us the code that is not showing up properly perhaps there is something there we may see. Quote Link to comment https://forums.phpfreaks.com/topic/315055-changes-not-taking-affect/#findComment-1598346 Share on other sites More sharing options...
kicken Posted July 18, 2022 Share Posted July 18, 2022 12 minutes ago, phppup said: Is there some way to check or clear the server cache? Or do I need to just wait in hopes that sometime in the future the hosting company flips a switch? You'd probably just want to talk to your hosting company to determine if there is a cache and if so, what you can do about it. Alternatively, setup your own local development environment so you have control over such things. Quote Link to comment https://forums.phpfreaks.com/topic/315055-changes-not-taking-affect/#findComment-1598349 Share on other sites More sharing options...
phppup Posted July 18, 2022 Author Share Posted July 18, 2022 @kicken I suppose in the greater scheme of things it's not THAT important. Perhaps I'll just leave the changes and then someday (when I've forgotten about it) I'll take a look and be surprised to see that the button is blue and the phrasing was updated. LOL Quote Link to comment https://forums.phpfreaks.com/topic/315055-changes-not-taking-affect/#findComment-1598350 Share on other sites More sharing options...
ginerjm Posted July 18, 2022 Share Posted July 18, 2022 If you really think you have a caching problem (and still want to resolve this) try adding this to the top of your script: header("Cache-Control: no-store"); Quote Link to comment https://forums.phpfreaks.com/topic/315055-changes-not-taking-affect/#findComment-1598351 Share on other sites More sharing options...
phppup Posted July 18, 2022 Author Share Posted July 18, 2022 header("Cache-Control: no-store"); had no effect Quote Link to comment https://forums.phpfreaks.com/topic/315055-changes-not-taking-affect/#findComment-1598352 Share on other sites More sharing options...
ginerjm Posted July 18, 2022 Share Posted July 18, 2022 Then perhaps it is not a cache problem afterall. Quote Link to comment https://forums.phpfreaks.com/topic/315055-changes-not-taking-affect/#findComment-1598353 Share on other sites More sharing options...
ginerjm Posted July 18, 2022 Share Posted July 18, 2022 Did you maybe forget to upload your revised script? Kind of hard to image removing all the code and yet still be seeing it online if it was truly replaced on your site as well as on your development tool. Or did you perhaps rename your current script and forget to use the new name online? Quote Link to comment https://forums.phpfreaks.com/topic/315055-changes-not-taking-affect/#findComment-1598354 Share on other sites More sharing options...
benanamen Posted July 18, 2022 Share Posted July 18, 2022 1 hour ago, phppup said: edited directly on the server As @kicken mentioned, you need to set up a local development environment. Editing directly on the production server is just a bad idea for many reasons. If you are on Windows, the best local dev setup is Laragon.https://laragon.org/ Quote Link to comment https://forums.phpfreaks.com/topic/315055-changes-not-taking-affect/#findComment-1598355 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.