PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old September 17th, 2004, 03:23 PM
andrewc andrewc is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 4 andrewc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Arrow Parse error: unexpected T_STRING??Advice Please!

Hi all

I have run a simple "hello world" test include script and it worked! I got "Hello World" printed on the browser screen....
This is good from a point of knowing includes do work but BAD from not knowing what the problem is causing my script not to work!
When I run my script I get this exact message

Parse error. Parse error, unexpected T_STRING in C:\www\webroot\phpauctionXL\includes\config.inc.ph p on line 28

The extract below is out of my config.inc.php and I have used three >>> to highlight line 28 starting $image_upload_path...
Can anyone see anything wrong with these paths?? That is the "absolute" path to the dir but I am unsure if I may have put it wrong somehow?I am baffled!! ps/I have Windows XP, PHP 4.3.8, Apache 2.0.5, Php myadmin etc
Any help from anyone gratefully received......
////start of extract from config.inc.php

//-- This is the directory where passwd.inc.php file resides - requires ending slash

$include_path = "C:\www\webroot\includes\";

//-- This is the directory where users pictures will be uploaded - requires ending slash
//-- Under Windows use something like C:\path\to\you\uploaddir\

>>> $image_upload_path= "C:\www\webroot\phpauctionXL\uploaded\";
$uploaded_path = "uploaded\";

////end of extract



Thankyou in advance

Reply With Quote
  #2  
Old September 18th, 2004, 03:00 AM
oyejorge oyejorge is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 25 oyejorge User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 13 sec
Reputation Power: 0
With strings, the backslash is used to escape special characters like quotation marks.
Because of the backslash preceding the end quote, php thinks the string is still open
$include_path = "C:\www\webroot\includes\";

In any event, I would change all file path backslashes to forwardslashes.
Reason being,
- php won't confuse them as escape characters
- Unix based systems use forwardslashes for file paths
- Windows uses both forward and back

Reply With Quote
  #3  
Old September 18th, 2004, 02:14 PM
andrewc andrewc is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 4 andrewc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by oyejorge
With strings, the backslash is used to escape special characters like quotation marks.
Because of the backslash preceding the end quote, php thinks the string is still open
$include_path = "C:\www\webroot\includes\";

In any event, I would change all file path backslashes to forwardslashes.
Reason being,
- php won't confuse them as escape characters
- Unix based systems use forwardslashes for file paths
- Windows uses both forward and back


Thanks for that info oyegeorge. I will change all paths to that format and post back..
Also, will a double // effectively cancel out the escape character??

TIA

Reply With Quote
  #4  
Old September 20th, 2004, 11:13 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 4 m 48 sec
Reputation Power: 8
You could use either forward slashes, or double blackslashes...

I'm pretty sure your particular error is because of the final backslash and closing quote... telling PHP to ignore the quote.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Parse error: unexpected T_STRING??Advice Please!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway