Thursday 15 March 2012

php - I have this error: Parse error: syntax error, unexpected 'if' (T_IF) -



php - I have this error: Parse error: syntax error, unexpected 'if' (T_IF) -

i have problem, not understand why error, i'm riding page on local server, when seek access file error, if run me snippet shows how on page.

class="lang-html prettyprint-override"><html> <head> <title>ingresa united nations nuevo articulo</title> </head> <body> <form method="post" action="insert_post.php" enctype="multipart/form-data"> <table width="600" align="center" border="10"> <tr> <td align="center" bgcolor="yellow" colspan="6"><h1>ingresa united nations nuevo articulo aqui</h1></td> </tr> <tr> <td align="right">titulo del articulo</td> <td><input type="text" name="title" size="30"></td> </tr> <tr> <td align="right">autor del articulo</td> <td><input type="text" name="author" size="30"></td> </tr> <tr> <td align="right">keywords del articulo</td> <td><input type="text" name="keywords" size="30"></td> </tr> <tr> <td align="right">imagen del articulo</td> <td><input type="file" name="image"></td> </tr> <tr> <td align="right">contenido del articulo</td> <td><textarea name="content" cols="30" rows="15"></textarea></td> </tr> <tr> <td align="center" colspan="6"><input type="submit" name="submit" value="enviar noticia"></td> </tr> </table> </form> </body> </html> <?php include("includes/connect.php") if(isset($_post['submit'])){ echo $_post_title = $_post['title']; echo $_post_date = date('d-m-y'); echo $_post_author = $_post['author']; echo $_post_keywords = $_post['keywords']; echo $_post_content = $_post['content']; echo $_post_image = $_post['image']['name']; }

seems forgot ;

<?php include("includes/connect.php"); if(isset($_post['submit'])){ echo $_post_title = $_post['title']; echo $_post_date = date('d-m-y'); echo $_post_author = $_post['author']; echo $_post_keywords = $_post['keywords']; echo $_post_content = $_post['content']; echo $_post_image = $_post['image']['name']; } ?>

that should trick

php if-statement syntax

No comments:

Post a Comment