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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.