Re: [PHP] Using the echo tag...

2005-11-09 Thread Paul Williams

?php

print EOF

HTML
$_SERVER['PHP_SELF']
/HTML
EOF;

?

Here's the coding and the error for it was this:


 Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE,
 expecting
 T_STRING or T_VARIABLE or T_NUM_STRING in C:\Program Files\Abyss Web
 Server\htdocs\document1.php on line 6
 



Thank you.
Sincerely,


Paul Lee Williams III






From: Richard Lynch [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: Paul Williams [EMAIL PROTECTED]
CC: php-general@lists.php.net
Subject: Re: [PHP] Using the echo tag...
Date: Tue, 8 Nov 2005 19:25:12 -0600 (CST)
MIME-Version: 1.0
Received: from o2.hostbaby.com ([67.139.134.202]) by mc5-f37.hotmail.com 
with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Nov 2005 17:25:08 -0800

Received: (qmail 79084 invoked by uid 98); 9 Nov 2005 01:25:13 -
Received: from 127.0.0.1 by o2.hostbaby.com (envelope-from [EMAIL PROTECTED], 
uid 1013) with qmail-scanner-1.25  (clamdscan: 0.70-rc.   
Clear:RC:1(127.0.0.1):.  Processed in 0.157818 secs); 09 Nov 2005 01:25:13 
-
Received: from unknown (HELO l-i-e.com) (127.0.0.1)  by localhost with 
SMTP; 9 Nov 2005 01:25:12 -
Received: from 67.108.68.36(SquirrelMail authenticated user 
[EMAIL PROTECTED])by www.l-i-e.com with HTTP;Tue, 8 Nov 2005 
19:25:12 -0600 (CST)

X-Message-Info: JGTYoYF78jEHjJx36Oi8+Z3TmmkSEdPtfpLB7P/ybN8=
X-Qmail-Scanner-Mail-From: [EMAIL PROTECTED] via o2.hostbaby.com
X-Qmail-Scanner: 1.25 (Clear:RC:1(127.0.0.1):. Processed in 0.157818 secs)
References: [EMAIL PROTECTED]
[EMAIL PROTECTED]

User-Agent: Hostbaby Webmail
Return-Path: [EMAIL PROTECTED]
X-OriginalArrivalTime: 09 Nov 2005 01:25:09.0224 (UTC) 
FILETIME=[6C5A3680:01C5E4CC]


On Tue, November 8, 2005 5:32 pm, Paul Williams wrote:
 Nope sorry. It says this error 
 Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE,
 expecting
 T_STRING or T_VARIABLE or T_NUM_STRING in C:\Program Files\Abyss Web
 Server\htdocs\document1.php on line 6
 

Show us EXACTLY what you have in lines 1 through 6.

Not just sorta.

Copy-n-paste it.

Or put it up on the web as TEXT output.

Odds are pretty good your real mistake is in line 5 or even before that.

--
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] Using the echo tag...

2005-11-09 Thread Ben Ramsey

On 11/9/05 9:45 AM, Paul Williams wrote:

?php

print EOF

HTML
$_SERVER['PHP_SELF']
/HTML
EOF;

?


Try it with curly braces:

?php

print EOF

HTML
{$_SERVER['PHP_SELF']}
/HTML
EOF;

?

--
Ben Ramsey
http://benramsey.com/

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



Re: [PHP] Using the echo tag...

2005-11-09 Thread Paul Williams
Alright cool that one worked. Do I have to include the curly braces in all 
calls to variables or just the superglobals?




Thank you.
Sincerely,


Paul Lee Williams III






