underv3 Posted November 8, 2008 Share Posted November 8, 2008 Just to start I do know about the method to use a hyperlink but it does reload the page. The reason why I need the page to not be reloaded is because it is a sort of query page that query's the database. It is dynamic, as in before you go to the query page you have to select (from a drop down menu) which topics you would like to display. The query page then gets the post values. When you reload the page it gives the form resubmission error. I'm going to take a guess and say there is a way to store those post value upon a reload, but I am not sure. If someone could help me out with this that would be great Thanks! Link to comment https://forums.phpfreaks.com/topic/131879-solved-a-way-to-call-a-function-with-out-reloading-using-a-hyperlink/ Share on other sites More sharing options...
iversonm Posted November 8, 2008 Share Posted November 8, 2008 my closest guess would be ajax, look into it Link to comment https://forums.phpfreaks.com/topic/131879-solved-a-way-to-call-a-function-with-out-reloading-using-a-hyperlink/#findComment-685128 Share on other sites More sharing options...
Jeremysr Posted November 8, 2008 Share Posted November 8, 2008 You could store the $_POST variables as $_SESSION variables on the first entry, and then stop using $_POST when refreshing. You'd put something like this at the top of your script: session_start(); if ($_POST) { $_SESSION['blah'] = $_POST['blah']; $_SESSION['bleh'] = $_POST['bleh']; // "Refresh" the page without POSTage. Your $_POST variables are safely stored in $_SESSION header('Location: this_page.php'); die; } $blah = $_SESSION['blah']; $bleh = $_SESSION['bleh']; // your script continues here... Link to comment https://forums.phpfreaks.com/topic/131879-solved-a-way-to-call-a-function-with-out-reloading-using-a-hyperlink/#findComment-685129 Share on other sites More sharing options...
underv3 Posted November 8, 2008 Author Share Posted November 8, 2008 I was getting an error but after googleing it I just found out I literally have to put it at the top (because I have mixed html and php) so I put it below some html initially. Thanks for your help! Link to comment https://forums.phpfreaks.com/topic/131879-solved-a-way-to-call-a-function-with-out-reloading-using-a-hyperlink/#findComment-685143 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.