Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

refresh submit problem

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

refresh submit problem

Postby speedamp » Tue Dec 02, 2003 12:45 pm

hello.

I am submitting a form, and then would simply like to refresh the page (or redirect to the same page).

Can somebody tell me what i'm doing wrong?

---------------------------------------------------------------------------------

if($submit){
$sql = "UPDATE runner SET run_id='$run_id',club='$club',first='$first',last='$last',age='$age',sex='$sex',race='$race' WHERE run_id=$run_id";
$result=mysql_query($sql);
echo"Thank you! Information updated.\n";
header("Location:".$_SERVER['PHP_SELF']."");
} elseif ($delete) {

// delete a record

$sql = "DELETE FROM runner WHERE run_id=$run_id";

$result = mysql_query($sql);

echo "$sql Record deleted!<p>";

header("Location:".$_SERVER['PHP_SELF']."");
------------------------------------------------------------------------------------


How would I echo the message "record deleted", wait 5 seconds, and then refresh the page?

-Michael
speedamp
New php-forum User
New php-forum User
 
Posts: 19
Joined: Sun Nov 16, 2003 9:12 am

Postby swirlee » Tue Dec 02, 2003 12:54 pm

Double post. KO'd by swirlee.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.