From: Ben Ramsey [EMAIL PROTECTED]
To: php-general@lists.php.net,Paul Williams [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re: [PHP] Using the echo tag...
Date: Wed, 09 Nov 2005 09:48:52 -0500
MIME-Version: 1.0
Received: from lists.php.net ([216.92.131.4]) by mc10-f41.hotmail.com with 
Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Nov 2005 06:48:57 -0800
Received: from ([69.164.218.60:21029] helo=localhost.localdomain)by 
pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTPid 16/ED-28724-75C02734 
for [EMAIL PROTECTED]; Wed, 09 Nov 2005 09:48:55 -0500

X-Message-Info: JGTYoYF78jEHjJx36Oi8+Z3TmmkSEdPtfpLB7P/ybN8=
Return-Path: [EMAIL PROTECTED]
X-Host-Fingerprint: 69.164.218.60 
eycb01-00-cntnga-69-164-218-60.atlaga.adelphia.net  User-Agent: Mozilla 
Thunderbird 1.0.6 (Macintosh/20050716)

X-Accept-Language: en-us, en
References: [EMAIL PROTECTED] 
[EMAIL PROTECTED]

X-Posted-By: 69.164.218.60
X-OriginalArrivalTime: 09 Nov 2005 14:48:57.0698 (UTC) 
FILETIME=[B6C35420:01C5E53C]


On 11/9/05 9:45 AM, Paul Williams wrote:

?php

print EOF

HTML
$_SERVER['PHP_SELF']
/HTML
EOF;

?


Try it with curly braces:

?php

print EOF

HTML
{$_SERVER['PHP_SELF']}
/HTML
EOF;

?

--
Ben Ramsey
http://benramsey.com/


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



Re: [PHP] Using the echo tag...

2005-11-09 Thread Ben Ramsey

On 11/9/05 9:51 AM, Paul Williams wrote:
Alright cool that one worked. Do I have to include the curly braces in 
all calls to variables or just the superglobals?


It's not a superglobal issue; it's an array issue -- or, rather, it's an 
issue with using quotation marks. You could have also done it this way:


?php

print EOF

HTML
$_SERVER[PHP_SELF]
/HTML
EOF;

?

Personally, I put curly braces around all interpolated variables because 
it makes it easier for me to read and see the variables, but this is 
really up to user preference.


--
Ben Ramsey
http://benramsey.com/

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



Re: [PHP] Using the echo tag...

2005-11-09 Thread Ben Ramsey

On 11/9/05 10:03 AM, Paul Williams wrote:
So would it be acceptable if I used curly braces on all variables 
(whether superglobals or not) in a here document?


Yes.

--
Ben Ramsey
http://benramsey.com/

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



Re: [PHP] Using the echo tag...

2005-11-08 Thread Richard Lynch
On Mon, November 7, 2005 11:31 am, Paul Williams wrote:
 I'm relatively new at coding PHP but I was hoping someone can help me
 with
 this.



 I'm trying to write the following code into my program but each time
 it
 runs, I get an error message. Can anyone help?



 print  EOF

You've got one too many 's in there...

print EOF

 !-INSERT HTML HEADER HERE --

 $_SERVER['PHP_SELF']



 EOF;

This MUST be in the far left column to work reliably, with no
preceding spaces or tabs.

Can't tell for sure from email if you did that.

-- 
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] Using the echo tag...

2005-11-08 Thread Paul Williams

Nope sorry. It says this error 
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting 
T_STRING or T_VARIABLE or T_NUM_STRING in C:\Program Files\Abyss Web 
Server\htdocs\document1.php on line 6





Thank you.
Sincerely,


Paul Lee Williams III






From: Richard Lynch [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: Paul Williams [EMAIL PROTECTED]
CC: php-general@lists.php.net
Subject: Re: [PHP] Using the echo tag...
Date: Tue, 8 Nov 2005 17:19:58 -0600 (CST)
MIME-Version: 1.0
Received: from o2.hostbaby.com ([67.139.134.202]) by mc10-f11.hotmail.com 
with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Nov 2005 15:19:55 -0800

Received: (qmail 74135 invoked by uid 98); 8 Nov 2005 23:19:58 -
Received: from 127.0.0.1 by o2.hostbaby.com (envelope-from [EMAIL PROTECTED], 
uid 1013) with qmail-scanner-1.25  (clamdscan: 0.70-rc.   
Clear:RC:1(127.0.0.1):.  Processed in 0.054912 secs); 08 Nov 2005 23:19:58 
-
Received: from unknown (HELO l-i-e.com) (127.0.0.1)  by localhost with 
SMTP; 8 Nov 2005 23:19:58 -
Received: from 67.108.68.36(SquirrelMail authenticated user 
[EMAIL PROTECTED])by www.l-i-e.com with HTTP;Tue, 8 Nov 2005 
17:19:58 -0600 (CST)

X-Message-Info: JGTYoYF78jGe2OTt/258Mnhj9SOv7kuEj53AasWhSQM=
X-Qmail-Scanner-Mail-From: [EMAIL PROTECTED] via o2.hostbaby.com
X-Qmail-Scanner: 1.25 (Clear:RC:1(127.0.0.1):. Processed in 0.054912 secs)
References: [EMAIL PROTECTED]
User-Agent: Hostbaby Webmail
Return-Path: [EMAIL PROTECTED]
X-OriginalArrivalTime: 08 Nov 2005 23:19:55.0431 (UTC) 
FILETIME=[EDC86370:01C5E4BA]


On Mon, November 7, 2005 11:31 am, Paul Williams wrote:
 I'm relatively new at coding PHP but I was hoping someone can help me
 with
 this.



 I'm trying to write the following code into my program but each time
 it
 runs, I get an error message. Can anyone help?



 print  EOF

You've got one too many 's in there...

print EOF

 !-INSERT HTML HEADER HERE --

 $_SERVER['PHP_SELF']



 EOF;

This MUST be in the far left column to work reliably, with no
preceding spaces or tabs.

Can't tell for sure from email if you did that.

--
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] Using the echo tag...

