Need help with php coding...

LuckyTaxi

Diamond Member
Dec 24, 2000
6,044
23
81
Ok ... I have a php script that inputs names into a databse. if it's successful in doing so i would like to redirect user to the main page.

here's what i have so far. I have it display a generic message like "Successful" but i would like to return the user to the main page. obviously that last line didn't work and the page goes nowhere.

<?

@ $db = mysql_connect("localhost", "ki3_list", "!list!");

if (!$db)
{
echo "Error: Could not connect to database!";
exit;
}
mysql_select_db("ki3_list");
$query = "insert into list values
('$email')";
$result = mysql_query($query);
if($result)
echo "<meta HTTP-EQUIV='REFRESH' content='0'; url='index.html'>";
?>
 

kt

Diamond Member
Apr 1, 2000
6,032
1,348
136
use

header("Location: success.html")

and redirect to main page using meta tag in success.html
 

LuckyTaxi

Diamond Member
Dec 24, 2000
6,044
23
81
ok ... figured it out ... but now my bro says he rather have a popup box. how can i make it popup a box that says the user was successful in submitting ... blah blah blah