I tried to do a script to upload content to my website, its really simple, i've already created DB and title/cons/text. send.php <?php $require("connectdb.php"); $sqlinsert = "INSERT INTO 'Cheats' ( 'title' , 'cons' , 'text' ) VALUES ('$title' , '$cons' , '$text')"; mysql_query($sqlinsert) or die ("Error"); echo "Cheat $title added"; ?> add.php <form action="send.php" method="post" name="Cheats" id="Cheats"><table width="300"><tr><td>Game name:</td><td><input name="title" type="text" id="title" size="30"></td></tr></table> <p> <select name="cons" size="5" id="cons"> <option value=1 id="Playstation">Playstation <option value=2 id="Playstation 2">Playstation 2 </select> </p> <p>Cheat: <br> <textarea name="text" id="text"></textarea> </p> <p><input type="submit" name="submit" value="Send cheat"></p> <p> </p> <p> </p> </form> connectdb.php <?php $hostname = 'localhost'; $username = '12'; $pass = '12'; $data = 'Cheats'; $db = mysql_connect($hostname, $username, $pass); mysql_select_db($data, $db); ?>
Do you get any errors ? Is any data inserted ? Looks fine from here but if your php config has register_globals off then you'll need to add something like : $title=$_POST['title']; $cons=$_POST['cons']; $text=$_POST['text']; PHP: at the beginning of send.php