refresh submit problem

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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

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

User avatar
swirlee
Moderator
Moderator
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

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

Double post. KO'd by swirlee.


Return to “PHP coding => General”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest