This is a discussion on semi-colom within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Parse error: parse error, unexpected T_IF in c:\inetpub\wwwroot\form_post.php on line 3 This is the error which ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Parse error: parse error, unexpected T_IF in
c:\inetpub\wwwroot\form_post.php on line 3 This is the error which I get with my code, I've searched the internet and the solution should be adding a "semi column". My native language though isn't English and I have no idea which they mean by this, probable a term used by php programmers. The code : <? php if(!empty($_POST)){ echo ("<h2> Bent u zeker dat de volgende informatie correct is:</h2>"); reset($_POST); while (list($element, $waarde) = each($_POST)) { if($element != "submit"){ echo("Veld: <b>$element</b>, ingevulde waarde: <b>$waarde</b> <br>\n"); } } } ?> any help would greatly be appreciated Friendly regards |
|
|||
|
>
> This is the error which I get with my code, I've searched the internet and > the solution should be adding a "semi column". My native language though > isn't English and I have no idea which they mean by this, probable a term > used by php programmers. I believe you mean "semicolon", not "semi column". "Semi column" isn't generally a used term in English, although I'm sure there are some specific uses for this term. PHP, to my knowledge isn't one of them. A semicolon is a character represented by this: ";", but without the quotes. That's a lot of symbols, so here's the semicolon by itself. ; That's a semicolon. You'll want to put that at the end of a line in PHP code, which I see you've already done in most cases. -- KB |
|
|||
|
On 2-Mar-2004, "Debracom IT" <debracomPUNTit@pandora.be> wrote: > Parse error: parse error, unexpected T_IF in > c:\inetpub\wwwroot\form_post.php on line 3 > > This is the error which I get with my code, I've searched the internet and > the solution should be adding a "semi column". My native language though > isn't English and I have no idea which they mean by this, probable a term > used by php programmers. > The code : > > <? php > > if(!empty($_POST)){ > > echo ("<h2> Bent u zeker dat de volgende informatie correct is:</h2>"); > > reset($_POST); > > while (list($element, $waarde) = each($_POST)) > { > if($element != "submit"){ > > echo("Veld: <b>$element</b>, ingevulde waarde: <b>$waarde</b> > <br>\n"); > } > } > } > ?> semi-column is probably semi-colon which is the ; symbol Your problem, however, is the space between <? and php in the first line. It should be <?php without spaces. Because the space is there PHP is confused and thinks you have a statement before the if in line 3 which is not terminated with a semi-colon (;). Remove the space in line 1 and your error should go away. -- Tom Thackrey www.creative-light.com tom (at) creative (dash) light (dot) com do NOT send email to jamesbutler@willglen.net (it's reserved for spammers) |
|
|||
|
"Tom Thackrey" <use.signature@nospam.com> schreef in bericht news:OR41c.5155$Zj5.1192@newssvr27.news.prodigy.co m... > > On 2-Mar-2004, "Debracom IT" <debracomPUNTit@pandora.be> wrote: > > > Parse error: parse error, unexpected T_IF in > > c:\inetpub\wwwroot\form_post.php on line 3 > > > > This is the error which I get with my code, I've searched the internet and > > the solution should be adding a "semi column". My native language though > > isn't English and I have no idea which they mean by this, probable a term > > used by php programmers. > > The code : > > > > <? php > > > > if(!empty($_POST)){ > > > > echo ("<h2> Bent u zeker dat de volgende informatie correct is:</h2>"); > > > > reset($_POST); > > > > while (list($element, $waarde) = each($_POST)) > > { > > if($element != "submit"){ > > > > echo("Veld: <b>$element</b>, ingevulde waarde: <b>$waarde</b> > > <br>\n"); > > } > > } > > } > > ?> > > semi-column is probably semi-colon which is the ; symbol > > Your problem, however, is the space between <? and php in the first line. It > should be <?php without spaces. Because the space is there PHP is confused > and thinks you have a statement before the if in line 3 which is not > terminated with a semi-colon (;). Remove the space in line 1 and your error > should go away. > > > > -- > Tom Thackrey > www.creative-light.com > tom (at) creative (dash) light (dot) com > do NOT send email to jamesbutler@willglen.net (it's reserved for spammers) Works completely like it should now :-) thx! Indeed a very stupid mistake which I won't make twice. Thank you! |
|
|||
|
What Ken said is correct, but is missing the real problem. "Parse
error" implies basic syntactic malformedness - a fancy way of saying the interpreter can't understand what the heck you are trying to say. "Unexpected T_IF" implies to me it was not expecting an IF-statement where it found one (on line 3). There isn't much before that - just the malformed opening tag that should be "<?php" instead of "<? php". -ej "Debracom IT" <debracomPUNTit@pandora.be> wrote in message news:6741c.20059$DC1.972921@phobos.telenet-ops.be... > Parse error: parse error, unexpected T_IF in > c:\inetpub\wwwroot\form_post.php on line 3 > > This is the error which I get with my code, I've searched the internet and > the solution should be adding a "semi column". My native language though > isn't English and I have no idea which they mean by this, probable a term > used by php programmers. > The code : > > <? php > > if(!empty($_POST)){ > > echo ("<h2> Bent u zeker dat de volgende informatie correct is:</h2>"); > > reset($_POST); > > while (list($element, $waarde) = each($_POST)) > { > if($element != "submit"){ > > echo("Veld: <b>$element</b>, ingevulde waarde: <b>$waarde</b> > <br>\n"); > } > } > } > ?> > > any help would greatly be appreciated > Friendly regards > > |
![]() |
| Thread Tools | |
| Display Modes | |
|
|