bigtimslim Posted April 9, 2008 Share Posted April 9, 2008 I have created a php page that takes some text and an image path then on submit posts to itself and creates a new image and saves it and displays it. I want the user to be able to easily do this again right away with another image and or text so on the 'submitted' page I have a link back to itself. Problem with this is when submit is hit with the new info entered, it gives me the result of the last submission. I have to hit refresh, and the browser asks me if im sure. Is there a way around this, or is my method just stupid and there is a better way of handling this? thanks. Link to comment https://forums.phpfreaks.com/topic/100262-solved-php-page-that-posts-to-iteself/ Share on other sites More sharing options...
p2grace Posted April 9, 2008 Share Posted April 9, 2008 Change your code, instead of giving the result of the last submission have it create a status saying it was successful and reshow the form. Link to comment https://forums.phpfreaks.com/topic/100262-solved-php-page-that-posts-to-iteself/#findComment-512657 Share on other sites More sharing options...
writer Posted April 9, 2008 Share Posted April 9, 2008 instead of giving the result of the last submission have it create a status saying it was successful and reshow the form. As the first line of your process.php code: header("Location: http://localhost/~formlocation"); That should take care of it. It will refresh and appear as if it was "posting to itself." Link to comment https://forums.phpfreaks.com/topic/100262-solved-php-page-that-posts-to-iteself/#findComment-512676 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.