drath Posted July 22, 2008 Share Posted July 22, 2008 This is more of a logic question, so I may reveal some stupidity here . Say for example that I already echoed data in a previous location in the PHP code. For speed reasons, I want to go back after I already echoed that information. Is there a good way to go back and edit that previously echoed information. I know of the InnerHTML property with JavaScript, but I am trying for a non-JavaScript solution, PHP is ultimately more reliable anyways. Quote Link to comment https://forums.phpfreaks.com/topic/116075-changing-previously-echoed-information/ Share on other sites More sharing options...
jonsjava Posted July 22, 2008 Share Posted July 22, 2008 look into ob_start. It's saved my butt a few times. Quote Link to comment https://forums.phpfreaks.com/topic/116075-changing-previously-echoed-information/#findComment-596853 Share on other sites More sharing options...
.josh Posted July 22, 2008 Share Posted July 22, 2008 ob_start only works before the data is sent to the browser. If you're looking to have things change in "real time" as in, "123" is echoed in someone's browser and you're wanting some event to make it change to "456" in the browser, this is not possible with php alone, because php is parsed and executed on the server and then the results sent to the browser. If you want a "real time" solution you're going to have to go with javascript or ajax. Or just stick to clicking a link or form button and submitting and reprocessing/displaying as a whole with php. Quote Link to comment https://forums.phpfreaks.com/topic/116075-changing-previously-echoed-information/#findComment-596855 Share on other sites More sharing options...
jonsjava Posted July 22, 2008 Share Posted July 22, 2008 yes, ob_start only works before output, but he said he only echoed data in a previous location. He didn't say it had gone to screen yet. Quote Link to comment https://forums.phpfreaks.com/topic/116075-changing-previously-echoed-information/#findComment-596859 Share on other sites More sharing options...
drath Posted July 22, 2008 Author Share Posted July 22, 2008 Sorry for the mix-up, yes I meant that the echoed information had already gone to screen. I guess I'll have to try to make JavaScript work more reliably for what I am doing... somehow... haha. Quote Link to comment https://forums.phpfreaks.com/topic/116075-changing-previously-echoed-information/#findComment-596860 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.