go to a URL after delete

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • webandwe
    New Member
    • Oct 2006
    • 142

    go to a URL after delete

    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.p hp>
    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($qu ery); }
    ;
    mysql_close($co n);
    ?>

    Kind Regards
    Webandwe
  • brid
    New Member
    • Oct 2006
    • 13

    #2
    [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($qu ery);
    mysql_close($co n);

    header("Locatio n: URL");

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

    Where URL is yours. (ex.: result.php)

    Comment

    • webandwe
      New Member
      • Oct 2006
      • 142

      #3
      Hi

      The scipt only work half.

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

      Kind Regards

      Comment

      • brid
        New Member
        • Oct 2006
        • 13

        #4
        Sorry, replace
        <form name=example method=post action=delete.p hp>
        on
        <form name=example method=post>

        Comment

        Working...