467,166 Members | 1,035 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,166 developers. It's quick & easy.

go to a URL after delete

100+
Hi

How do I go to another URL after my php has deleted the requsted information.

Here is of my coding:

----------------------------------
<form name=example method=post action=delete.php>
Delete Heading : <input type=text name=delete><br>
<input type=submit value=Delete>
</form>

<?php
$con = mysql_connect("my logon details");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("my DB", $con);


if($_POST['delete']){ $query = "DELETE FROM contacts WHERE heading='" . $_POST['delete'] . "'"; mysql_query($query); }
;
mysql_close($con);
?>

Kind Regards
Webandwe
Oct 19 '06 #1
  • viewed: 4535
Share:
3 Replies
[PHP]
<?php
$con = mysql_connect("my logon details");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("my DB", $con);


if($_POST['delete']) {
$query = "DELETE FROM contacts WHERE heading='" . $_POST['delete'] . "'"; mysql_query($query);
mysql_close($con);

header("Location: URL");

} else {
?>
<form name=example method=post action=delete.php>
Delete Heading : <input type=text name=delete><br>
<input type=submit value=Delete>
</form>
<?
}
?>
[/PHP]

Where URL is yours. (ex.: result.php)
Oct 19 '06 #2
100+
Hi

The scipt only work half.

I go directly to my other page before I have filled out the delete.

Kind Regards
Oct 19 '06 #3
Sorry, replace
<form name=example method=post action=delete.php>
on
<form name=example method=post>
Oct 19 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Dave | last post: by
1 post views Thread by Nimmi Srivastav | last post: by
3 posts views Thread by Nimmi Srivastav | last post: by
1 post views Thread by Douglas Peterson | last post: by
2 posts views Thread by Dave | last post: by
3 posts views Thread by silver360@gmail.com | last post: by
9 posts views Thread by rohits123@gmail.com | last post: by
10 posts views Thread by jeffjohnson_alpha@yahoo.com | last post: by
15 posts views Thread by LuB | last post: by
29 posts views Thread by =?Utf-8?B?R2Vvcmdl?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.