Jump to content

refresh


Jay2391

Recommended Posts

is there a command that you can tell a page after you submit this refresh the page....

 

what is happening is that I Submit and my DB gets updated... and i stay on the same page wich i want ....

but not until I hit Refresh or Go or Simply Submit again that the results how ...so is working but like a double

click ....

 

All I want is that when i Submit Stay on the same page and refresh to show the update...

 

 

 

print "<h5><form action=\"user_profile.php?user_id=$user_name\" method=\"post\"><p>";
<input type=\"submit\" name=\"submit_away\" size=\"20\" value=\"Submit Scores\"/>";

if ( isset ($_POST['submit_away'])){
                   $problem = FALSE;
				   			        
if($vscr == $hvscr){
      $problem = TRUE;
                   print '<p>Not a valid Score</p>';
}

if($vscr == 0 and $hvscr == 0){
      $problem = TRUE;
                   print '<p>One team must have a Score</p>';
}

if (empty ($_POST['hvscore'])){
       $problem = TRUE;	
       print '<p>Please enter Home Team Score</p>';			  
}
if (empty ($_POST['vscore'])){
        $problem = TRUE;
        print '<p>Please enter Visiting Team Score</p>';			  
	                    }
						 	  
if($problem == FALSE){							
        $change_vs = "UPDATE $table_vs SET hv_scr='$hvscr', v_scr=$vscr WHERE (vs_id=\"$vs_id2\")";  
                     mysql_query($change_vs) or die ("Cannot Update Table". mysql_error());


	                    }

			        }



Link to comment
https://forums.phpfreaks.com/topic/38785-refresh/
Share on other sites

Erm... headers need to be right at the top of the page if you havent got output_buffering on.

 

Personally I use output_buffering (in php.ini) if you turn that to On then you wont get that error.

Otherwise you would need to put the header code before any outputted html code (someone correct me if im wrong there).

Link to comment
https://forums.phpfreaks.com/topic/38785-refresh/#findComment-186447
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.