darkfreaks Posted January 9, 2009 Share Posted January 9, 2009 appearantly my code is inserting everytime someone hits backspace on there browser or keyboard. ive tried passing it as a session and unsetting it and session_destroy it. it works fine but still refreshes. <?php if(isset($_POST['submit_Score'])){ session_start(); $_SESSION['score'] = trim(strip_tags($_POST['show'])); if(isset($_SESSION['score'])){ $score = $_SESSION['score'];}else { echo 'session not created';} $gameScore = $score / 4; $gameScoreFinal = round($gameScore); points("$game", "$username", "$gameScoreFinal"); echo "You have recieved <b> $gameScoreFinal</b> CP's. They have been added to your account.<br><br><center> <!-- google_ad_client = \"pub-1131506519615518\"; google_ad_width = 125; google_ad_height = 125; google_ad_format = \"125x125_as\"; google_ad_type = \"text_image\"; //2007-06-08: chicka_bubblepop google_ad_channel = \"0950382107\"; google_color_border = \"FFFFFF\"; google_color_bg = \"FFFFFF\"; google_color_link = \"F24475\"; google_color_text = \"000000\"; google_color_url = \"000000\"; //--> </script> <script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"> </script><script type=\"text/javascript\"><!-- google_ad_client = \"pub-1131506519615518\"; google_ad_width = 125; google_ad_height = 125; google_ad_format = \"125x125_as\"; google_ad_type = \"text_image\"; //2007-06-08: chicka_bubblepop google_ad_channel = \"0950382107\"; google_color_border = \"FFFFFF\"; google_color_bg = \"FFFFFF\"; google_color_link = \"F24475\"; google_color_text = \"000000\"; google_color_url = \"000000\"; </script> <script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"> </script></center>"; unset($gameScoreFinal); // resets the final game score session_destroy();//destroy the session }?> Link to comment https://forums.phpfreaks.com/topic/140122-solved-how-to-stop-page-refresh/ Share on other sites More sharing options...
darkfreaks Posted January 9, 2009 Author Share Posted January 9, 2009 Solved!!!! i just put submit_score as a session Link to comment https://forums.phpfreaks.com/topic/140122-solved-how-to-stop-page-refresh/#findComment-733139 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.