Results 1 to 2 of 2

Thread: Need PHP Help!

  1. #1
    Join Date
    Aug 2006
    Location
    United Kingdom
    Posts
    207
    Tokens
    0

    Default Need PHP Help!

    OK I have the following code

    PHP Code:
    <?php
    $id 
    $_POST['id'];
    include(
    'db.php');

    $del="DELETE FROM records WHERE id='$id'";
    mysql_query($del);
    mysql_close();
    echo 
    "<b><center>Record Deleted</center></b><br><br>";

    ?>
    and I have a form that when I type the ID in it and click submit it deletes the record with that ID And It works fine.

    However how can I make it so when I go to

    http://www.mysite.com/delete.php?id=1

    It deletes the record with ID 1

    Thanks to all that help
    PHP Code:
    [LEFT]<?[/LEFT]
    [
    LEFT]$name $_GET['name'];[/LEFT]
    [
    LEFT]echo "Hi, your name is $name";[/LEFT]
    [
    LEFT]?>[/LEFT]
    [LEFT][/LEFT]

  2. #2
    Join Date
    Nov 2004
    Location
    HabboWeb FM Offices
    Posts
    3,019
    Tokens
    0

    Latest Awards:

    Default

    <?php
    $id = $_GET['id'];
    include('db.php');

    $del="DELETE FROM records WHERE id='$id'";
    mysql_query($del);
    mysql_close();
    echo "<b><center>Record Deleted</center></b><br><br>";

    ?>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •