There is a bug in the script I have just made but I can't find the problem. I only started learning PHP a little while ago, so treat me like a newbie For some reason my script won't parse, it says that there is an error with line 14 but this is just HTML and there are no errors that I can see. Here is what shows up: Link My script: <?php ////////////////////////////////////////// //// MySQL Database Connection /////////// ////////////////////////////////////////// $host = "localhost"; $user = "theflick_divx"; $db_name= "theflick_divx"; $pass= "password"; $conn = mysql_connect($host, $user, $pass) or die(mysql_error()); mysql_select_db($db_name, $conn) or die(mysql_error()); //DivX Table <table width="482" height="120" border="0" align="center"> <tr> <td width="476" height="21">DivX: </td> </tr> <tr> <td><form id="form1" name="form1" method="post" action=""> <label> Movie Name: <input name="$moviename" type="text" size="31" maxlength="30" /> </label> <br /> <label> Divx Link : <input name="$divxlink" type="text" size="34" maxlength="1000" /> </label> <br /> <label> IMDB Link: <input name="$imdblink" type="text" size="33" maxlength="50" /> </label> <br /> <label> Image URL: <input name="$imageurl" type="text" id="$imageurl" size="33" maxlength="100" /> </label> <br /> <label> Optional Backlink: <input name="$backlink" type="text" size="27" maxlength="100" /> </label> </form> </td> </tr> </table> INSERT INTO links (moviename, divxurl, imdb, imageurl, backlink) VALUES ('$moviename', '$divxlink', '$imdblink', '$imageurl', '$backlink'); ?> PHP: Please help me
you have not echoed your variables in your html u have <input name="$imageurl" type="text" id="$imageurl" size="33" maxlength="100" /> Code (markup): this should be echo "<input name=\"".$imageurl."\" type=\"text\" id=\"".$imageurl."\" size=\"33\" maxlength=\"100\" />"; PHP: you need to do this or sum thing Sim to your html code
Yay! That error is fixed now. But now we have another one... I think this code is in the wrong place INSERT INTO links (moviename, divxurl, imdb, imageurl, backlink) VALUES ('$moviename', '$divxlink', '$imdblink', '$imageurl', '$backlink'); PHP: Where should it go?