twitch987 Posted January 14, 2009 Author Share Posted January 14, 2009 tested it on a free account i just set up with a different provider, i get the same results.. its not the form thing heres both files so far the PHP <?php echo "form submitted"; ?> <? include("dbinfo.inc.php"); mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die(mysql_error()); foreach ($_POST as $key => $val) echo "key :: $key => value :: $val <br />"; $bedrooms=$_POST['bedrooms']; $bathrooms=$_POST['bathrooms']; $area=$_POST['area']; $postcode=$_POST['postcode']; $ref=$_POST['ref']; $description=$_POST['description']; $rentpw=$_POST['rentpw']; $rentpm=$_POST['rentpm']; $deposit=$_POST['deposit']; $propertynear=$_POST['propertynear']; $availability=$_POST['availability']; $type=$_POST['type']; $address=$_POST['address']; $image=$_POST['image']; $query = "INSERT INTO lettings VALUES ('','$bedrooms','$bathrooms','$area','$postcode','$ref','$description','$rentpw','$rentpm','$deposit','$propertynear','$availability','$type','$address','$image')"; mysql_query($query); ?> <br> <? echo($query); mysql_close(); ?> the form <form action="insert.php"> bedrooms: <input type="text" name="bedrooms"><br> bathrooms: <input type="text" name="bathrooms"><br> area: <input type="text" name="area"><br> postcode: <input type="text" name="postcode"><br> ref: <input type="text" name="ref"><br> description:<input type="text" name="description"><br> rent pw: <input type="text" name="rentpw"><br> rentpm: <input type="text" name="rentpm"><br> deposit: <input type="text" name="deposit"><br> availability: <input type="text" name="availability"><br> type: <input type="text" name="type"><br> address: <input type="text" name="address"><br> image: <input type="text" name="image"><br> <input type="submit" method="post"> </form> all im getting is INSERT INTO lettings VALUES ('','','','','','','','','','','','','','','') Quote Link to comment https://forums.phpfreaks.com/topic/140736-solved-phpmysql-question-de-ja-vu/page/2/#findComment-736710 Share on other sites More sharing options...
twitch987 Posted January 14, 2009 Author Share Posted January 14, 2009 by the way, i think the form is working fine as when i submit the url has all this in it /insert.php?bedrooms=4&bathrooms=1&area=leeds&postcode=LS9+0NN&ref=JDU7362&description=nice+place+to+live&rentpw=50&rentpm=500&deposit=500&availability=2009-01-01&type=flat&address=112+moon&image=http%3A%2F%2Fhealth.discovery.com%2Fcenters%2Fkids%2Fchildproof%2Fimages%2Fhouse_off.gif Quote Link to comment https://forums.phpfreaks.com/topic/140736-solved-phpmysql-question-de-ja-vu/page/2/#findComment-736716 Share on other sites More sharing options...
uniflare Posted January 14, 2009 Share Posted January 14, 2009 ah , little mistake there on your html form tag, make sure you express method="post". ie: <form action="insert.php" method="post"> when ou get a URL like that it means your sending a GET query, accessible via the $_GET global. Quote Link to comment https://forums.phpfreaks.com/topic/140736-solved-phpmysql-question-de-ja-vu/page/2/#findComment-736722 Share on other sites More sharing options...
twitch987 Posted January 14, 2009 Author Share Posted January 14, 2009 i knew it had to be something stupid! something very stupid too as if ya look method="post" is in the last <input> tag.. thanks a million man.. i can sleep now! 3am lol.. woot - what a day. Quote Link to comment https://forums.phpfreaks.com/topic/140736-solved-phpmysql-question-de-ja-vu/page/2/#findComment-736727 Share on other sites More sharing options...
revraz Posted January 14, 2009 Share Posted January 14, 2009 Your first post had it right <form action="insert.php" method="post"> Why did you move it? Quote Link to comment https://forums.phpfreaks.com/topic/140736-solved-phpmysql-question-de-ja-vu/page/2/#findComment-736729 Share on other sites More sharing options...
twitch987 Posted January 14, 2009 Author Share Posted January 14, 2009 you know what, i have got no idea at all. i've been chopping and changing things half asleep for a few hours now just getting more and more frustrated - i dont actually remember doing it.. time for some food and bed.. thanks to all that have helped me on my posts today all the input has helped alot.. and um.. yeah.. sorry for being blonde lol Quote Link to comment https://forums.phpfreaks.com/topic/140736-solved-phpmysql-question-de-ja-vu/page/2/#findComment-736731 Share on other sites More sharing options...
uniflare Posted January 14, 2009 Share Posted January 14, 2009 hey np everyones here to help each other. Sometimes we just need a fresh pair of eyes . Quote Link to comment https://forums.phpfreaks.com/topic/140736-solved-phpmysql-question-de-ja-vu/page/2/#findComment-736732 Share on other sites More sharing options...
ngreenwood6 Posted January 14, 2009 Share Posted January 14, 2009 hey man just figured I would pop in on this thread to make sure that you use the method="post". That was the same thing that you ran into in the script I helped you with lol. get some rest and start over tomorrow lol. Quote Link to comment https://forums.phpfreaks.com/topic/140736-solved-phpmysql-question-de-ja-vu/page/2/#findComment-736733 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.