Jump to content


Photo

Deleting rows only works on localhost and not online?


  • Please log in to reply
23 replies to this topic

#21 brown2005

brown2005
  • Members
  • PipPipPip
  • Advanced Member
  • 943 posts

Posted 17 July 2006 - 03:19 PM

<?

session_start();


$id = $_GET['idfield'];
$cmd = $_GET['cmd'];

include('dbconnect.php');

if(!isset($cmd))
{

  $result = mysql_query("select * from `affiliate`") or die(mysql_error());
 
  while($r=mysql_fetch_array($result))
  {

      $title=$r["titlefield"];
      $id=$r["idfield"];
   
 
      echo "<a href='affildelete.php?cmd=delete&idfield=$id'>$title - Delete[/url]";
      echo "
";
    }
}


elseif($cmd == "delete")
{

    $sql = "DELETE FROM affiliate WHERE idfield='$id'";
    $result = mysql_query($sql) or die(mysql_error());
    echo "Link verwijderd!";
}

?>

I HAVE CREATED THAT FILE AND UR CONNECTION FILE AND IT WORKS FINE...

#22 brown2005

brown2005
  • Members
  • PipPipPip
  • Advanced Member
  • 943 posts

Posted 17 July 2006 - 03:23 PM

http://www.fantasy-c...affildelete.php

see it here

#23 hvle

hvle
  • Members
  • PipPipPip
  • Advanced Member
  • 667 posts
  • Locationmelbourne, Australia

Posted 17 July 2006 - 03:27 PM

look like it works
Life's too short for arguing.

#24 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 17 July 2006 - 03:27 PM

If it works on 'localhost' and doesn't work on a live server, then almost certainly the 'problem' is one associated with the state of register_globals (probably ON on localhost and OFF on the live server). That code snippet doesn't appear to retrieve the value of the variable $cmd.
Legend has it that reading the manual never killed anyone.
My site




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users