denoteone Posted January 26, 2008 Share Posted January 26, 2008 I am getting an error regarding my second "else' statement. I am trying to do this myself but my brain is hurting from looking at the screen all day pulling my hair outt! ??? what am I missing. <? echo " <html> <head> "; if(isset($_POST["submit"])) { include "connect.php"; $name = $_POST['name']; $path = $_POST['path']; $description = $_POST['description']; $date = getdate(); if(strlen($name)<1 || strlen($path)<1 || strlen($description)<1) { print "<table>"; print "<tr><td><center>Trying to add file.</center></td></tr>"; print "<tr><td><center>"; print "One of the required fields was not filled in, please go back and try again"; print "</td></tr></table>"; } else { $posting="INSERT INTO strata_links (name, path, description,date) values ('$name', '$path', '$description', '$date')"; mysql_query($posting) or die("could not post"); } else { ?> </head> <body bgcolor="white"> <table align="center" border="1" bordercolor="gray" width="400px"> <tr> <td><form action="<?=$PHP_SELF?>" method="post"> <font style="font-family:Verdana, Arial, Helvetica, sans-serif; color:#FF0000;">name of file</font><input type="text" name="name" value="name of file" /><br/><br/> <font style="font-family:Verdana, Arial, Helvetica, sans-serif; color:#FF0000;">Complete Path of File:</font><input type="text" name="path" value="Complete Path here"/><br/><br/> <font style="font-family:Verdana, Arial, Helvetica, sans-serif; color:#FF0000;">Description of file:</font><textarea id='7' rows='6' name="description" cols='45'></textarea> <input type="submit" name="submit" value="submit" /></form> </td> </tr> </table> </body> </html> <? } ?> Quote Link to comment https://forums.phpfreaks.com/topic/87858-solved-error-message-with-my-else-statement/ Share on other sites More sharing options...
hitman6003 Posted January 26, 2008 Share Posted January 26, 2008 what's the error? Quote Link to comment https://forums.phpfreaks.com/topic/87858-solved-error-message-with-my-else-statement/#findComment-449440 Share on other sites More sharing options...
denoteone Posted January 26, 2008 Author Share Posted January 26, 2008 Parse error: parse error, unexpected T_ELSE in /home/content/t/w/e/twenty20media/html/fourm_board/imageDB.php on line 32 Quote Link to comment https://forums.phpfreaks.com/topic/87858-solved-error-message-with-my-else-statement/#findComment-449441 Share on other sites More sharing options...
marcus Posted January 26, 2008 Share Posted January 26, 2008 <?php echo " <html> <head> "; if (isset($_POST["submit"])) { include "connect.php"; $name = $_POST['name']; $path = $_POST['path']; $description = $_POST['description']; $date = getdate(); if (strlen($name) < 1 || strlen($path) < 1 || strlen($description) < 1) { print "<table>"; print "<tr><td><center>Trying to add file.</center></td></tr>"; print "<tr><td><center>"; print "One of the required fields was not filled in, please go back and try again"; print "</td></tr></table>"; } else { $posting = "INSERT INTO strata_links (name, path, description,date) values ('$name', '$path', '$description', '$date')"; mysql_query($posting) or die("could not post"); } } else { ?> </head> <body bgcolor="white"> <table align="center" border="1" bordercolor="gray" width="400px"> <tr> <td><form action="<?= $PHP_SELF ?>" method="post"> <font style="font-family:Verdana, Arial, Helvetica, sans-serif; color:#FF0000;">name of file</font><input type="text" name="name" value="name of file" /><br/><br/> <font style="font-family:Verdana, Arial, Helvetica, sans-serif; color:#FF0000;">Complete Path of File:</font><input type="text" name="path" value="Complete Path here"/><br/><br/> <font style="font-family:Verdana, Arial, Helvetica, sans-serif; color:#FF0000;">Description of file:</font><textarea id='7' rows='6' name="description" cols='45'></textarea> <input type="submit" name="submit" value="submit" /></form> </td> </tr> </table> </body> </html> <? } ?> Quote Link to comment https://forums.phpfreaks.com/topic/87858-solved-error-message-with-my-else-statement/#findComment-449447 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.