christo Posted May 7, 2006 Share Posted May 7, 2006 This time from scrip1.php i need to press a button and it will send a value (number) to another script2.php that will erase a row from the DB so at script1.php i have :[code] echo " </table><br><td><form method=post action=upd_obj.php><input type=submit value='Modifier une annonce '> N°:<input type=text name=objid size=1></form></td>";[/code]//the value i need to sent is objid...a box next to Nand at script2.php :[code] $objid = $HTTP_POST_VARS['objid']; // in order to bring the value submited by post...at thisline a get the Notice too :(//conncetion with DB$query="DELETE * FROM object WHERE objid=$objid";$resultat=mysql_query($query); [/code]The message i get...[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Notice: Undefined index: objid in c:\foreign\easyphp1-8\www\agence\test\del_obj.php on line 21[/quote]what have i done wrong, any ideas ???Christos Quote Link to comment Share on other sites More sharing options...
Barand Posted May 7, 2006 Share Posted May 7, 2006 See[a href=\"http://www.phpfreaks.com/forums/index.php?act=ST&f=1&t=92933&hl=&view=findpost&p=371960\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?...ndpost&p=371960[/a] Quote Link to comment Share on other sites More sharing options...
christo Posted May 7, 2006 Author Share Posted May 7, 2006 hmm i don't understand your point !Myself i send data via post and it should work normally, do you mean i should try $_REQUEST (i tried it) the isset thing is no use for me...or maybe i don't see what you're trying to explaing me :( Can you be more clear ?christos Quote Link to comment Share on other sites More sharing options...
christo Posted May 7, 2006 Author Share Posted May 7, 2006 K problem sorted but there is another one :)I manage to pass the value but it won't delete the row from the DB...[code]$objid = $HTTP_POST_VARS['objid'];echo"objid=$objid";//connection$db_conx = mysql_connect($host,$user,$pass) or print("error de connection mysql");mysql_select_db($base, $db_conx) or print("error connection base");$query="DELETE * FROM object WHERE objid=$objid";$resultat=mysql_query($query); if ($resultat) { echo"deleted !"; } else { echo" problem !"; }My request seems ok,right? Quote Link to comment Share on other sites More sharing options...
christo Posted May 7, 2006 Author Share Posted May 7, 2006 sorted ,no need for * at the request ... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.