semi-colom

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 ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-02-2004
Debracom IT
 
Posts: n/a
Default semi-colom

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


Reply With Quote
  #2 (permalink)  
Old 03-02-2004
Ken Briscoe
 
Posts: n/a
Default Re: semi-colom

>
> 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


Reply With Quote
  #3 (permalink)  
Old 03-02-2004
Tom Thackrey
 
Posts: n/a
Default Re: semi-colom


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)
Reply With Quote
  #4 (permalink)  
Old 03-02-2004
Debracom IT
 
Posts: n/a
Default Re: semi-colom


"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!


Reply With Quote
  #5 (permalink)  
Old 03-02-2004
Erik Johnson
 
Posts: n/a
Default Re: semi-colom

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
>
>



Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:45 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0