Jump to content

[SOLVED] Auto-redirect after successful add?


outchy

Recommended Posts

I was wondering if there's a way to have a form page automatically redirect to a different url after a successful post to the database, instead of just showing the text "1 show added".  Here is the code:

 

<?php
$con = mysql_connect("localhost","root","root");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_select_db("nik", $con);
$sql="INSERT INTO test (dateofshow, headliner, place, opener)
VALUES
(CONCAT('$_POST[year]','-','$_POST[month]','-','$_POST[day]'),'$_POST[headliner]','$_POST[place]','$_POST[opener]')";
if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "1 show added";
mysql_close($con)
?>

 

 

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.