Hej udviklere, har støt på et udsædvanligt problem..
Kan ikke få dataen smidt ind i min mysql database, og kan ikke lige finde fejlen, gider i ikke lige kigge på det :-)
- <?php
- include('connect.php');
-
- $form = "
- <form action='index.php' method='post'>
- <div class='textboxleft'>Url to lock</div><input class='textbox' type='text' name='url' value='url' />
- <div class='clear'></div>
- <div class='textboxleft'>Facebook url</div><input class='textbox' type='text' name='faceurl' value='facebookurl' />
- <div class='clear'></div>
- <div class='textboxleft'>Lock title</div><input class='textbox' type='text' name='locktitle' value='locktitle!' />
- <div class='clear'></div>
- <input class='btn' type='submit' name='submit' value='' />
- <input type='hidden' value='check' name='check' />
- </form>";
- if($_POST['check']) {
- if ($_POST['url'] == "") {
- $error = (print "<div id='error'><img width='20' style='vertical-align:text-bottom;' src='images/warning.png' /> Please enter a valid lock url</div>");
- echo $form;
- }else{
- if ($_POST['faceurl'] == "") {
- $error = (print "<div id='error'><img width='20' style='vertical-align:text-bottom;' src='images/warning.png' /> Please enter a valid facebook url</div>");
- echo $form;
- }else{
- if ($_POST['locktitle']) {
- $url = $_POST['url'];
- $faceurl = $_POST['faceurl'];
- $locktitle = $_POST['locktitle'];
- $date = date("F d, Y");
- mysql_query("INSERT INTO lock VALUES('','$url','$faceurl','$locktitle','$date')");
- echo "<div id='complete'><img width='20' style='vertical-align:text-bottom;' src='images/succes.png' /> Your link has been generated!</div>";
-
- }else{
- $error = (print "<div id='error'><img width='20' style='vertical-align:text-bottom;' src='images/warning.png' /> Please enter a valid Lock title</div>");
- echo $form;
- }
- }
- }
- }else{
- echo $form;
- }
- ?>