Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Wrox Announcements and Feedback > All Other Wrox Books
|
All Other Wrox Books Do you have a question about a Wrox book that isn't listed anywhere on p2p.wrox.com or where the forum is locked? Here's a forum to post questions about any other Wrox book so that other readers or one of the authors can help you with your questions. IF YOU ARE LOOKING FOR CODE DO NOT ASK "Where can I find the code for this book?" That question is answered here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the All Other Wrox Books section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 27th, 2003, 10:04 AM
Registered User
 
Join Date: Jul 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Professional PHP4 - Ch10 Coding Ftp Client Errors

Get the following error when trying run the code out of the box:

Parse error: parse error, unexpected ',' in /home/jberry/html/ftp/ftp_client.php on line 293


Below is line 293-294

293 echo("<option value=\"{$ftp->cwd}\"> . ({$ftp->cwd})</option>\n",
294 "<option value=\"{$ftp->cwd}/..\"> .. </option>\n");


If i remove the comma, it give a similar error, referencing and unexpected "/" in 294.

any ideas?

  #2 (permalink)  
Old January 11th, 2004, 03:23 AM
Registered User
 
Join Date: Jan 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to visor
Default

Quote:
quote:Originally posted by ajberry_12
 Get the following error when trying run the code out of the box:

Parse error: parse error, unexpected ',' in /home/jberry/html/ftp/ftp_client.php on line 293


Below is line 293-294

293 echo("<option value=\"{$ftp->cwd}\"> . ({$ftp->cwd})</option>\n",
294 "<option value=\"{$ftp->cwd}/..\"> .. </option>\n");


If i remove the comma, it give a similar error, referencing and unexpected "/" in 294.

any ideas?

try
293 echo("<option value=\"{$ftp->cwd}\"> . ({$ftp->cwd})</option>\n"[u].</u>
294 "<option value=\"{$ftp->cwd}/..\"> .. </option>\n");


  #3 (permalink)  
Old January 13th, 2004, 12:35 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

What you're doing is right but the syntax is a bit off.

The blueprint for echo is as follows:

echo [expression[, expression[, expression[, ...]]]]

So this being the case the following will work

<?php

// parenthesis are optional with echo.
// Works

echo "Hello, ", "world!";

// If you do include parenthesis, then this is the syntax
// Works

echo ("Hello, "), ("world");

// OR

echo ("Hello, "),
     ("world!");

// Echo isn't a function, but a language construct, and as per the blue print above
// This won't work

echo ("Hello, ", "world!");

?>

http://www.php.net/echo

: )
Rich

:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::





Similar Threads
Thread Thread Starter Forum Replies Last Post
code for professional php4 multimedia programming? netpresent Wrox Book Feedback 1 February 9th, 2005 10:44 PM
Professional PHP4 agarios All Other Wrox Books 6 January 14th, 2005 02:50 PM
Multi Select List Box Coding Errors... snoopy92211 VB Databases Basics 10 June 30th, 2004 08:33 AM
Errors in the book @ ch10 freezotic BOOK: Beginning Java 2 0 March 26th, 2004 04:54 PM
where is Professional PHP4 XML Source Code dreamery Wrox Book Feedback 3 January 27th, 2004 04:16 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.