2005-11-08 Thread Curt Zirzow
On Tue, Nov 08, 2005 at 06:32:00PM -0500, Paul Williams wrote:
 Nope sorry. It says this error 
 Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting 
 T_STRING or T_VARIABLE or T_NUM_STRING in C:\Program Files\Abyss Web 
 Server\htdocs\document1.php on line 6
 

Acutally he is correct. You have another problem of which was
mentioned a few times in this thread as well. 

You have to enclose your array variable like such:

print EOF
   {$array['key']}
EOF;


See why here:
  http://php.net/string

 

 
 From: Richard Lynch [EMAIL PROTECTED]
  ...
 
 On Mon, November 7, 2005 11:31 am, Paul Williams wrote:
  ...
 
 
  print  EOF
 
 You've got one too many 's in there...
 
 print EOF
 


Curt.
-- 

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



Re: [PHP] Using the echo tag...

2005-11-08 Thread Richard Lynch
On Tue, November 8, 2005 5:32 pm, Paul Williams wrote:
 Nope sorry. It says this error 
 Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE,
 expecting
 T_STRING or T_VARIABLE or T_NUM_STRING in C:\Program Files\Abyss Web
 Server\htdocs\document1.php on line 6
 

Show us EXACTLY what you have in lines 1 through 6.

Not just sorta.

Copy-n-paste it.

Or put it up on the web as TEXT output.

Odds are pretty good your real mistake is in line 5 or even before that.

-- 
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] Using the echo tag...

2005-11-08 Thread Richard Lynch
On Tue, November 8, 2005 5:52 pm, Curt Zirzow wrote:
 On Tue, Nov 08, 2005 at 06:32:00PM -0500, Paul Williams wrote:
 Nope sorry. It says this error 
 Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE,
 expecting
 T_STRING or T_VARIABLE or T_NUM_STRING in C:\Program Files\Abyss Web
 Server\htdocs\document1.php on line 6
 

 Acutally he is correct. You have another problem of which was
 mentioned a few times in this thread as well.

 You have to enclose your array variable like such:

 print EOF
{$array['key']}
 EOF;

Another option on that bit is to take OUT the 's around the key.

In PHP ?php code ? you need 's around the key.
In a string you do NOT want the 's around the key.

It seems goofy at first, but that's the way it is.

So instead of using {}s so you can also have ''s you can just get RID
of the ''s in the first place.

-- 
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] Using the echo tag...

2005-11-07 Thread Pablo Gosse
[snip]
I'm relatively new at coding PHP but I was hoping someone can help me
with
this.

I'm trying to write the following code into my program but each time it
runs, I get an error message. Can anyone help?

print  EOF
!-INSERT HTML HEADER HERE --
$_SERVER['PHP_SELF']
EOF;

Say that was a part of a HTML Form action tag, everytime I try to run
it, I
get an error message am I doing something wrong or do I have to break
out of
the here document to use this syntax?
[/snip]

What's the error message you're getting?  That will be most helpful in
trying to diagnose the problem.

Likely, though, is the fact that you're trying to output
$_SERVER['PHP_SELF'] within your heredoc syntax, without wrapping it in
curly braces.

It should be:

{$_SERVER['PHP_SELF']}

See
http://www.php.net/manual/en/language.types.string.php#language.types.st
ring.syntax.heredoc for more info.

Cheers,

Pablo

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



Re: [PHP] Using the echo tag...

2005-11-07 Thread Curt Zirzow
* Paul Williams [EMAIL PROTECTED] [2005-11-07 12:31:17 -0500]:

 I'm trying to write the following code into my program but each time it
 runs, I get an error message. Can anyone help?
 
  
 
 print  EOF
 
  
 
 !-INSERT HTML HEADER HERE --
 
 $_SERVER['PHP_SELF']
 
  
 
 EOF;

You might want to read up on the heredoc syntax:
  http://php.net/heredoc


Curt
-- 

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



Re: [PHP] Using the echo tag...

2005-11-07 Thread Unknown Unknown
you only need 3 

On 11/7/05, Curt Zirzow [EMAIL PROTECTED] wrote:

 * Paul Williams [EMAIL PROTECTED] [2005-11-07 12:31:17 -0500]:

  I'm trying to write the following code into my program but each time it
  runs, I get an error message. Can anyone help?
 
 
 
  print  EOF
 
 
 
  !-INSERT HTML HEADER HERE --
 
  $_SERVER['PHP_SELF']
 
 
 
  EOF;

 You might want to read up on the heredoc syntax:
 http://php.net/heredoc


 Curt
 --

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




Re: [PHP] Using the echo tag...

2005-11-07 Thread Curt Zirzow
On Mon, Nov 07, 2005 at 09:40:23PM -0500, Unknown Unknown wrote:
 you only need 3 

Indeed, as well as Pablo's guess of escaping an array within a
heredoc, and i would guess as well that that space between his '
EOF' is invalid as well.

Btw, you do realize your name is 'Unknown Unknown'?


Curt
-- 

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