472,141 Members | 1,595 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,141 software developers and data experts.

go to a URL after delete

142 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
3 4732
brid
13
[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
webandwe
142 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
brid
13
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 | last post: by
9 posts views Thread by rohits123 | last post: by
10 posts views Thread by jeffjohnson_alpha | last post: by
15 posts views Thread by LuB | last post: by
29 posts views Thread by =?Utf-8?B?R2Vvcmdl?= | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.