note 99239 rejected from function.mysql-insert-id by salathe

From: Date: Thu, 05 Aug 2010 11:22:41 +0000
Subject: note 99239 rejected from function.mysql-insert-id by salathe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-171392@lists.php.net to get a copy of this message
Note Submitter: daniel_chereji at hotmail dot com ---- Hi everyone, i have this php script: <html> <head> <link rel="stylesheet" href="/style/MYSTYLE.CSS" type="text/css"> <meta name="verify-v1" content="52vQ/BcSvsm6MlAsynpikrmlr2b9x0Q5Xam38QWYKcc=" > </head> <body> <table bgcolor="#ffffff" width="100%" height="100%" align="center" border="0"><tbody valign="top"><tr><td width="100%" height="100%" align="center"> <form name="formular" action="adauga_tablou_db.php" method="POST"><table><tbody valign="top"><tr><td><p>Nume tablou</p></td><td><input type="text" name="nume_tablou" /></td><td></tr> <tr><td><p>Numar inregistrari</p></td><td><input type="text" name="numar_inregistrari" /></td><td></tr> <tr><td></td><td><input type="submit" name="adauga_tablou" value="Adaug&#259;"/><input type="reset" name="reset" value="&#350;terge" /></td></tr></tbody></table></form> <?php $nume_tablou=$_POST['nume_tablou']; $numar_inregistrari=$_POST['numar_inregistrari']; $daniel = fopen("logare.daniel","r") ; $citeste = fscanf ($daniel, "%s\t%s\t%s\t%s") ; list ($h,$u,$p,$d) = $citeste; $host=$h; // Host name $username=$u; // Mysql username $password=$p; // Mysql password $db_name=$d; // Database name mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); /*$creaza_tablou=mysql_query("CREATE TABLE Metatag(CelCareNumaraTotTimpul INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(CelCareNumaraTotTimpul), metataguri VARCHAR(40000))"); if(!$creaza_tablou){ echo"<br />Nu s-a creat tabloul!".mysql_error(); } else{echo"<br />S-a creat tabloul!";}*/ fclose($daniel); if(isset($_POST['adauga_tablou'])){ $nume_tablou=$_POST['nume_tablou']; $numar_inregistrari=$_POST['numar_inregistrari']; $scrie=fopen("numar_inregistrari.dan","w"); $scrie=fwrite($scrie,"%d".$numar_inregistrari); echo"<p><small>Numar inreg:".$numar_inregistrari."</small><br />"; if(empty($nume_tablou) || empty($numar_inregistrari)){ die('S&#259;r&#259;cie la completare!');} echo"<form name='formular1' action='adauga_tablou_db.php' method='POST'><table><tbody><tr><td></td><td><p><b>Nume inregistrare</b></p></td><td><p><b>Tipul inregistrarii</b></p></td><td><p><b>Lungimea Inregistrarii<input type='hidden' name='fantoma' value='".$numar_inregistrari."' /></b></p></td></tr>"; for($i=1;$i<=$numar_inregistrari;$i++){ echo"<tr><td><p><b>".$i."</b></p></td><td><input type='text' name='nume_inregistrare".$i."' /></td><td><select name='tip_inregistrare".$i."'><option value='1'>INT</option><option value='2'>VARCHAR</option><option value='3'>TEXT</option><option value='4'>DATE</option></select></td><td><input type='text' name='lungime_inregistrare".$i."' /></td></tr>";} echo"<tr><td></td><td><input type='submit' name='adauga_tablou1' value='Adauga tablou' /><input type='reset' name='sterge' value='Sterge tot' /></td></tr></tbody></table></form>"; fclose($scrie); } if (isset($_POST['adauga_tablou1'])) { $fantoma=$_POST['fantoma']; echo"Numar inreg.:".$fantoma; for($d = 1; $d <= $fantoma; $d++) { $nume_inregistrare[$d]=$_POST['nume_inregistrare[$d]']; echo"-->".$nume_inregistrare[$d]."<--<br />"; } } ?> </td></tr></tbody></table> </body></html>. Ok, all is working but i cannot read the values of text fields named "nume_inregistrare" and "tip_inregistrare" and "lungime_inregistrare" from form "formular1" vhen press the submit button named "adauga_tablou1".I try here f (isset($_POST['adauga_tablou1'])) { $fantoma=$_POST['fantoma']; echo"Numar inreg.:".$fantoma; for($d = 1; $d <= $fantoma; $d++) { $nume_inregistrare[$d]=$_POST['nume_inregistrare[$d]']; echo"-->".$nume_inregistrare[$d]."<--<br />"; } } to read the values of nume_inregistrare and tip_inregistrare and lungime_inregistrare.If have an idea about my problem please answer me.Thanks a lot

« previous php.notes (#171392) next »