FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Whats the problem with this code

 


imagefree
Code:
<?php
//original page code.
$form_type=$_POST['form_type'];

if($form_type=='tellafriend')
include('tellafriend.php');

else if($form_type=='contactus')
include('include_contact.php');

else if(!isset($_POST['form_type'])
{
require('include_originalpage.php');
}
?>

its really hard to program in php
at the moment the error is

Quote:
Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\site\project\form_maker.php on line 12

There is nothing on the line 12 above.

and if a change the code a little bit to
Code:
<?php
//original page code.
$form_type=$_POST['form_type'];

if($form_type=='tellafriend')
include('tellafriend.php');

else if($form_type=='contactus')
include('include_contact.php');

else if(!isset($_POST['form_type'])
require('include_originalpage.php');
?>

the error occurs

Quote:
Parse error: syntax error, unexpected T_REQUIRE in C:\xampp\htdocs\site\project\form_maker.php on line 12

what the problem is?


Last edited by imagefree on Sat Oct 27, 2007 7:06 am; edited 1 time in total
MrBlueSky
You are missing a closing parenthise here:

Quote:

else if(!isset($_POST['form_type'])) // <--
require('include_originalpage.php');
imagefree
thanks Very Happy

please visit this also


http://www.frihost.com/forums/vt-82958.html#694115
mathiaus
Nearly all 'Unexpected' errors are caused by a missing ) or ; from the line above. Remember this and 90% of your problems can be easily solved Smile
flatliner
Quote:
Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\site\project\form_maker.php on line 12
There is nothing on the line 12 above.


Sometimes its not always that line thats making the erorr, it can be the line above it , were you havent close a function with ; or an open quotation mark.
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.