str0kes Posted July 29, 2012 Share Posted July 29, 2012 Hello guys, I have problem with the script i was coding. This is a simple news script. I am not able to add information to the database. I don't know what Im doing wrong. Here is my php code: <?php if (isset($_POST['submit'])) { $title=$_POST['title']; $small_text =$_POST['small_text']; $full_text=$_POST['full_text']; include("connectmysql.php"); mysql_query("insert into main (id,title,small_text,full_text) values('$id','$title','$small_text','$full_text')"); } ?> here is html: <FORM name="forma2" action="?" method="post" enctype="multipart/form-data"> <TABLE> <TR> <TD>Title</TD> <TD> <input type="text" size="70" name="title"> </TD> </TR> <TR> <TD>small text</TD> <TD> <input type="text" size="80" name="small_text"> </TD> </TR> <TR> <TD>full text</TD> <TD> <textarea cols="60" rows="12" name="full_text"></textarea> </TD> </TR> <TR> <TD>picture</TD> <TD><input type="file" name="picture"></TD> </TR> <TR> <TD>picture</TD> <TD><input type="file" name="picture2"></TD> </TR> <TR> <TD>picture</TD> <TD><input type="file" name="picture3"></TD> </TR> <TR> <TD>picture</TD> <TD><input type="file" name="picture4"></TD> </TR> <TR> <TD>picture</TD> <TD><input type="file" name="picture5"></TD> </TR> <TR> <TD>picture</TD> <TD><input type="file" name="picture6"></TD> </TR> <TR> <TD></TD> <TD><input type="submit" value="submit"></TD> </TR> </TABLE> </form> I tried to use $id=Time("U"); and then i used $id=$_POST[id] but didn't get it working. Any help please? Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/266406-problems-with-database/ Share on other sites More sharing options...
jazzman1 Posted July 30, 2012 Share Posted July 30, 2012 I don't see input element with name - submit. Quote Link to comment https://forums.phpfreaks.com/topic/266406-problems-with-database/#findComment-1365320 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.