Re: [PHP] Parse error: syntax error, unexpected '>'

2009-09-23 Thread Fernando Castillo Aparicio
Reading again, it's not just one miss. You have to close some strings, escape 
some quotes, etc

I think this can be right:

$sql = "SELECT * FROM melstatus WHERE custID=$custID ORDER BY
aircraftRegistration";

$q = mysql_query($q)
or die ("could not execute query.");

echo " 
\n";

while($row = mysql_fetch_array($q))
{
echo " ".$row['melID']." ";

echo "\n";
}
echo "";


I'd recomend you to get a good text editor with sintax highlighting if you 
haven't one. It would warn you from most of these mistakes.

And an xhtml issue: to use an empty tag, you use  and not 






De: Fernando Castillo Aparicio 
Para: Haig Davis ; php-general@lists.php.net
Enviado: miércoles, 23 de septiembre, 2009 16:23:07
Asunto: Re: [PHP] Parse error: syntax error, unexpected '>'

You missed a double quote here:

echo " 
\n";




________
De: Haig Davis 
Para: php-general@lists.php.net
Enviado: miércoles, 23 de septiembre, 2009 16:18:17
Asunto: [PHP] Parse error: syntax error, unexpected '>'

Good morning Everyone,

I'm have trouble with a simple HTML Checkbox list. I keep getting *Parse
error*: syntax error, unexpected '>'. I'm sure I'm doing something really
simple and basic wrong I just cannot seem to see what it is, any assistance
is appreciated.

Script:

http://bw.org/misc/cgi-test/test.cgi";>


\n;

while($row = mysql_fetch_array($q))
{
echo " ".$row['melID']." ";

\n";
}
echo "

?>


Many Thanks

Haig


  

Re: [PHP] Parse error: syntax error, unexpected '>'

2009-09-23 Thread Ashley Sheridan
On Wed, 2009-09-23 at 07:18 -0700, Haig Davis wrote:
> echo " ".$row['melID']." name="\".$row['melID].\""/input> ";

You're escaping in the wrong places. The \ escapes the character
following it, so what you are doing here, in line 2, is breaking out of
the string with a regular " and then printing a " (escaped \") Also, I
think you need to brush up on your HTML a bit, as 



is not valid HTML.


Thanks,
Ash
http://www.ashleysheridan.co.uk




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse error: syntax error, unexpected '>'

2009-09-23 Thread Fernando Castillo Aparicio
You missed a double quote here:

echo " 
\n";





De: Haig Davis 
Para: php-general@lists.php.net
Enviado: miércoles, 23 de septiembre, 2009 16:18:17
Asunto: [PHP] Parse error: syntax error, unexpected '>'

Good morning Everyone,

I'm have trouble with a simple HTML Checkbox list. I keep getting *Parse
error*: syntax error, unexpected '>'. I'm sure I'm doing something really
simple and basic wrong I just cannot seem to see what it is, any assistance
is appreciated.

Script:

http://bw.org/misc/cgi-test/test.cgi";>


\n;

while($row = mysql_fetch_array($q))
{
echo " ".$row['melID']." ";

\n";
}
echo "

?>


Many Thanks

Haig



  

[PHP] Parse error: syntax error, unexpected '>'

2009-09-23 Thread Haig Davis
Good morning Everyone,

I'm have trouble with a simple HTML Checkbox list. I keep getting *Parse
error*: syntax error, unexpected '>'. I'm sure I'm doing something really
simple and basic wrong I just cannot seem to see what it is, any assistance
is appreciated.

Script:

http://bw.org/misc/cgi-test/test.cgi";>


\n;

while($row = mysql_fetch_array($q))
{
echo " ".$row['melID']." ";

\n";
}
echo "

?>


Many Thanks

Haig


RE: [PHP] parse error

2007-05-04 Thread Brad Sumrall
Maybe not
The following passes me on without error, but does not actually log me on?
Put in a fake name, and it still passes me on to the index page.
I took this straight off the phpbb help files?

Brad












-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] parse error

2007-05-04 Thread Brad Sumrall
I dug deeper and realized I needed to open it correctly.

You were right!

Thank you!

Here is the correct code that works like a charm!

Brad










Username:





Password




:


Log me on
automatically: 






I forgot my
password







  



Log out











Welcome : 




 
Manage Account


Manage Profile






   


  

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 04, 2007 9:43 PM
To: Brad Sumrall
Subject: Re: [PHP] parse error

}else{
Brad Sumrall wrote:
> Hi folk, I am writing a login in script and get the following:
>
> Parse error: parse error, unexpected T_ELSE in
> /home/content/c/u/t/cuteirka/html/commonlogin_new.php on line 37
>
> I am basically pulling this straight out the php for dummies manual.
>
>  
>
> Can someone kindly point me in the right direction on this one!
>
>  
>
> Brad
>
>  
>
>  
>
> 1  
>
> 2   class="forumline" align="center">
>
> 3  
>
> 4   height="30" class="thHead" nowrap="nowrap">
>
> 5  
>
> 6  
>
> 7   cellpadding="3" cellspacing="1" width="100%">
>
> 8  
>
> 9   align="left">Username:
>
> 10 
>
> 11 
>
> 12  class="post" name="username" size="25" maxlength="40" value="" />
>
> 13 
>
> 14 
>
> 15  class="gen">Password
>
> 16 
>
> 17 
>
> 18 
>
> 19  maxlength="32" />
>
> 20 :
>
> 21 
>
> 22 
>
> 23 Log
me
> on automatically: 
>
> 24 
>
> 25 
>
> 26 
>
> 27  name="redirect" value="" /> class="mainoption value="Log in" />
>
> 28 
>
> 29 
>
> 30  href="forgot_password.php" class="gensmall">I forgot my
> password
>
> 31 
>
> 32 
>
> 33 
>
> 34
>
> 25   
>
> 36 
> 37 {else}
>
> 38 ?>
>
> 
>
>class="headerlogout" align="center">
>
> 
>
> 
>
> 
>
>  href="javascript:logout()" class="link1">Log out
>
> 
>
> 
>
> 
>
> 
>
>   
>
>  class="logincenterbg">
>
> 
>
> 
>
>  class="bluetext">
>
> 
>
> 
>
> Welcome
:
> 
>
> 
>
> 
>
>  class="bluetext">
>
> 
>
>  
>
>  class="link1" href="editaccount.php">Manage Account
>
> 
>
> 
>
>  class="link1" href="editprofile.php">Manage Profile
>
> 
>
> 
>
> 
>
> 
>
> 
>
>  src="images/login_bottom.jpg" width="200" height="8" alt="" />
>
>  
>
> 
>
> 
>
>
>   

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] parse error

2007-05-04 Thread Brad Sumrall
Parse error: parse error, unexpected '}' in
/home/content/c/u/t/cuteirka/html/commonlogin_new.php on line 37

Because I am not starting the brackets anywhere else.
My only php function is between line 37 and 39





-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 04, 2007 9:43 PM
To: Brad Sumrall
Subject: Re: [PHP] parse error

}else{
Brad Sumrall wrote:
> Hi folk, I am writing a login in script and get the following:
>
> Parse error: parse error, unexpected T_ELSE in
> /home/content/c/u/t/cuteirka/html/commonlogin_new.php on line 37
>
> I am basically pulling this straight out the php for dummies manual.
>
>  
>
> Can someone kindly point me in the right direction on this one!
>
>  
>
> Brad
>
>  
>
>  
>
> 1  
>
> 2   class="forumline" align="center">
>
> 3  
>
> 4   height="30" class="thHead" nowrap="nowrap">
>
> 5  
>
> 6  
>
> 7   cellpadding="3" cellspacing="1" width="100%">
>
> 8  
>
> 9   align="left">Username:
>
> 10 
>
> 11 
>
> 12  class="post" name="username" size="25" maxlength="40" value="" />
>
> 13 
>
> 14 
>
> 15  class="gen">Password
>
> 16 
>
> 17 
>
> 18 
>
> 19  maxlength="32" />
>
> 20 :
>
> 21 
>
> 22 
>
> 23 Log
me
> on automatically: 
>
> 24 
>
> 25 
>
> 26 
>
> 27  name="redirect" value="" /> class="mainoption value="Log in" />
>
> 28 
>
> 29 
>
> 30  href="forgot_password.php" class="gensmall">I forgot my
> password
>
> 31 
>
> 32 
>
> 33 
>
> 34
>
> 25   
>
> 36 
> 37 {else}
>
> 38 ?>
>
> 
>
>class="headerlogout" align="center">
>
> 
>
> 
>
> 
>
>  href="javascript:logout()" class="link1">Log out
>
> 
>
> 
>
> 
>
> 
>
>   
>
>  class="logincenterbg">
>
> 
>
> 
>
>  class="bluetext">
>
> 
>
> 
>
> Welcome
:
> 
>
> 
>
> 
>
>  class="bluetext">
>
> 
>
>  
>
>  class="link1" href="editaccount.php">Manage Account
>
> 
>
> 
>
>  class="link1" href="editprofile.php">Manage Profile
>
> 
>
> 
>
> 
>
> 
>
> 
>
>  src="images/login_bottom.jpg" width="200" height="8" alt="" />
>
>  
>
> 
>
> 
>
>
>   

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse error on a basic call?

2007-04-28 Thread Edward Vermillion


On Apr 28, 2007, at 9:08 PM, Brad Sumrall wrote:


$SESSION = get_include_contents'/phpbb/login.php';



I pulled this tright out of the text book.



I am trying to pull a phpbb session on an outside page.



Any suggestions?



Here is the error!

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in
/home/content/c/u/t/cuteirka/html/contest_stories.php on line 2



You've got an unexpected string on line 2 of contest_stories.php.

I'm going to assume that get_include_contents is a function? It  
should probably be:


get_include_contents('/phpbb/login.php');

Notice the parens...

There is a *real* good reference to the language here:

http://www.php.net/manual/en/

The parser tokens are listed at:

http://www.php.net/manual/en/tokens.php

You can also usually google for T_CONSTANT_ENCAPSED_STRING and php  
(or whatever the error is) and probably get some good info too.


Ed

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Parse error on a basic call?

2007-04-28 Thread Brad Sumrall
$SESSION = get_include_contents'/phpbb/login.php';

 

I pulled this tright out of the text book.

 

I am trying to pull a phpbb session on an outside page.

 

Any suggestions?

 

Here is the error!

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in
/home/content/c/u/t/cuteirka/html/contest_stories.php on line 2

 

Brad



Re: [PHP] Parse error help.., thanks..

2007-03-30 Thread Ian
Thanks very much for the help, Davi,, no more such errors.. :)

Ian
"Davi" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
Em Sexta 30 Março 2007 18:55, Ian escreveu:
> Parse error: syntax error, unexpected ';' in
> /hxxx/x/domains/x.com/public_html/blog/labels.php on line 15
>
> 
 http://.x.com/labels');
2
define('SEARCH_DIR','//x/domains/x.com/public_html/blog/labels');
3 define('THIS_FILE', 'cloud.php');
4 if(file_exists(SEARCH_DIR.'_cloud_include_cache.html') &&
5 filemtime(SEARCH_DIR.'_cloud_include_cache.html')>(time()-(60*60)))
6 echo file_get_contents(SEARCH_DIR.'_cloud_include_cache.html');
7 else
8 {
9 $output = '';
10 $files = array();
11 $dir = opendir(SEARCH_DIR);
12 while($file = readdir($dir))
13 if($file != '.' && $file != '..' && $file != THIS_FILE
14 
&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;am
15 p;amp;amp;& $file != CACHE_FILE)
16 {
17 $files[] = $file;
18 }

Try remove the "&"s...

[]s


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
"Toothpaste never hurts the taste of good scotch." 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse error help.., thanks..

2007-03-30 Thread Ian
Hehe.., didn't i told i am poor in this, actually, never learn PHP before.. 
:)

No more such errors anymore thank you Tijnema! =)

Ian
""Tijnema !"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> On 3/30/07, Ian <[EMAIL PROTECTED]> wrote:
>> Hi everyone, i am new to PHP, but not a programmer..,
>> i got this php code to workout on something on my blog, but it seems that 
>> it
>> gives me the following error:
>>
>> Parse error: syntax error, unexpected ';' in
>> /hxxx/x/domains/x.com/public_html/blog/labels.php on line 15
>>
>> 
>> > define('PREFIX', 'http://.x.com/labels');
>> define('SEARCH_DIR','//x/domains/x.com/public_html/blog/labels');
>> define('THIS_FILE', 'cloud.php');
>> if(file_exists(SEARCH_DIR.'_cloud_include_cache.html') &&
>> filemtime(SEARCH_DIR.'_cloud_include_cache.html')>(time()-(60*60)))
>> echo file_get_contents(SEARCH_DIR.'_cloud_include_cache.html');
>> else
>> {
>> $output = '';
>> $files = array();
>> $dir = opendir(SEARCH_DIR);
>> while($file = readdir($dir))
>> if($file != '.' && $file != '..' && $file != THIS_FILE
>> &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;&
>
> How can above string be ever correct
>> $file != CACHE_FILE)
>> {
>> $files[] = $file;
>> }
>>
>> 
>> Anyhelp on this will ve be very much appreciated, thanks..
>>
>> Ian
> Try this code:
> 
>  define('PREFIX', 'http://.x.com/labels');
> define('SEARCH_DIR','//x/domains/x.com/public_html/blog/labels');
> define('THIS_FILE', 'cloud.php');
> if(file_exists(SEARCH_DIR.'_cloud_include_cache.html') &&
> filemtime(SEARCH_DIR.'_cloud_include_cache.html')>(time()-(60*60)))
> echo file_get_contents(SEARCH_DIR.'_cloud_include_cache.html');
> else
> {
> $output = '';
> $files = array();
> $dir = opendir(SEARCH_DIR);
> while($file = readdir($dir))
> if($file != '.' && $file != '..' && $file != THIS_FILE && $file != 
> CACHE_FILE)
> {
> $files[] = $file;
> }
>
> It should work, if not, come back here :)
>
> Tijnema
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse error help.., thanks..

2007-03-30 Thread Tijnema !

On 3/30/07, Ian <[EMAIL PROTECTED]> wrote:

Hi everyone, i am new to PHP, but not a programmer..,
i got this php code to workout on something on my blog, but it seems that it
gives me the following error:

Parse error: syntax error, unexpected ';' in
/hxxx/x/domains/x.com/public_html/blog/labels.php on line 15


http://.x.com/labels');
define('SEARCH_DIR','//x/domains/x.com/public_html/blog/labels');
define('THIS_FILE', 'cloud.php');
if(file_exists(SEARCH_DIR.'_cloud_include_cache.html') &&
filemtime(SEARCH_DIR.'_cloud_include_cache.html')>(time()-(60*60)))
echo file_get_contents(SEARCH_DIR.'_cloud_include_cache.html');
else
{
$output = '';
$files = array();
$dir = opendir(SEARCH_DIR);
while($file = readdir($dir))
if($file != '.' && $file != '..' && $file != THIS_FILE
&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;&


How can above string be ever correct

$file != CACHE_FILE)
{
$files[] = $file;
}


Anyhelp on this will ve be very much appreciated, thanks..

Ian

Try this code:

http://.x.com/labels');
define('SEARCH_DIR','//x/domains/x.com/public_html/blog/labels');
define('THIS_FILE', 'cloud.php');
if(file_exists(SEARCH_DIR.'_cloud_include_cache.html') &&
filemtime(SEARCH_DIR.'_cloud_include_cache.html')>(time()-(60*60)))
echo file_get_contents(SEARCH_DIR.'_cloud_include_cache.html');
else
{
$output = '';
$files = array();
$dir = opendir(SEARCH_DIR);
while($file = readdir($dir))
if($file != '.' && $file != '..' && $file != THIS_FILE && $file != CACHE_FILE)
{
$files[] = $file;
}

It should work, if not, come back here :)

Tijnema


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse error help.., thanks..

2007-03-30 Thread Davi
Em Sexta 30 Março 2007 18:55, Ian escreveu:
> Parse error: syntax error, unexpected ';' in
> /hxxx/x/domains/x.com/public_html/blog/labels.php on line 15
>
> 
 http://.x.com/labels');
2 
define('SEARCH_DIR','//x/domains/x.com/public_html/blog/labels');
3 define('THIS_FILE', 'cloud.php');
4 if(file_exists(SEARCH_DIR.'_cloud_include_cache.html') &&
5 filemtime(SEARCH_DIR.'_cloud_include_cache.html')>(time()-(60*60)))
6 echo file_get_contents(SEARCH_DIR.'_cloud_include_cache.html');
7 else
8 {
9 $output = '';
10 $files = array();
11 $dir = opendir(SEARCH_DIR);
12 while($file = readdir($dir))
13 if($file != '.' && $file != '..' && $file != THIS_FILE
14 &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;am
15 p;amp;amp;& $file != CACHE_FILE)
16 {
17 $files[] = $file;
18 }

Try remove the "&"s...

[]s


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
"Toothpaste never hurts the taste of good scotch."

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Parse error help.., thanks..

2007-03-30 Thread Ian
Hi everyone, i am new to PHP, but not a programmer..,
i got this php code to workout on something on my blog, but it seems that it 
gives me the following error:

Parse error: syntax error, unexpected ';' in 
/hxxx/x/domains/x.com/public_html/blog/labels.php on line 15


http://.x.com/labels');
define('SEARCH_DIR','//x/domains/x.com/public_html/blog/labels');
define('THIS_FILE', 'cloud.php');
if(file_exists(SEARCH_DIR.'_cloud_include_cache.html') &&
filemtime(SEARCH_DIR.'_cloud_include_cache.html')>(time()-(60*60)))
echo file_get_contents(SEARCH_DIR.'_cloud_include_cache.html');
else
{
$output = '';
$files = array();
$dir = opendir(SEARCH_DIR);
while($file = readdir($dir))
if($file != '.' && $file != '..' && $file != THIS_FILE 
&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;&
 
$file != CACHE_FILE)
{
$files[] = $file;
}


Anyhelp on this will ve be very much appreciated, thanks..

Ian 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] parse error

2006-07-10 Thread Paul Novitski

At 08:11 AM 7/10/2006, Schalk wrote:
I am getting the following error:* Parse error*: parse error, 
unexpected $ in 
*/home/httpd/vhosts/demo.bdiverse.com/httpdocs/accessible/processlogin.php* 
on line *69


In my code the last line i.e. ?> is marked as line 69



I don't see anything wrong with the code you posted, so I'd look 
earlier in your script or in your included scripts.  Generally 
speaking when the parser complains at the final ?> tag it means a 
missing close-bracket } at the end of a code block or a heredoc 
expression that isn't closed properly.  If you're using heredocs, 
remember that the closing expression must end in a semicolon and 
neither the the opening expression nor the closing may have trailing 
spaces or tabs.


Good luck,
Paul 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] parse error

2006-07-10 Thread Schalk

Thanks everyone.

Jochem Maas wrote:

Schalk wrote:
  

Greetings All,

Please have a look at the following code:




your missing a closing brace some where - by the looks of things
not in the code you sent.

  

if ($numrows < 1)
// the member does not exist
{
   include ($adminfolderpath."/include/headeradmin.php");
   echo "That email does not exist in the members list.";
   echo "Please login.";
   include ($adminfolderpath."/include/footeradmin.php");
   exit;
}

if (md5($memberpassword) !=$dbmemberpassword)
// the password does not match the one in the database
{
   include ($adminfolderpath."/include/headeradmin.php");
   echo "Incorrect password, please try again.";
   login();
   include ($adminfolderpath."/include/footeradmin.php");
   exit;
} else {
   header("Location:
http://demo.bdiverse.com/accessible/admin/listmypages.php";);
   exit;   }
?>

I am getting the following error:* Parse error*: parse error, unexpected
$ in
*/home/httpd/vhosts/demo.bdiverse.com/httpdocs/accessible/processlogin.php*
on line *69

In my code the last line i.e. ?> is marked as line 69

Can someone please let me know what is causing this error? Thanks!
*




  


--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] parse error

2006-07-10 Thread Jochem Maas
Schalk wrote:
> Greetings All,
> 
> Please have a look at the following code:
> 

your missing a closing brace some where - by the looks of things
not in the code you sent.

> if ($numrows < 1)
> // the member does not exist
> {
>include ($adminfolderpath."/include/headeradmin.php");
>echo "That email does not exist in the members list.";
>echo "Please login.";
>include ($adminfolderpath."/include/footeradmin.php");
>exit;
> }
> 
> if (md5($memberpassword) !=$dbmemberpassword)
> // the password does not match the one in the database
> {
>include ($adminfolderpath."/include/headeradmin.php");
>echo "Incorrect password, please try again.";
>login();
>include ($adminfolderpath."/include/footeradmin.php");
>exit;
> } else {
>header("Location:
> http://demo.bdiverse.com/accessible/admin/listmypages.php";);
>exit;   }
> ?>
> 
> I am getting the following error:* Parse error*: parse error, unexpected
> $ in
> */home/httpd/vhosts/demo.bdiverse.com/httpdocs/accessible/processlogin.php*
> on line *69
> 
> In my code the last line i.e. ?> is marked as line 69
> 
> Can someone please let me know what is causing this error? Thanks!
> *
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] parse error

2006-07-10 Thread Schalk

Greetings All,

Please have a look at the following code:

if ($numrows < 1)
// the member does not exist
{
   include ($adminfolderpath."/include/headeradmin.php");
   echo "That email does not exist in the members list.";
   echo "Please login.";
   include ($adminfolderpath."/include/footeradmin.php");
   exit;
}

if (md5($memberpassword) !=$dbmemberpassword)
// the password does not match the one in the database
{
   include ($adminfolderpath."/include/headeradmin.php");
   echo "Incorrect password, please try again.";
   login();
   include ($adminfolderpath."/include/footeradmin.php");
   exit;
} else {
   header("Location: 
http://demo.bdiverse.com/accessible/admin/listmypages.php";);
   exit;   
}

?>

I am getting the following error:* Parse error*: parse error, unexpected 
$ in 
*/home/httpd/vhosts/demo.bdiverse.com/httpdocs/accessible/processlogin.php* 
on line *69


In my code the last line i.e. ?> is marked as line 69

Can someone please let me know what is causing this error? Thanks!
*

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Recall: [PHP] Parse error: syntax error, unexpected '}'

2006-06-02 Thread Bagus Nugroho
Bagus Nugroho would like to recall the message, "[PHP] Parse error: syntax 
error, unexpected '}'".


Re: [PHP] Parse error: syntax error, unexpected '}'

2006-06-02 Thread Mark Sargent

Hi All,

sorry, found it. Forgot the ; after $age++. Cheers.

Mark Sargent.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Parse error: syntax error, unexpected '}'

2006-06-02 Thread Bagus Nugroho
how about like this
---
$insert = "INSERT INTO age (age_label) VALUES ('$age')";
---

 


From: Mark Sargent [mailto:[EMAIL PROTECTED]
Sent: Sat 03-Jun-2006 10:02
To: PHP List
Subject: [PHP] Parse error: syntax error, unexpected '}'



Hi All,

can anone see what's wrong with the below code? I get this error,


*Parse error*: syntax error, unexpected '}' in
*/usr/local/apache2/htdocs/moviedata2.php* on line *18

*
$age=1;
while($age<=100) {
$insert = "INSERT INTO age (age_label) VALUES ($age)";
$results = mysql_query($insert) or die(mysql_error());
$age++
}



Cheers.

Mark Sargent.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






Re: [PHP] Parse error: syntax error, unexpected '}'

2006-06-02 Thread Rick Emery

Quoting Mark Sargent <[EMAIL PROTECTED]>:


Hi All,

can anone see what's wrong with the below code? I get this error,


*Parse error*: syntax error, unexpected '}' in
*/usr/local/apache2/htdocs/moviedata2.php* on line *18

*
$age=1;
while($age<=100) {
$insert = "INSERT INTO age (age_label) VALUES ($age)";
$results = mysql_query($insert) or die(mysql_error());
$age++
}



There's a semi-colon missing at the end of the last line ($age++).

Hope thi shelps,
Rick
--
Rick Emery

"When once you have tasted flight, you will forever walk the Earth
 with your eyes turned skyward, for there you have been, and there
 you will always long to return"
  -- Leonardo Da Vinci

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Parse error: syntax error, unexpected '}'

2006-06-02 Thread Mark Sargent

Hi All,

can anone see what's wrong with the below code? I get this error,


*Parse error*: syntax error, unexpected '}' in 
*/usr/local/apache2/htdocs/moviedata2.php* on line *18


*
$age=1;
while($age<=100) {
$insert = "INSERT INTO age (age_label) VALUES ($age)";
$results = mysql_query($insert) or die(mysql_error());
$age++
}



Cheers.

Mark Sargent.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in

2006-05-25 Thread Mark Sargent

Mark Sargent wrote:

Hi All,

I get the error for line 15 for this code,

";
18 echo "$_SESSION['text']";
19 echo "";
20 ?>

I have put ' ' quotes around the " " quotes for each font attribute so 
that the parser doesn't think the echo is finished too early. Is that 
wrong? I know that this code would get tedious for lots of text and 
CSS would be better, but, it's just a little study project from the 
book I'm following. Cheers.


Mark Sargent.


Hi All,

sorry, I forgot the fundamentals again,

. variableName .

echo "and no " " around the variable in an echo statement when no other text 
in it.


echo $_SESSION['text'];

Cheers.

Mark Sargent.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in

2006-05-25 Thread Ryan Creaser



Mark Sargent wrote:


Hi All,

I get the error for line 15 for this code,

";
18 echo "$_SESSION['text']";
19 echo "";
20 ?>

I have put ' ' quotes around the " " quotes for each font attribute so 
that the parser doesn't think the echo is finished too early. Is that 
wrong? I know that this code would get tedious for lots of text and 
CSS would be better, but, it's just a little study project from the 
book I'm following. Cheers.


Mark Sargent.


any of these will work:
 echo "after the variable.

 echo "http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in

2006-05-25 Thread Mark Sargent

Hi All,

I get the error for line 15 for this code,

";
18 echo "$_SESSION['text']";
19 echo "";
20 ?>

I have put ' ' quotes around the " " quotes for each font attribute so 
that the parser doesn't think the echo is finished too early. Is that 
wrong? I know that this code would get tedious for lots of text and CSS 
would be better, but, it's just a little study project from the book I'm 
following. Cheers.


Mark Sargent.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse error: syntax error, unexpected ',' in

2006-05-23 Thread Mark Sargent

Chris wrote:

Since there aren't actually 18 lines this isn't the real code..

true, as I only posted the php code


The problem is here:

echo $currentValue "\n";

it should be

echo $currentValue . "\n";

or

echo $currentValue , "\n";

thanx to all. The book is Beginning PHP,  Apache, MySQL, Web Development 
and it seems to only be a typo on that page(section) as the next page 
shows similar code using the right syntax. I just didn't notice it till 
after I posted. Cheers.


Mark Sargent

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse error: syntax error, unexpected ',' in

2006-05-23 Thread Chris

Mark Sargent wrote:

Hi All,

this code,

";
echo "My favourite flavours are:";
foreach ($flavour as $currentValue) {
   //these lines will execute as long as there is a value in $flavour
   echo $currentValue "\n";
}
?>


gives this,

*Parse error*: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, 
expecting ',' or ';' in */usr/local/apache2/htdocs/sorting.php* on line *18


*
and adding a , to this line,

  foreach ($flavour, as $currentValue) {

gives this error,

*Parse error*: syntax error, unexpected ',' in 
*/usr/local/apache2/htdocs/sorting.php* on line *16*


Since there aren't actually 18 lines this isn't the real code..

The problem is here:

echo $currentValue "\n";

it should be

echo $currentValue . "\n";

or

echo $currentValue , "\n";

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse error: syntax error, unexpected ',' in

2006-05-23 Thread Robin Vickery

On 24/05/06, Mark Sargent <[EMAIL PROTECTED]> wrote:

Hi All,

this code,

";
echo "My favourite flavours are:";
 foreach ($flavour as $currentValue) {
//these lines will execute as long as there is a value in $flavour
echo $currentValue "\n";
 }
?>


gives this,

*Parse error*: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING,
expecting ',' or ';' in */usr/local/apache2/htdocs/sorting.php* on line *18

*
and adding a , to this line,

   foreach ($flavour, as $currentValue) {


No, you were right the first time. No comma is required there.

Line 18 is the line with the echo statement on it. The items you want
to echo should be separated by commas:

So it should be:

   echo $currentValue, "\n";

-robin

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse error: syntax error, unexpected ',' in

2006-05-23 Thread Stut

Mark Sargent wrote:

Hi All,

this code,

";
echo "My favourite flavours are:";
foreach ($flavour as $currentValue) {
   //these lines will execute as long as there is a value in $flavour
   echo $currentValue "\n";
}
?>


gives this,

*Parse error*: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, 
expecting ',' or ';' in */usr/local/apache2/htdocs/sorting.php* on line *18


The echo in the foreach loop has no concatenation operator.

echo $currentValue "\n";

should be

echo $currentValue."\n";

> and adding a , to this line,
>
>   foreach ($flavour, as $currentValue) {
>
> gives this error,
>
> *Parse error*: syntax error, unexpected ',' in
> */usr/local/apache2/htdocs/sorting.php* on line *16*
>
> The code in the book I'm following has the , in that line. Can anyone
> tell me what I'm doing wrong? Cheers.

If the code in the book you're reading really has a , in the foreach 
line I suggest you throw it away and find another book, because that's 
not valid PHP.


-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Parse error: syntax error, unexpected ',' in

2006-05-23 Thread Mark Sargent

Hi All,

this code,

";
echo "My favourite flavours are:";
foreach ($flavour as $currentValue) {
   //these lines will execute as long as there is a value in $flavour
   echo $currentValue "\n";
}
?>


gives this,

*Parse error*: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, 
expecting ',' or ';' in */usr/local/apache2/htdocs/sorting.php* on line *18


*
and adding a , to this line,

  foreach ($flavour, as $currentValue) {

gives this error,

*Parse error*: syntax error, unexpected ',' in 
*/usr/local/apache2/htdocs/sorting.php* on line *16*


The code in the book I'm following has the , in that line. Can anyone 
tell me what I'm doing wrong? Cheers.


Mark Sargent.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse Error on SQL Insert [Solved]

2006-04-08 Thread Tom Chubb
Sorry guys - knew it would be obvious!
I was using $_FILE['image']['name'][0],  instead of
$_FILES['image']['name'][0]

However, thanks for all your help.
Tom


On 07/04/06, Joe Henry <[EMAIL PROTECTED]> wrote:
>
> On Friday 07 April 2006 1:56 pm, Chrome wrote:
> > Backticks (`) encapsulate table or database names
> >
> > I was thinking maybe if the array references were encapsulated in curly
> > braces {}:
> >
> > $_POST['model'] to {$_POST['model']}
> >
> > Of course if the field in the DB isn't numeric this would be
> > '{$_POST['model']}'
> >
> > Dan
> >
> > ---
> > http://chrome.me.uk
> >
> >
> > -Original Message-
> > From: Joe Henry [mailto:[EMAIL PROTECTED]
> > Sent: 07 April 2006 20:53
> > To: php-general@lists.php.net; [EMAIL PROTECTED]
> > Subject: Re: [PHP] Parse Error on SQL Insert
> >
> > On Friday 07 April 2006 1:37 pm, Tom Chubb wrote:
> > > $insertSQL = "INSERT INTO cars (model, `year`, details, price, image1,
> >
> > Not sure if this is your problem, but those look like backticks around
> year
> > instead of single quotes. Should there even be quotes there?
> >
> > HTH
> > --
> > Joe Henry
> > www.celebrityaccess.com
> > [EMAIL PROTECTED]
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > __ NOD32 1.1475 (20060406) Information __
> >
> > This message was checked by NOD32 antivirus system.
> > http://www.eset.com
>
> Good to know. Thanks.
>
> --
> Joe Henry
> www.celebrityaccess.com
> [EMAIL PROTECTED]
>



--
Tom Chubb
[EMAIL PROTECTED]
07915 053312


Re: [PHP] Parse Error on SQL Insert

2006-04-07 Thread Joe Henry
On Friday 07 April 2006 1:56 pm, Chrome wrote:
> Backticks (`) encapsulate table or database names
>
> I was thinking maybe if the array references were encapsulated in curly
> braces {}:
>
> $_POST['model'] to {$_POST['model']}
>
> Of course if the field in the DB isn't numeric this would be
> '{$_POST['model']}'
>
> Dan
>
> ---
> http://chrome.me.uk
>
>
> -Original Message-
> From: Joe Henry [mailto:[EMAIL PROTECTED]
> Sent: 07 April 2006 20:53
> To: php-general@lists.php.net; [EMAIL PROTECTED]
> Subject: Re: [PHP] Parse Error on SQL Insert
>
> On Friday 07 April 2006 1:37 pm, Tom Chubb wrote:
> > $insertSQL = "INSERT INTO cars (model, `year`, details, price, image1,
>
> Not sure if this is your problem, but those look like backticks around year
> instead of single quotes. Should there even be quotes there?
>
> HTH
> --
> Joe Henry
> www.celebrityaccess.com
> [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> __ NOD32 1.1475 (20060406) Information __
>
> This message was checked by NOD32 antivirus system.
> http://www.eset.com

Good to know. Thanks.

-- 
Joe Henry
www.celebrityaccess.com
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse Error on SQL Insert

2006-04-07 Thread Satyam

Mi vote goes to the curly braces

The error is given by php, not by SQL

When exploding variables within double quotes it is hard for php to 
distinguish when a variable end unless it is a simple variable like $foo. 
When it is an array element and even worst, when it is an element of a 
multidimensional array, php cannot assert when it is over  (really, it is 
not a bug, try to figure out how to do it and you'll see it is not easy) so 
you tell php by enclosing the whole variable in curly braces.


Which it says so in the manual

Satyam
- Original Message - 
From: "Chrome" <[EMAIL PROTECTED]>
To: "'Joe Henry'" <[EMAIL PROTECTED]>; ; 
<[EMAIL PROTECTED]>

Sent: Friday, April 07, 2006 9:56 PM
Subject: RE: [PHP] Parse Error on SQL Insert



Backticks (`) encapsulate table or database names

I was thinking maybe if the array references were encapsulated in curly
braces {}:

$_POST['model'] to {$_POST['model']}

Of course if the field in the DB isn't numeric this would be
'{$_POST['model']}'

Dan

---
http://chrome.me.uk


-Original Message-
From: Joe Henry [mailto:[EMAIL PROTECTED]
Sent: 07 April 2006 20:53
To: php-general@lists.php.net; [EMAIL PROTECTED]
Subject: Re: [PHP] Parse Error on SQL Insert

On Friday 07 April 2006 1:37 pm, Tom Chubb wrote:

$insertSQL = "INSERT INTO cars (model, `year`, details, price, image1,


Not sure if this is your problem, but those look like backticks around 
year

instead of single quotes. Should there even be quotes there?

HTH
--
Joe Henry
www.celebrityaccess.com
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


__ NOD32 1.1475 (20060406) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse Error on SQL Insert

2006-04-07 Thread Ray Hauge
On Friday 07 April 2006 12:56, Chrome wrote:
> Of course if the field in the DB isn't numeric this would be
> '{$_POST['model']}'
>
> Dan

That's what I was thinking.  Even if data is a number, I still generally put 
quotes around it to make sure I don't have an issue.

-- 
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
www.americanstudentloan.com
1.800.575.1099

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse Error on SQL Insert

2006-04-07 Thread John Nichel

Tom Chubb wrote:

Complete code...



  $insertSQL = "INSERT INTO cars (model, `year`, details, price, image1,
image2, image3, forsale) VALUES ($_POST['model'], $_POST['year'],
$_POST['details'], $_POST['price'], $_FILE['image']['name'][0],
$_FILE['image']['name'][1], $_FILE['image']['name'][2], $_POST['forsale'])";



Looks like a problem with your input data.  Escape it.  You should be 
escaping it anyway, and not putting raw user input into your db.



The reason for the single quotes around the year is something to do with
Dreamweaver's insert wizard.


"year" is a special word in MySQL.  The back ticks are to let MySQL know 
that it's a column name.  Without the back ticks, MySQL will 'guess', 
but that can cause problems...best to just back tick all the column 
names anyway.


--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse Error on SQL Insert

2006-04-07 Thread Brad Bonkoski
thanks for the clarification, I guess the other solution would be to 
avoid using names with special meaning for column names...

-B

Ray Hauge wrote:


On Friday 07 April 2006 12:53, Joe Henry wrote:
 


On Friday 07 April 2006 1:37 pm, Tom Chubb wrote:
   


$insertSQL = "INSERT INTO cars (model, `year`, details, price, image1,
 


Not sure if this is your problem, but those look like backticks around year
instead of single quotes. Should there even be quotes there?

HTH
--
Joe Henry
www.celebrityaccess.com
[EMAIL PROTECTED]
   



The backticks should be fine.  They tell MySQL that you mean the column "year" 
of the table "cars" and not the MySQL special word "year" which can be used 
in date calculations.  The same thing would apply if you wanted a column 
named "create".


I would agree with John on the POST data.  Make sure you at least run 
mysql_real_escape_string().


 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Parse Error on SQL Insert

2006-04-07 Thread Chrome
Backticks (`) encapsulate table or database names

I was thinking maybe if the array references were encapsulated in curly
braces {}:

$_POST['model'] to {$_POST['model']}

Of course if the field in the DB isn't numeric this would be
'{$_POST['model']}'

Dan
 
---
http://chrome.me.uk
 

-Original Message-
From: Joe Henry [mailto:[EMAIL PROTECTED] 
Sent: 07 April 2006 20:53
To: php-general@lists.php.net; [EMAIL PROTECTED]
Subject: Re: [PHP] Parse Error on SQL Insert

On Friday 07 April 2006 1:37 pm, Tom Chubb wrote:
> $insertSQL = "INSERT INTO cars (model, `year`, details, price, image1,

Not sure if this is your problem, but those look like backticks around year 
instead of single quotes. Should there even be quotes there?

HTH
-- 
Joe Henry
www.celebrityaccess.com
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


__ NOD32 1.1475 (20060406) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse Error on SQL Insert

2006-04-07 Thread Ray Hauge
On Friday 07 April 2006 12:53, Joe Henry wrote:
> On Friday 07 April 2006 1:37 pm, Tom Chubb wrote:
> > $insertSQL = "INSERT INTO cars (model, `year`, details, price, image1,
>
> Not sure if this is your problem, but those look like backticks around year
> instead of single quotes. Should there even be quotes there?
>
> HTH
> --
> Joe Henry
> www.celebrityaccess.com
> [EMAIL PROTECTED]

The backticks should be fine.  They tell MySQL that you mean the column "year" 
of the table "cars" and not the MySQL special word "year" which can be used 
in date calculations.  The same thing would apply if you wanted a column 
named "create".

I would agree with John on the POST data.  Make sure you at least run 
mysql_real_escape_string().

-- 
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
www.americanstudentloan.com
1.800.575.1099

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse Error on SQL Insert

2006-04-07 Thread Tom Chubb
Complete code...



http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
http://www.w3.org/1999/xhtml";>


Untitled Document




  

  Model:
  


  Year:
  


  Details:



  Price:
  
  


  Image1:
  


  Image2:
  


  Image3:
  


  Forsale:
  


   
  

  
  

 





The reason for the single quotes around the year is something to do with
Dreamweaver's insert wizard.



On 07/04/06, Brad Bonkoski <[EMAIL PROTECTED]> wrote:
>
> why do you have single quotes around year?
> -B
>
> Tom Chubb wrote:
>
> >I'm working on an insert record page with a multiple file upload script
> of
> >which I understand the fundamentals.
> >However, on submission I am getting the following error:
> >
> >Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE,
> expecting
> >T_STRING or T_VARIABLE or T_NUM_STRING in
> >C:\apache2triad\htdocs\damotors\admin\insertnew.php on line 34
> >
> >Where line 34 is...
> >
> >$insertSQL = "INSERT INTO cars (model, `year`, details, price, image1,
> >image2, image3, forsale) VALUES ($_POST['model'], $_POST['year'],
> >$_POST['details'], $_POST['price'], $_FILE['image']['name'][0],
> >$_FILE['image']['name'][1], $_FILE['image']['name'][2],
> $_POST['forsale'])";
> >
> >
> >For info, the HTML for the form is as follows:
> >
> >
> >  Image1:
> >  
> >
> >
> >  Image2:
> >  
> >
> >
> >  Image3:
> >  
> >
> >
> >I've been slaving away for an hour and it's probably something really
> >obvious but I'd really appreciate it if someone could point it out to me
> >please?
> >Previously I was getting an "image1 cannot be null" error which I
> couldn't
> >work out either. That's gone, but I still can't work out what's going on.
> >
> >Many thanks,
> >
> >Tom
> >
> >
> >
> >--
> >Tom Chubb
> >[EMAIL PROTECTED]
> >07915 053312
> >
> >
> >
>
>


--
Tom Chubb
[EMAIL PROTECTED]
07915 053312


Re: [PHP] Parse Error on SQL Insert

2006-04-07 Thread Joe Henry
On Friday 07 April 2006 1:37 pm, Tom Chubb wrote:
> $insertSQL = "INSERT INTO cars (model, `year`, details, price, image1,

Not sure if this is your problem, but those look like backticks around year 
instead of single quotes. Should there even be quotes there?

HTH
-- 
Joe Henry
www.celebrityaccess.com
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse Error on SQL Insert

2006-04-07 Thread Brad Bonkoski

why do you have single quotes around year?
-B

Tom Chubb wrote:


I'm working on an insert record page with a multiple file upload script of
which I understand the fundamentals.
However, on submission I am getting the following error:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting
T_STRING or T_VARIABLE or T_NUM_STRING in
C:\apache2triad\htdocs\damotors\admin\insertnew.php on line 34

Where line 34 is...

$insertSQL = "INSERT INTO cars (model, `year`, details, price, image1,
image2, image3, forsale) VALUES ($_POST['model'], $_POST['year'],
$_POST['details'], $_POST['price'], $_FILE['image']['name'][0],
$_FILE['image']['name'][1], $_FILE['image']['name'][2], $_POST['forsale'])";


For info, the HTML for the form is as follows:

   
 Image1:
 
   
   
 Image2:
 
   
   
 Image3:
 
   

I've been slaving away for an hour and it's probably something really
obvious but I'd really appreciate it if someone could point it out to me
please?
Previously I was getting an "image1 cannot be null" error which I couldn't
work out either. That's gone, but I still can't work out what's going on.

Many thanks,

Tom



--
Tom Chubb
[EMAIL PROTECTED]
07915 053312

 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse Error on SQL Insert

2006-04-07 Thread John Nichel

Tom Chubb wrote:

I'm working on an insert record page with a multiple file upload script of
which I understand the fundamentals.
However, on submission I am getting the following error:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting
T_STRING or T_VARIABLE or T_NUM_STRING in
C:\apache2triad\htdocs\damotors\admin\insertnew.php on line 34

Where line 34 is...

$insertSQL = "INSERT INTO cars (model, `year`, details, price, image1,
image2, image3, forsale) VALUES ($_POST['model'], $_POST['year'],
$_POST['details'], $_POST['price'], $_FILE['image']['name'][0],
$_FILE['image']['name'][1], $_FILE['image']['name'][2], $_POST['forsale'])";



I've been slaving away for an hour and it's probably something really
obvious but I'd really appreciate it if someone could point it out to me
please?
Previously I was getting an "image1 cannot be null" error which I couldn't
work out either. That's gone, but I still can't work out what's going on.



Without seeing more code (the error is probably above line 34), I can 
only guess that the problem is with your posted data.  Escape your data 
before you insert it into a db.


--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Parse Error on SQL Insert

2006-04-07 Thread Tom Chubb
I'm working on an insert record page with a multiple file upload script of
which I understand the fundamentals.
However, on submission I am getting the following error:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting
T_STRING or T_VARIABLE or T_NUM_STRING in
C:\apache2triad\htdocs\damotors\admin\insertnew.php on line 34

Where line 34 is...

$insertSQL = "INSERT INTO cars (model, `year`, details, price, image1,
image2, image3, forsale) VALUES ($_POST['model'], $_POST['year'],
$_POST['details'], $_POST['price'], $_FILE['image']['name'][0],
$_FILE['image']['name'][1], $_FILE['image']['name'][2], $_POST['forsale'])";


For info, the HTML for the form is as follows:


  Image1:
  


  Image2:
  


  Image3:
  


I've been slaving away for an hour and it's probably something really
obvious but I'd really appreciate it if someone could point it out to me
please?
Previously I was getting an "image1 cannot be null" error which I couldn't
work out either. That's gone, but I still can't work out what's going on.

Many thanks,

Tom



--
Tom Chubb
[EMAIL PROTECTED]
07915 053312


RE: [PHP] Parse Error

2006-02-21 Thread Emmanuel Job
[snip]
for ($j = 0; $j < mysql_num_fields(result); $j++)
[/snip]

need to change this as well (forgot a $). should be:

for ($j = 0; $j < mysql_num_fields($result); $j++)


-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 21, 2006 1:34 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Parse Error


Ray Cantwell wrote:
> Hi all,
> I am a noob and super confused right now. I have some really simple code 
> and i am getting an error that reads:
> *Parse error*: syntax error, unexpected T_VARIABLE in 
> */var/www/mysql_up.php* on line
> 
> here is the code:
> 
> 
> Test MySQL
> 
> 
>  $host="localhost"
> $user="ray"
> $password="*"


Terminate your php lines with a semi-colon ';'

-- 
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse Error

2006-02-21 Thread benifactor

- Original Message - 
From: "Ray Cantwell" <[EMAIL PROTECTED]>
To: 
Sent: Tuesday, February 21, 2006 1:27 PM
Subject: [PHP] Parse Error


> Hi all,
> I am a noob and super confused right now. I have some really simple code 
> and i am getting an error that reads:
> *Parse error*: syntax error, unexpected T_VARIABLE in 
> */var/www/mysql_up.php* on line
> 
> here is the code:
> 
> 
> Test MySQL
> 
> 
>  $host="localhost"
> $user="ray"
> $password="*"
> 
> mysql_connect($host,$user,$password) ;
> $sql="show status";
> $result = mysql_query($sql);
> if ($result == 0)
>echo "Error " . mysql_errno() . ": "
>  . mysql_error() . "";
> else
> {
> ?>
> 
> 
>   Variable_nameValue
>   
>for ($i = 0; $i < mysql_num_rows($result); $i++) {
>   echo "";
>   $row_array = mysql_fetch_row($result);
>   for ($j = 0; $j < mysql_num_fields(result); $j++)
>   {/
> echo "" . $row_array[$j] . "";
>   }
>   echo "";
>}
>  ?>
> 
> 
> 
> 
> I am really confused because i cannot see any obvious errors.
> any help would be appreciated.
> 
> Ray.
> 
> 
> 
>

you need to add a ; to every  variable you assign... 
you had:
$host="localhost"
 $user="ray"
 $password="*"

it should be:

$host="localhost";
$user="ray";
$password="*";

also i belive a better way to get the result of your query would be

mysql_connect($host, $user, $pass) or die(mysql_error());

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse Error

2006-02-21 Thread John Nichel

Ray Cantwell wrote:

Hi all,
I am a noob and super confused right now. I have some really simple code 
and i am getting an error that reads:
*Parse error*: syntax error, unexpected T_VARIABLE in 
*/var/www/mysql_up.php* on line


here is the code:


Test MySQL





Terminate your php lines with a semi-colon ';'

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse Error

2006-02-21 Thread Ray

Jay Blanchard wrote:


[snip]
I am a noob and super confused right now. I have some really simple code 
and i am getting an error that reads:
*Parse error*: syntax error, unexpected T_VARIABLE in 
*/var/www/mysql_up.php* on line


here is the code:


Test MySQL


 


Thanks. did i say i was a n00b? :-)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse Error

2006-02-21 Thread Claudio Corlatti

Hi,
you need to finish every line with ;
$host="localhost" ;
$user="ray" ;
$password="*" ;

Bye


Ray Cantwell wrote:

Hi all,
I am a noob and super confused right now. I have some really simple 
code and i am getting an error that reads:
*Parse error*: syntax error, unexpected T_VARIABLE in 
*/var/www/mysql_up.php* on line


here is the code:


Test MySQL


Error " . mysql_errno() . ": "
. mysql_error() . "";
else
{
?>


 Variable_nameValue
 
 ";
 $row_array = mysql_fetch_row($result);
 for ($j = 0; $j < mysql_num_fields(result); $j++)
 {/
   echo "" . $row_array[$j] . "";
 }
 echo "";
  }
?>




I am really confused because i cannot see any obvious errors.
any help would be appreciated.

Ray.








Re: [PHP] Parse Error

2006-02-21 Thread Kevin Waterson
This one time, at band camp, Ray Cantwell <[EMAIL PROTECTED]> wrote:


>  $host="localhost"
> $user="ray"
> $password="*"

these need to be terminated with ;

$host = 'localhost';
etc
etc

Kevin

-- 
"Democracy is two wolves and a lamb voting on what to have for lunch. 
Liberty is a well-armed lamb contesting the vote."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse Error

2006-02-21 Thread Ray Hauge
On Tuesday 21 February 2006 14:27, Ray Cantwell wrote:
> Hi all,
> I am a noob and super confused right now. I have some really simple code
> and i am getting an error that reads:
> *Parse error*: syntax error, unexpected T_VARIABLE in
> */var/www/mysql_up.php* on line
>
> here is the code:
>
> 
> Test MySQL
> 
> 
>  $host="localhost"
> $user="ray"
> $password="*"
>
> mysql_connect($host,$user,$password) ;
> $sql="show status";
> $result = mysql_query($sql);
> if ($result == 0)
>echo "Error " . mysql_errno() . ": "
>  . mysql_error() . "";
> else
> {
> ?>
> 
> 
>   Variable_nameValue
>   
>for ($i = 0; $i < mysql_num_rows($result); $i++) {
>   echo "";
>   $row_array = mysql_fetch_row($result);
>   for ($j = 0; $j < mysql_num_fields(result); $j++)
>   {/
> echo "" . $row_array[$j] . "";
>   }
>   echo "";
>}
>  ?>
> 
> 
> 
>
> I am really confused because i cannot see any obvious errors.
> any help would be appreciated.
>
> Ray.

It looks like you need some semi-colons after assigning values to variables at 
the top of your file.

If that's not the problem, let us know what line number this is happening on.  
It makes it a lot easier to spot the problem ;)

-- 
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
http://www.americanstudentloan.com
1.800.575.1099

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Parse Error

2006-02-21 Thread Jay Blanchard
[snip]
I am a noob and super confused right now. I have some really simple code 
and i am getting an error that reads:
*Parse error*: syntax error, unexpected T_VARIABLE in 
*/var/www/mysql_up.php* on line

here is the code:


Test MySQL


http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Parse Error

2006-02-21 Thread Ray Cantwell

Hi all,
I am a noob and super confused right now. I have some really simple code 
and i am getting an error that reads:
*Parse error*: syntax error, unexpected T_VARIABLE in 
*/var/www/mysql_up.php* on line


here is the code:


Test MySQL


Error " . mysql_errno() . ": "
. mysql_error() . "";
else
{
?>


 Variable_nameValue
 
 ";
 $row_array = mysql_fetch_row($result);
 for ($j = 0; $j < mysql_num_fields(result); $j++)
 {/
   echo "" . $row_array[$j] . "";
 }
 echo "";
  }
?>




I am really confused because i cannot see any obvious errors.
any help would be appreciated.

Ray.





Re: [PHP] Parse error: parse error, unexpected T_ELSE

2005-04-26 Thread Petar Nedyalkov
On Tuesday 26 April 2005 11:10, Mark Sargent wrote:
> Prathaban Mookiah wrote:
> >Mark,
> >
> >Back to basics budy!!
> >
> >> 25 if ($myrow = mysql_fetch_array($result)); {
> >
> >should be
> >
> >> 25 if ($myrow = mysql_fetch_array($result)) {
> >
> >Note that extra semicolon?
> >
> >
> >Prathap
> >
> >
> >-- Original Message ---
> >From: Mark Sargent <[EMAIL PROTECTED]>
> >To: php-general@lists.php.net
> >Sent: Tue, 26 Apr 2005 16:01:24 +0900
> >Subject: [PHP] Parse error: parse error, unexpected T_ELSE
> >
> >>Hi All,
> >>
> >>again, I'm following an example from webmonkey,
> >>
> >>http://webmonkey.wired.com/webmonkey/99/21/index3a_page2.html?tw=programm
> >>ing
> >>
> >> and I'm changing only what's relevant to me. I haven't altered the
> >>code basics, though. But I get the error regarding "else". I don't
> >>see what it is. Anyone..? Cheers.
> >>
> >>Mark Sargent.
> >>
> >>*Parse error*: parse error, unexpected T_ELSE in
> >>*/var/www/html/phpmysqltable.php* on line *41*
> >>
> >> 25 if ($myrow = mysql_fetch_array($result)); {
> >> 26
> >> 27 echo "\n";
> >> 28
> >> 29 echo "Product NameProduct Model
> >>NumberProduct
> >> 30 Serial Number\n";
> >> 31
> >> 32 do {
> >> 33
> >> 34 printf("%s%s%s\n",
> >>$myrow[product_name], $myrow[product_model_number],
> >> 35 $myrow[product_serial_number]);
> >> 36
> >> 37 } while ($myrow = mysql_fetch_array($result));
> >> 38
> >> 39 echo "\n";
> >> 40
> >> 41 } else {
> >> 42
> >> 43 echo "Sorry, no data is available for that request";
> >> 44
> >> 45 }
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >--- End of Original Message ---
>
> Hi All,
>
> yep, basics are good, hence my following the tut at webmonkey(so I can
> learn the basics), and I obviously missed that little error. Cheers.
>
> P.S. Some people are mailig me direct. That's great, but, I'd prefer you
> reply in here, so all can see/comment. Cheers, again.

Some people have intelligent mail agents that rely on mailing list headers. 
And since you use Reply-To header that's not been overwritten by the 
mainling-list daemon, we replied (me too) directly to you. Remove the 
Reply-To and you'll have no worries.

>
> Mark Sargent.

-- 

Cyberly yours,
Petar Nedyalkov
Devoted Orbitel Fan :-)

PGP ID: 7AE45436
PGP Public Key: http://bu.orbitel.bg/pgp/bu.asc
PGP Fingerprint: 7923 8D52 B145 02E8 6F63 8BDA 2D3F 7C0B 7AE4 5436


pgpiM6dmv3CQl.pgp
Description: PGP signature


Re: [PHP] Parse error: parse error, unexpected T_ELSE

2005-04-26 Thread Mark Sargent
Prathaban Mookiah wrote:
Mark,
Back to basics budy!!
 

25 if ($myrow = mysql_fetch_array($result)); {
   

should be 

 

25 if ($myrow = mysql_fetch_array($result)) {
   

Note that extra semicolon?
Prathap
-- Original Message ---
From: Mark Sargent <[EMAIL PROTECTED]>
To: php-general@lists.php.net
Sent: Tue, 26 Apr 2005 16:01:24 +0900
Subject: [PHP] Parse error: parse error, unexpected T_ELSE
 

Hi All,
again, I'm following an example from webmonkey,
http://webmonkey.wired.com/webmonkey/99/21/index3a_page2.html?tw=programming
and I'm changing only what's relevant to me. I haven't altered the 
code basics, though. But I get the error regarding "else". I don't 
see what it is. Anyone..? Cheers.

Mark Sargent.
*Parse error*: parse error, unexpected T_ELSE in 
*/var/www/html/phpmysqltable.php* on line *41*

25 if ($myrow = mysql_fetch_array($result)); {
26
27 echo "\n";
28
29 echo "Product NameProduct Model 
NumberProduct
30 Serial Number\n";
31
32 do {
33
34 printf("%s%s%s\n", 
$myrow[product_name], $myrow[product_model_number],
35 $myrow[product_serial_number]);
36
37 } while ($myrow = mysql_fetch_array($result));
38
39 echo "\n";
40
41 } else {
42
43 echo "Sorry, no data is available for that request";
44
45 }

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
   

--- End of Original Message ---
 

Hi All,
yep, basics are good, hence my following the tut at webmonkey(so I can 
learn the basics), and I obviously missed that little error. Cheers.

P.S. Some people are mailig me direct. That's great, but, I'd prefer you 
reply in here, so all can see/comment. Cheers, again.

Mark Sargent.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Parse error: parse error, unexpected T_ELSE

2005-04-26 Thread Prathaban Mookiah
Mark,

Back to basics budy!!

>  25 if ($myrow = mysql_fetch_array($result)); {

should be 

>  25 if ($myrow = mysql_fetch_array($result)) {

Note that extra semicolon?


Prathap


-- Original Message ---
From: Mark Sargent <[EMAIL PROTECTED]>
To: php-general@lists.php.net
Sent: Tue, 26 Apr 2005 16:01:24 +0900
Subject: [PHP] Parse error: parse error, unexpected T_ELSE

> Hi All,
> 
> again, I'm following an example from webmonkey,
> 
> http://webmonkey.wired.com/webmonkey/99/21/index3a_page2.html?tw=programming
> 
>  and I'm changing only what's relevant to me. I haven't altered the 
> code basics, though. But I get the error regarding "else". I don't 
> see what it is. Anyone..? Cheers.
> 
> Mark Sargent.
> 
> *Parse error*: parse error, unexpected T_ELSE in 
> */var/www/html/phpmysqltable.php* on line *41*
> 
>  25 if ($myrow = mysql_fetch_array($result)); {
>  26
>  27 echo "\n";
>  28
>  29 echo "Product NameProduct Model 
> NumberProduct
>  30 Serial Number\n";
>  31
>  32 do {
>  33
>  34 printf("%s%s%s\n", 
> $myrow[product_name], $myrow[product_model_number],
>  35 $myrow[product_serial_number]);
>  36
>  37 } while ($myrow = mysql_fetch_array($result));
>  38
>  39 echo "\n";
>  40
>  41 } else {
>  42
>  43 echo "Sorry, no data is available for that request";
>  44
>  45 }
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End of Original Message ---

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Parse error: parse error, unexpected T_ELSE

2005-04-26 Thread Mark Sargent
Hi All,
again, I'm following an example from webmonkey,
http://webmonkey.wired.com/webmonkey/99/21/index3a_page2.html?tw=programming
and I'm changing only what's relevant to me. I haven't altered the code 
basics, though. But I get the error regarding "else". I don't see what 
it is. Anyone..? Cheers.

Mark Sargent.
*Parse error*: parse error, unexpected T_ELSE in 
*/var/www/html/phpmysqltable.php* on line *41*

25 if ($myrow = mysql_fetch_array($result)); {
26
27 echo "\n";
28
29 echo "Product NameProduct Model 
NumberProduct
30 Serial Number\n";
31
32 do {
33
34 printf("%s%s%s\n", 
$myrow[product_name], $myrow[product_model_number],
35 $myrow[product_serial_number]);
36
37 } while ($myrow = mysql_fetch_array($result));
38
39 echo "\n";
40
41 } else {
42
43 echo "Sorry, no data is available for that request";
44
45 }

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] parse error, unexpected T_CLASS

2005-04-20 Thread Kim Briggs
On 4/20/05, Jochem Maas <[EMAIL PROTECTED]> wrote:
>> Dasmeet Singh wrote:

>> BTW.. pls suggest some good editor.. I use notepad currently..

> http://www.php-editors.com/
> http://www.google.com/search?hl=en&lr=&q=good+editor+for+php&btnG=Search
> 
> choose one.
> 

This can take a long time, I know.  My favorite by far on Windows is
Crimson Editor (also free as in beer).

http://www.crimsoneditor.com/

-KB

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] parse error, unexpected T_CLASS

2005-04-20 Thread Jochem Maas
Dasmeet Singh wrote:
...
Get some decent editor with syntax highlighting
ditto. :-)
Thanks.. That was really silly..
BTW.. pls suggest some good editor.. I use notepad currently..
OFFS.
http://www.php-editors.com/
http://www.google.com/search?hl=en&lr=&q=good+editor+for+php&btnG=Search
choose one.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] parse error, unexpected T_CLASS

2005-04-19 Thread Jason Barnett
Dasmeet Singh wrote:
> Jay Blanchard wrote:
>> [snip]
>> echo ("  $row[1]   Location- $row[4] 
>> Property Type- $ptypeMin Price- $row[9] ");
>>
>> it gives an error..
>>
>> Parse error: parse error, unexpected T_CLASS in
>> /home/real/public_html/functions.php on line 162
>>
>> Any idea..why? Probably any stupid mistake .. :(
>> [/snip]
>>
>> Takes the parentheses out.
>>
>> echo "  $row[1]   Location- $row[4] 
>> Property Type- $ptypeMin Price- $row[9] ";
>>
>> From http://www.php.net/echo "echo() is not actually a function (it is a
>> language construct) so you are not required to use parentheses with it.
>> In fact, if you want to pass more than one parameter to echo, you must
>> not enclose the parameters within parentheses."
>
>
> Removed the ()..still the same error :(.. am copying complete
> function..if its because of something else...
>
> function showProperty($filter, $by, $value)
> {
> if($filter==true)
>{
>$query="SELECT * FROM `Property` WHERE ".$by." = '".$value."'
> ORDER BY DateAdded DESC";
>
>}
> else
>   {
>$query="SELECT * FROM `Property`ORDER BY DateAdded DESC;

Missing the ending " above.  So this line would be:
$query="SELECT * FROM `Property`ORDER BY DateAdded DESC";

>   }
>
> $result=db_query($query);
> while($row=mysql_fetch_row($result))
>   {
> $ptype= getName('propertyTypes', 'id', $row[8] , 'Name');
> echo "  $row[1]   Location- $row[4] 

PHP thinks this is the ENDING " instead of the BEGINNING ".  So when the
parser reaches the text that says " Property Type- $ptypeMin Price- $row[9] ";
> }
> }
>
> -
> Free Website Promotion - A Complete Guide
> http://hostwindow.info/web-hosting/9/free-website-promotion/1/


--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins


signature.asc
Description: OpenPGP digital signature


Re: [PHP] parse error, unexpected T_CLASS

2005-04-19 Thread Dasmeet Singh
Marek Kilimajer wrote:
Dasmeet Singh wrote:
Jay Blanchard wrote:
 > [snip]
 > echo ("  $row[1]   Location- $row[4] 
 > Property Type- $ptypeMin Price- $row[9] ");
 >
 > it gives an error..
 >
 > Parse error: parse error, unexpected T_CLASS in
 > /home/real/public_html/functions.php on line 162
 >
 > Any idea..why? Probably any stupid mistake .. :(
 > [/snip]
 >
 > Takes the parentheses out.
 >
 > echo "  $row[1]   Location- $row[4] 
 > Property Type- $ptypeMin Price- $row[9] ";
 >
 > From http://www.php.net/echo "echo() is not actually a function (it 
is a
 > language construct) so you are not required to use parentheses with 
it.
 > In fact, if you want to pass more than one parameter to echo, you must
 > not enclose the parameters within parentheses."

Removed the ()..still the same error :(.. am copying complete 
function..if its because of something else...

function showProperty($filter, $by, $value)
{
if($filter==true)
   {
   $query="SELECT * FROM `Property` WHERE ".$by." = '".$value."' 
ORDER BY DateAdded DESC";

   }
else
  {
   $query="SELECT * FROM `Property`ORDER BY DateAdded DESC;

^
missing double quote.
Get some decent editor with syntax highlighting
Thanks.. That was really silly..
BTW.. pls suggest some good editor.. I use notepad currently..
-
Free Website Promotion - A Complete Guide
http://hostwindow.info/web-hosting/9/free-website-promotion/1/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] parse error, unexpected T_CLASS

2005-04-19 Thread Marek Kilimajer
Dasmeet Singh wrote:
Jay Blanchard wrote:
 > [snip]
 > echo ("  $row[1]   Location- $row[4] 
 > Property Type- $ptypeMin Price- $row[9] ");
 >
 > it gives an error..
 >
 > Parse error: parse error, unexpected T_CLASS in
 > /home/real/public_html/functions.php on line 162
 >
 > Any idea..why? Probably any stupid mistake .. :(
 > [/snip]
 >
 > Takes the parentheses out.
 >
 > echo "  $row[1]   Location- $row[4] 
 > Property Type- $ptypeMin Price- $row[9] ";
 >
 > From http://www.php.net/echo "echo() is not actually a function (it is a
 > language construct) so you are not required to use parentheses with it.
 > In fact, if you want to pass more than one parameter to echo, you must
 > not enclose the parameters within parentheses."
Removed the ()..still the same error :(.. am copying complete 
function..if its because of something else...

function showProperty($filter, $by, $value)
{
if($filter==true)
   {
   $query="SELECT * FROM `Property` WHERE ".$by." = '".$value."' 
ORDER BY DateAdded DESC";

   }
else
  {
   $query="SELECT * FROM `Property`ORDER BY DateAdded DESC;
^
missing double quote.
Get some decent editor with syntax highlighting
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] parse error, unexpected T_CLASS

2005-04-19 Thread Dasmeet Singh
Jay Blanchard wrote:
> [snip]
> echo ("  $row[1]   Location- $row[4] 
> Property Type- $ptypeMin Price- $row[9] ");
>
> it gives an error..
>
> Parse error: parse error, unexpected T_CLASS in
> /home/real/public_html/functions.php on line 162
>
> Any idea..why? Probably any stupid mistake .. :(
> [/snip]
>
> Takes the parentheses out.
>
> echo "  $row[1]   Location- $row[4] 
> Property Type- $ptypeMin Price- $row[9] ";
>
> From http://www.php.net/echo "echo() is not actually a function (it is a
> language construct) so you are not required to use parentheses with it.
> In fact, if you want to pass more than one parameter to echo, you must
> not enclose the parameters within parentheses."
Removed the ()..still the same error :(.. am copying complete 
function..if its because of something else...

function showProperty($filter, $by, $value)
{
if($filter==true)
   {
   $query="SELECT * FROM `Property` WHERE ".$by." = '".$value."' 
ORDER BY DateAdded DESC";

   }
else
  {
   $query="SELECT * FROM `Property`ORDER BY DateAdded DESC;
  }
$result=db_query($query);
while($row=mysql_fetch_row($result))
  {
$ptype= getName('propertyTypes', 'id', $row[8] , 'Name');
echo "  $row[1]   Location- $row[4]  
Property Type- $ptypeMin Price- $row[9] ";
}
}

-
Free Website Promotion - A Complete Guide
http://hostwindow.info/web-hosting/9/free-website-promotion/1/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] parse error, unexpected T_CLASS

2005-04-19 Thread Jay Blanchard
[snip]
echo ("  $row[1]   Location- $row[4]  
Property Type- $ptypeMin Price- $row[9] ");

it gives an error..

Parse error: parse error, unexpected T_CLASS in 
/home/real/public_html/functions.php on line 162

Any idea..why? Probably any stupid mistake .. :(
[/snip]

Takes the parentheses out.

echo "  $row[1]   Location- $row[4]  
Property Type- $ptypeMin Price- $row[9] ";

>From http://www.php.net/echo "echo() is not actually a function (it is a
language construct) so you are not required to use parentheses with it.
In fact, if you want to pass more than one parameter to echo, you must
not enclose the parameters within parentheses."

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] parse error, unexpected T_CLASS

2005-04-19 Thread Marek Kilimajer
Dasmeet Singh wrote:
Hi!
When i try to run the following line:
echo ("  $row[1]   Location- $row[4]  
Property Type- $ptypeMin Price- $row[9] ");
The above line is fine. Check the lines above.

it gives an error..
Parse error: parse error, unexpected T_CLASS in 
/home/real/public_html/functions.php on line 162

Any idea..why? Probably any stupid mistake .. :(
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] parse error, unexpected T_CLASS

2005-04-19 Thread Dasmeet Singh
Hi!
When i try to run the following line:
echo ("  $row[1]   Location- $row[4]  
Property Type- $ptypeMin Price- $row[9] ");

it gives an error..
Parse error: parse error, unexpected T_CLASS in 
/home/real/public_html/functions.php on line 162

Any idea..why? Probably any stupid mistake .. :(
-
Free Website Promotion - A Complete Guide
http://hostwindow.info/web-hosting/9/free-website-promotion/1/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Parse Error on mysql_query

2005-04-16 Thread Philip Hallstrom
Add a ; to the end of line 16.
On Sun, 17 Apr 2005, Bagus Nugroho wrote:
Hi,
I'm beginning to learn PHP/MySQL, i have problem 'parse error' when 
using 'mysql_query' although it was simple code, like this :

=
1 
Parse error: parse error, expecting `','' or `';'' in d:\www\test\refer1.php on 
line 17

Can anyone help me to explain this problem
Thanks in advance

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Parse Error on mysql_query

2005-04-16 Thread Bagus Nugroho
Hi,

I'm beginning to learn PHP/MySQL, i have problem 'parse error' when using 
'mysql_query' although it was simple code, like this :

=
1 

Re: [PHP] parse error, unexpected T_ENCAPSED_AND_WHITESPACE

2005-03-15 Thread Jeff Schmidt
Hello,
  Sorry about that. I took the source down after I solved the problem. 
The problem was a nasty type of syntax error caused by PHP 
implementation of HEREDOC string delimiting.

I was using HEREDOC to stuff multiple lines of HTML into a string, in 
several places in my file, which is all fine and good. However, PHP does 
not recognize the delimiter token that marks the end of the string, if 
there is any whitespace on the same line. I had made sure that my token 
was all the way over to the beginning of the line, but what I *didn't* 
realize was that there was a couple spaces after the token. This caused 
the parser to basically treat the whole rest of the script file as a 
heredoc string, which is where the problems came from.

Jeff Schmidt
Jason Barnett wrote:
Jeff Schmidt wrote:
Hello,
 I've made the source available at:
http://www.weldingconsultants.com/wcapp/admin.phps

404 error when I just tried.
--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] parse error, unexpected T_ENCAPSED_AND_WHITESPACE

2005-03-15 Thread Jason Barnett
Jeff Schmidt wrote:
> Hello,
>   I've made the source available at:
> http://www.weldingconsultants.com/wcapp/admin.phps

404 error when I just tried.

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins


signature.asc
Description: OpenPGP digital signature


Re: [PHP] parse error, unexpected T_ENCAPSED_AND_WHITESPACE

2005-03-15 Thread Jeff Schmidt
Hello,
  I've made the source available at: 
http://www.weldingconsultants.com/wcapp/admin.phps

Chris W. Parker wrote:
print '\n";

Very likely the problem is not on line 82, but rather before it. Line 82
is just where the PHP parser finally gets screwed up.
Yeah, that is what I was thinking too. But I can't find what the problem 
is earlier in the file. *sigh*


$profID = $row["profileID"];
print '\n";
When I had done that, the parser started choking at the top line.

I suggest the following: (The HTML should all be on one line.)
echo "";
I'll do that, simply because it is a little clearer to read, but I don't 
think the problem actually has to do with my string delimeters and 
escaping. For one thing, as I mentioned, the problem seems to be with 
$row["profileID"], based upon the fact that I moved that out onto a line 
basically by itself, and the parser error 'moved' to that line.

Please don't send attachments to a public mailing list. Besides, I don't
think they go through anyway.
Ok, I'll just post links in the future. I just thought it would be more 
convenient to attach it, but I can link, that's no problem.

Also, from your followup:
> Ohh .. and if i read it more fully the first time I would have seen
> that you've got some funky in/out quoting problems and that you're not
> escaping the quotes wrapping 'true'.
If you go back and look again, I don't need the single-quotes wrapping 
'true' to be escaped, because that chunk of the string is wrapped in 
double-quotes. Yeah, I know, it's confusing lol. One of the problems of 
using PHP to print html, unfortunately. Well, part of the reason I have 
the string construction set up so strangely, is that I was testing out 
to see if certain things were causing problems. Originally I had it 
setup more like how you suggested. I only changed it to test some 
theories out about what might be causing the parser error.

Jeff Schmidt
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] (SOLVED) Re: [PHP] parse error, unexpected T_ENCAPSED_AND_WHITESPACE

2005-03-15 Thread Jeff Schmidt
Ok, well the mystery is solved. Earlier in the script, I had used 
HEREDOC string delimiting to output some html blocks (I feel, 
asthetically, that HEREDOC is more readable than escaping out to HTML 
then back into PHP). Somehow, and I'm not sure how, because I don't 
remember typing the spaces, but somehow, exactly 4 spaces got inserted 
after each of my heredoc delimiter tokens in my script. Well, PHP isn't, 
apparently, smart enough to ignore the white space after the delimiter, 
and decided that the entire rest of my script constituted one large 
HEREDOC block.

I only caught this after putting a copy of my script on my webserver 
with .phps extension and looking at it, and noticing that after the 
heredoc, all syntax highlighting stopped.

So, I guess even though HEREDOC might be more pleasing to read (imho), 
it has a nasty class of syntax error that is *very* hard to detect 
(since it is very hard to 'see' that you have whitespace after the 
token). Caveat coder.

Actually, I think I just figured out where the whitespace came from. My 
text editor has a feature, normally usefull, to do automatic indenting 
when you start a new line of code. I think it indented the cursor 4 
spaces, and I hit 'home' and typed the delimiting token, and forgot 
about the whitespace at the end (normally, whitespace is 
ignored/collapsed by the parser).

Jeff Schmidt
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] parse error, unexpected T_ENCAPSED_AND_WHITESPACE

2005-03-14 Thread Dan Tappin
Why not make it simple?:
// end PHP code ?>
]' 
value='true'>


Dan T
On Mar 14, 2005, at 3:58 PM, Jeff Schmidt wrote:
Hello,
  I'm beating my head, and can't figure out *WHY* PHP is giving me 
this error. The full error text is:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, 
expecting T_STRING or T_VARIABLE or T_NUM_STRING in 
/hsphere/local/home/welding/weldingconsultants.com/wcapp/admin.php on 
line 82

Line 82 is:
print '\n";

The problem seems to have something to do with the construct 
$row["profileID"] - I say this, because I pulled that out into a 
seperate line before this, at one point, just to test, and assigned it 
to a variable, and put the variable in place of the array access. That 
is, to test, at one point, my file had:

$profID = $row["profileID"];
print '\n";

When I had done that, the parser started choking at the top line.
I've attached the full file, to see the context that this is in.
Can *anyone* explain this error? It's completely breaking my script. I 
suspect, that the *real* error is somewhere earlier in the file, but 
I've read through it 20 times and just can't find anything out of 
place (can't find any obvious syntax errors, for example).

Thanks for any help you can give me,
Jeff Schmidt
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] parse error, unexpected T_ENCAPSED_AND_WHITESPACE

2005-03-14 Thread Chris W. Parker
Jason Barnett 
on Monday, March 14, 2005 3:57 PM said:

> Chris W. Parker wrote:
>> Chris W. Parker <>
>> on Monday, March 14, 2005 3:15 PM said:
>> 
>> 
 Line 82 is:
 print '>>> $row["profileID"] . ']' . "' value='true'/>\n";
>>> 
>>> Very likely the problem is not on line 82, but rather before it.
>>> Line 82 is just where the PHP parser finally gets screwed up.
>> 
>> 
>> Ohh .. and if i read it more fully the first time I would have seen
>> that you've got some funky in/out quoting problems and that you're
>> not escaping the quotes wrapping 'true'. :)
>> 
> 
> Quotes look ok to me?  God bless VIM (even on this old windows box) :)

I realized my mistake about two seconds after I'd send and decided not
to reply to myself twice. :(

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] parse error, unexpected T_ENCAPSED_AND_WHITESPACE

2005-03-14 Thread Andre Dubuc
On Monday 14 March 2005 06:22 pm, Chris W. Parker wrote:
> Chris W. Parker <>
>
> on Monday, March 14, 2005 3:15 PM said:
> >> Line 82 is:
> >> print ' >> $row["profileID"] . ']' . "' value='true'/>\n";
> >
> > Very likely the problem is not on line 82, but rather before it. Line
> > 82 is just where the PHP parser finally gets screwed up.
>
> Ohh .. and if i read it more fully the first time I would have seen that
> you've got some funky in/out quoting problems and that you're not
> escaping the quotes wrapping 'true'. :)
>
>
>
> Chris.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] parse error, unexpected T_ENCAPSED_AND_WHITESPACE

2005-03-14 Thread Jason Barnett
Chris W. Parker wrote:
> Chris W. Parker <>
> on Monday, March 14, 2005 3:15 PM said:
>
>
>>>Line 82 is:
>>>print '>>$row["profileID"] . ']' . "' value='true'/>\n";
>>
>>Very likely the problem is not on line 82, but rather before it. Line
>>82 is just where the PHP parser finally gets screwed up.
>
>
> Ohh .. and if i read it more fully the first time I would have seen that
> you've got some funky in/out quoting problems and that you're not
> escaping the quotes wrapping 'true'. :)
>

Quotes look ok to me?  God bless VIM (even on this old windows box) :)

In any case Chris' original suggestion is probably right... it's likely
that the last place you used quotes *before* line 82 is missing a
closing quote.

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins


signature.asc
Description: OpenPGP digital signature


Re: [PHP] parse error, unexpected T_ENCAPSED_AND_WHITESPACE

2005-03-14 Thread M. Sokolewicz
Chris W. Parker wrote:
Chris W. Parker <>
on Monday, March 14, 2005 3:15 PM said:

Line 82 is:
print '\n";
Very likely the problem is not on line 82, but rather before it. Line
82 is just where the PHP parser finally gets screwed up.

Ohh .. and if i read it more fully the first time I would have seen that
you've got some funky in/out quoting problems and that you're not
escaping the quotes wrapping 'true'. :)

Chris.
that's because he's using single quotes for his value there, and double 
quotes to denote it being a string in that last part...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] parse error, unexpected T_ENCAPSED_AND_WHITESPACE

2005-03-14 Thread Chris W. Parker
Chris W. Parker <>
on Monday, March 14, 2005 3:15 PM said:

>> Line 82 is:
>> print '> $row["profileID"] . ']' . "' value='true'/>\n";
> 
> Very likely the problem is not on line 82, but rather before it. Line
> 82 is just where the PHP parser finally gets screwed up.

Ohh .. and if i read it more fully the first time I would have seen that
you've got some funky in/out quoting problems and that you're not
escaping the quotes wrapping 'true'. :)



Chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] parse error, unexpected T_ENCAPSED_AND_WHITESPACE

2005-03-14 Thread Chris W. Parker
Jeff Schmidt 
on Monday, March 14, 2005 2:58 PM said:

> Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE,
> expecting T_STRING or T_VARIABLE or T_NUM_STRING in
> /hsphere/local/home/welding/weldingconsultants.com/wcapp/admin.php on
> line 82
> 
> Line 82 is:
> print ' $row["profileID"] . ']' . "' value='true'/>\n";

Very likely the problem is not on line 82, but rather before it. Line 82
is just where the PHP parser finally gets screwed up.

> $profID = $row["profileID"];
> print ' "' value='true'/>\n";
> 
> When I had done that, the parser started choking at the top line.

I suggest the following: (The HTML should all be on one line.)

echo "";

> I've attached the full file, to see the context that this is in.

Please don't send attachments to a public mailing list. Besides, I don't
think they go through anyway.

> Can *anyone* explain this error? It's completely breaking my script. I
> suspect, that the *real* error is somewhere earlier in the file, but
> I've read through it 20 times and just can't find anything out of
> place (can't find any obvious syntax errors, for example).

Post the file to a web server somewhere in plain text.



Chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] parse error, unexpected T_ENCAPSED_AND_WHITESPACE

2005-03-14 Thread Jeff Schmidt
Hello,
  I'm beating my head, and can't figure out *WHY* PHP is giving me this 
error. The full error text is:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, 
expecting T_STRING or T_VARIABLE or T_NUM_STRING in 
/hsphere/local/home/welding/weldingconsultants.com/wcapp/admin.php on 
line 82

Line 82 is:
print '\n";

The problem seems to have something to do with the construct 
$row["profileID"] - I say this, because I pulled that out into a 
seperate line before this, at one point, just to test, and assigned it 
to a variable, and put the variable in place of the array access. That 
is, to test, at one point, my file had:

$profID = $row["profileID"];
print '\n";

When I had done that, the parser started choking at the top line.
I've attached the full file, to see the context that this is in.
Can *anyone* explain this error? It's completely breaking my script. I 
suspect, that the *real* error is somewhere earlier in the file, but 
I've read through it 20 times and just can't find anything out of place 
(can't find any obvious syntax errors, for example).

Thanks for any help you can give me,
Jeff Schmidt
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Parse Error... how to fix?

2004-12-16 Thread Chris W. Parker
Richard Lynch 
on Thursday, December 16, 2004 10:46 AM said:

>> " $language['program_name'] \n" .
> 
> #1. Get rid of the ''s around program_name.  Those won't work inside
> of ""s.

echo "{$language['program_name']}\n";

http://us2.php.net/manual/en/language.types.array.php

> #3. Just break out of PHP for anything more than two lines of HTML.

...or use heredoc syntax.

http://us2.php.net/manual/en/language.types.string.php#language.types.st
ring.syntax.heredoc



Chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Parse Error... how to fix?

2004-12-16 Thread Chris W. Parker
GH 
on Thursday, December 16, 2004 10:10 AM said:

> However, I can not get any results into the  tags all three
> options are not displaying

try:

";
  print_r($language['program_name']);
  echo "";

?>

If you don't see anything then there's no data in your variable. Thus
the problem is not occuring during the outputting but of the data but
rather the point at which the data is assigned to the variable.


hth,
Chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse Error... how to fix?

2004-12-16 Thread Marek Kilimajer
GH wrote:
However, I can not get any results into the  tags all three
options are not displaying
$language is in global scope, you need:
function printHeader(){
  global $language;
More:
http://sk2.php.net/manual/en/language.variables.scope.php


On Thu, 16 Dec 2004 13:03:57 -0500, GH <[EMAIL PROTECTED]> wrote:
Ok... thank you.
On Thu, 16 Dec 2004 19:02:37 +0100, Marek Kilimajer <[EMAIL PROTECTED]> 
wrote:
GH wrote:
Hi All...
Got a problem...  here is the error: Parse error: parse error,
expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in
/var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42...  I
am not sure on how to fix it...
line 42 is: " $language['program_name'] \n" .
either one:
1. " $language[program_name] \n" .
2. " {$language['program_name']} \n" .
3. " ". $language['program_name'] ." \n" .


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: Re: [PHP] Parse Error... how to fix?

2004-12-16 Thread hitek
You are inside a function and not either passing the variable to the function 
or declaring it global within the function.
In other words, as far as your function is concerned, the 
$language['program_name'] is empty. 

> 
> From: GH <[EMAIL PROTECTED]>
> Date: 2004/12/16 Thu PM 01:09:48 EST
> To: Marek Kilimajer <[EMAIL PROTECTED]>
> CC: php-general <[EMAIL PROTECTED]>
> Subject: Re: [PHP] Parse Error... how to fix?
> 
> However, I can not get any results into the  tags all three
> options are not displaying
> 
> 
> On Thu, 16 Dec 2004 13:03:57 -0500, GH <[EMAIL PROTECTED]> wrote:
> > Ok... thank you.
> > 
> > 
> > On Thu, 16 Dec 2004 19:02:37 +0100, Marek Kilimajer <[EMAIL PROTECTED]> 
> > wrote:
> > > GH wrote:
> > > > Hi All...
> > > > Got a problem...  here is the error: Parse error: parse error,
> > > > expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in
> > > > /var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42...  I
> > > > am not sure on how to fix it...
> > > >
> > > > line 42 is: " $language['program_name'] \n" .
> > > >
> > >
> > > either one:
> > >
> > > 1. " $language[program_name] \n" .
> > >
> > > 2. " {$language['program_name']} \n" .
> > >
> > > 3. " ". $language['program_name'] ." \n" .
> > >
> >
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse Error... how to fix?

2004-12-16 Thread Matthew Sims
> Hi All...
> Got a problem...  here is the error: Parse error: parse error,
> expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in
> /var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42...  I
> am not sure on how to fix it...
>
> line 42 is: " $language['program_name'] \n" .

Try:

echo "".$language['program_name']."\n";

You need to concatenate your array.


-- 
--Matthew Sims
--

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse Error... how to fix?

2004-12-16 Thread Sam
GH wrote:
Hi All... 
Got a problem...  here is the error: Parse error: parse error,
expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in
/var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42...  I
am not sure on how to fix it...

line 42 is: " $language['program_name'] \n" .
The language.php file only has: $language['program_name'] = "AHRC
Computer Club Program Leader Information Managment";
Thank you for any and all assistance provided 

This is the entire ahrc_computerclub.php file:

# include language file
include_once("language.php");

#  DOCUMENT OUTPUT   ##START   #

printHeader();
echo $language['program_name'];
printFooter();

#  DOCUMENT OUTPUT   ##END #



#  FUNCTION DEFINITIONS SECTION#

function printVersion(){
$version = "0.1";
return $version;
}
function printHeader(){
 echo "
   "\"http://www.w3.org/TR/REC-html40/loose.dtd\";>\n" . 
   "\n" .
   "\n" .
   "\n" .
   "\n" .
   "
charset=iso-8859-1\">\n" .
   " $language['program_name'] \n" .
   "\n". 
   "\n";
}

function printFooter(){
 echo "\n";
}
?>
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Parse Error... how to fix?

2004-12-16 Thread Richard Lynch
GH wrote:
> Got a problem...  here is the error: Parse error: parse error,
> expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in
> /var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42...  I
> am not sure on how to fix it...
>
> line 42 is: " $language['program_name'] \n" .
>

>   echo " .

> " $language['program_name'] \n" .

#1. Get rid of the ''s around program_name.  Those won't work inside of ""s.
#2. Re-read the PHP on-line manual section on strings.
#3. Just break out of PHP for anything more than two lines of HTML.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse Error... how to fix?

2004-12-16 Thread Brian Dunning
line 42 is: " $language['program_name'] \n" .
Try:
''.$language['program_name'].'' 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Parse Error... how to fix?

2004-12-16 Thread GH
I will try this when i get back to my other computer where development
takes place the script format was originally started by an IDE
that I am starting to add my code to ... so I will look at.


On Thu, 16 Dec 2004 18:19:43 -, Ford, Mike <[EMAIL PROTECTED]> wrote:
> To view the terms under which this email is distributed, please go to 
> http://disclaimer.leedsmet.ac.uk/email.htm
> 
> 
> On 16 December 2004 17:39, GH wrote:
> 
> > Hi All...
> > Got a problem...  here is the error: Parse error: parse error,
> > expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in
> > /var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42...  I
> > am not sure on how to fix it...
> >
> > line 42 is: " $language['program_name'] \n" .
> 
> " {$language['program_name']} \n" .
> 
> But:
> 
> >
> > function printHeader(){
> >   echo " .
> > "\"http://www.w3.org/TR/REC-html40/loose.dtd\";>\n" .
> > "\n" .
> > "\n" .
> > "\n" .
> > "\n" .
> > " charset=iso-8859-1\">\n" .
> > " $language['program_name'] \n" .
> > "\n".
> > "\n";
> 
> This is messy and somewhat unreadable.  I would suggest either a heredoc:
> 
> function printHeader(){
>   echo <<  http://www.w3.org/TR/REC-html40/loose.dtd\";>
> 
> 
> 
> 
> 
> 
>  {$language['program_name']} 
> 
> 
> HEAD;
> }
> 
> or escaping from PHP into raw HTML:
> 
> function printHeader(){
> ?>
>  http://www.w3.org/TR/REC-html40/loose.dtd\";>
> 
> 
> 
> 
> 
> 
>   
> 
> 
>  }
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Parse Error... how to fix?

2004-12-16 Thread Ford, Mike
To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm



On 16 December 2004 17:39, GH wrote:

> Hi All...
> Got a problem...  here is the error: Parse error: parse error,
> expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in
> /var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42...  I
> am not sure on how to fix it...
> 
> line 42 is: " $language['program_name'] \n" .

" {$language['program_name']} \n" .

But:

> 
> function printHeader(){
>   echo " "\"http://www.w3.org/TR/REC-html40/loose.dtd\";>\n" . 
> "\n" .
> "\n" .
> "\n" .
> "\n" .
> "\n" .
> " $language['program_name'] \n" .
> "\n". 
> "\n";

This is messy and somewhat unreadable.  I would suggest either a heredoc:

function printHeader(){
  echo <






 {$language['program_name']} 


HEAD;
}

or escaping from PHP into raw HTML:

function printHeader(){
?>
http://www.w3.org/TR/REC-html40/loose.dtd\";>






  


http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Parse Error... how to fix?

2004-12-16 Thread GH
Hi All... 
Got a problem...  here is the error: Parse error: parse error,
expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in
/var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42...  I
am not sure on how to fix it...

line 42 is: " $language['program_name'] \n" .


The language.php file only has: $language['program_name'] = "AHRC
Computer Club Program Leader Information Managment";


Thank you for any and all assistance provided 

This is the entire ahrc_computerclub.php file:

http://www.w3.org/TR/REC-html40/loose.dtd\";>\n" . 
"\n" .
"\n" .
"\n" .
"\n" .
"\n" .
" $language['program_name'] \n" .
"\n". 
"\n";
}

function printFooter(){
  echo "\n";
}

?>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Parse Error... how to fix?

2004-12-16 Thread GH
However, I can not get any results into the  tags all three
options are not displaying


On Thu, 16 Dec 2004 13:03:57 -0500, GH <[EMAIL PROTECTED]> wrote:
> Ok... thank you.
> 
> 
> On Thu, 16 Dec 2004 19:02:37 +0100, Marek Kilimajer <[EMAIL PROTECTED]> wrote:
> > GH wrote:
> > > Hi All...
> > > Got a problem...  here is the error: Parse error: parse error,
> > > expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in
> > > /var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42...  I
> > > am not sure on how to fix it...
> > >
> > > line 42 is: " $language['program_name'] \n" .
> > >
> >
> > either one:
> >
> > 1. " $language[program_name] \n" .
> >
> > 2. " {$language['program_name']} \n" .
> >
> > 3. " ". $language['program_name'] ." \n" .
> >
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Parse Error... how to fix?

2004-12-16 Thread Marek Kilimajer
GH wrote:
Hi All... 
Got a problem...  here is the error: Parse error: parse error,
expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in
/var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42...  I
am not sure on how to fix it...

line 42 is: " $language['program_name'] \n" .
either one:
1. " $language[program_name] \n" .
2. " {$language['program_name']} \n" .
3. " ". $language['program_name'] ." \n" .
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Parse Error... how to fix?

2004-12-16 Thread GH
Ok... thank you.



On Thu, 16 Dec 2004 19:02:37 +0100, Marek Kilimajer <[EMAIL PROTECTED]> wrote:
> GH wrote:
> > Hi All...
> > Got a problem...  here is the error: Parse error: parse error,
> > expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in
> > /var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42...  I
> > am not sure on how to fix it...
> >
> > line 42 is: " $language['program_name'] \n" .
> >
> 
> either one:
> 
> 1. " $language[program_name] \n" .
> 
> 2. " {$language['program_name']} \n" .
> 
> 3. " ". $language['program_name'] ." \n" .
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] PARSE ERROR, unexpected T_$VARIABLE

2004-12-06 Thread Ford, Mike
To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm



On 06 December 2004 17:23, Greg Donald wrote:

> On Mon, 06 Dec 2004 11:54:50 -0500, Robert Sossomon
> <[EMAIL PROTECTED]> wrote:
> > Parse error: parse error, expecting `T_VARIABLE' or `'$'' in
> > c:\fourh\leadership\registration_post.php on line 29
> > 
> > for ($i=0; $i < count($choices); $i++)
> 
> This is bad.  Every time the for() loop iterates, the count() function
> gets called again unnecessarily.  Better to do:
> 
> $count = count( $choices );
> for ($i=0; $i < $count; $i++)

You can even do (keeping all the loop-related stuff within the for( )
construct):

   for ($i=0, $count=count($choices); $i < $count; $i++)

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PARSE ERROR, unexpected T_$VARIABLE

2004-12-06 Thread Greg Donald
On Mon, 06 Dec 2004 11:54:50 -0500, Robert Sossomon
<[EMAIL PROTECTED]> wrote:
> Parse error: parse error, expecting `T_VARIABLE' or `'$'' in
> c:\fourh\leadership\registration_post.php on line 29
> 
> for ($i=0; $i < count($choices); $i++)

This is bad.  Every time the for() loop iterates, the count() function
gets called again unnecessarily.  Better to do:

$count = count( $choices );
for ($i=0; $i < $count; $i++)

> {
>   $value = $choices[$i];
>   $tempChoice = "choice" . $j;
>   $$tempChoice = $value;
>   $j++;
> }
> 
> $0405distoffice= $_POST['04_05_dist_office'];  //line29

Variables can contain numbers, but the first character after the $
must not be one.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PARSE ERROR, unexpected T_$VARIABLE

2004-12-06 Thread Richard Lynch
Variable names cannot start with a digit.

$distoffice0405 is kosher.
$0405distoffice is not.

Robert Sossomon wrote:
> Parse error: parse error, expecting `T_VARIABLE' or `'$'' in
> c:\fourh\leadership\registration_post.php on line 29
>
> The HTML page:
> http://rsossam-lap.ces.ncsu.edu/leadership/registration2.php
>
> The processing Script
> 
>
> 
> $fname= $_POST[fname];
> $lname= $_POST[lname];
> $addie= $_POST[addie];
> $city= $_POST[city];
> $state= $_POST[state];
> $zip= $_POST[zip];
> $county= $_POST[county];
> $dphone= $_POST[dphone];
> $ephone= $_POST[ephone];
> $email= $_POST[email];
> $first_conf= $_POST[first_conf];
> $payment= $_POST[payment];
> $PreConference= $_POST['PreConference'];
> $Conference= $_POST['Conference'];
>
> $choices = $_POST['choice'];
> array_splice($choices,4);
> $j=1;
> for ($i=0; $i < count($choices); $i++)
> {
>   $value = $choices[$i];
>   $tempChoice = "choice" . $j;
>   $$tempChoice = $value;
>   $j++;
> }
>
> $0405distoffice= $_POST['04_05_dist_office'];  //line29
> $0506distoffice= $_POST['05_06_dist_office'];
> $former= $_POST[former];
> $achieve= $_POST[achieve];
>
>
> ?>
> 
>
> I pulled out the iterations above that line of code and tested it
> separately.
> Everything worked OK, so I copied it into the rest of the PHP processing.
>
> This thing is driving me bonkers.  Any suggestions?
>
> --
> Robert Sossomon, Business and Technology Application Technician
> 4-H Youth Development Department
> 200 Ricks Hall, Campus Box 7606
> N.C. State University
> Raleigh NC 27695-7606
> Phone: 919/515-8474
> Fax:   919/515-7812
> [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PARSE ERROR, unexpected T_$VARIABLE

2004-12-06 Thread John Holmes
Robert Sossomon wrote:
Parse error: parse error, expecting `T_VARIABLE' or `'$'' in 
c:\fourh\leadership\registration_post.php on line 29
[snip]
$0405distoffice= $_POST['04_05_dist_office'];  //line29
$0506distoffice= $_POST['05_06_dist_office'];
Variable names cannot start with a number.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PARSE ERROR, unexpected T_$VARIABLE

2004-12-06 Thread John Nichel
Robert Sossomon wrote:
Parse error: parse error, expecting `T_VARIABLE' or `'$'' in 
c:\fourh\leadership\registration_post.php on line 29

$0405distoffice= $_POST['04_05_dist_office'];  //line29
$0506distoffice= $_POST['05_06_dist_office'];

Look in the manual, that's your first stop...
http://us4.php.net/manual/en/language.variables.php
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PARSE ERROR, unexpected T_$VARIABLE

2004-12-06 Thread Thomas Munz
you forgot the " ' " in the 


$fname= $_POST[fname];
$lname= $_POST[lname];
$addie= $_POST[addie];
$city= $_POST[city];

fields!!!

> error, expecting `T_VARIABLE' or `'$'' in 
> c:\fourh\leadership\registration_post.php on line 29
>
> The HTML page:
> http://rsossam-lap.ces.ncsu.edu/leadership/registration2.php
>
> The processing Script
> 
>
> 
> $fname= $_POST[fname];
> $lname= $_POST[lname];
> $addie= $_POST[addie];
> $city= $_POST[city];
> $state= $_POST[state];
> $zip= $_POST[zip];
> $county= $_POST[county];
> $dphone= $_POST[dphone];
> $ephone= $_POST[ephone];
> $email= $_POST[email];
> $first_conf= $_POST[first_conf];
> $payment= $_POST[payment];
> $PreConference= $_POST['PreConference'];
> $Conference= $_POST['Conference'];
>
> $choices = $_POST['choice'];
> array_splice($choices,4);
> $j=1;
> for ($i=0; $i < count($choices); $i++)
> {
>   $value = $choices[$i];
>   $tempChoice = "choice" . $j;
>   $$tempChoice = $value;
>   $j++;
> }
>
> $0405distoffice= $_POST['04_05_dist_office'];  //line29
> $0506distoffice= $_POST['05_06_dist_office'];
> $former= $_POST[former];
> $achieve= $_POST[achieve];
>
>
> ?>
> 
>
> I pulled out the iterations above that line of code and tested it
> separately. Everything worked OK, so I copied it into the rest of the PHP
> processing.
>
> This thing is driving me bonkers.  Any suggestions?
>
> --
> Robert Sossomon, Business and Technology Application Technician
> 4-H Youth Development Department
> 200 Ricks Hall, Campus Box 7606
> N.C. State University
> Raleigh NC 27695-7606
> Phone: 919/515-8474
> Fax:   919/515-7812
> [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



  1   2   3   4   >