 |
BOOK: Dreamweaver MX: PHP Web Development  | This is the forum to discuss the Wrox book Dreamweaver MX: PHP Web Development by Gareth Downes-Powell, Tim Green, Bruno Mairlot; ISBN: 9780764543876 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Dreamweaver MX: PHP Web Development 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
|
|
|
|

December 3rd, 2003, 04:54 PM
|
|
Registered User
|
|
Join Date: Dec 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Parse Error with change_booking_details.php
I've completed all the files in the Hotel Registration project including the change_booking_details.php file and am now testing from the beginning of the booking process. The correct booking shows up in confirm_booking.php but when I try to make a correction, I get this message:
Parse error: parse error, unexpected '[' in c:\program files\apache group\apache\htdocs\karen\dreamweaverhotel\booking s2\change_booking_details.php on line 50
My code looks like this:
mysql_select_db($database_dreamweaverhotel, $dreamweaverhotel);
$Result1 = mysql_query($updateSQL, $dreamweaverhotel) or die(mysql_error());
$updateGoTo = "booking_updated.php? ID=" . HTTP_POST_VARS['bookingID'] . "&clientID=" . HTTP_POST_VARS['clientID'] . "";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
with line 50 at the $updateGoTo.
The book on p. 145 has instructions for putting a submit button in the form but the illustration on the next page has a link. I've tried it both ways but still get the same error message.
My questions: What is going on here and do I need to make changes in the code that's offered in the book?
Thanks,
|
|

December 4th, 2003, 01:09 AM
|
|
Registered User
|
|
Join Date: Dec 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thank you, Nik! I typed in the update record parameters from the screenshot on p. 155 which doesn't have the $ in front of the variables. In the text the author does include the $, though.
I did not delete the $HTTP_ in front of my variables however. The page seems to be working just fine with them included. In fact, all the php files from Ch. 6 are working beautifully.
Now I'm going to really work on PHP basics -- Dreamweaver is ok but it seems to write buggy code lots of times.
Karen
|
|

December 4th, 2003, 01:07 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I highly recommend you DO change $HTTP_xxxx_VARS to $_xxxx -- the old style variables ($HTTP_xxx_VARS) have been deprecated since PHP version 4.1.0, having been replaced by the $_xxxx versions.
By explicitly keeping the old-style variables in your code, you run the risk of having your code NOT work on future versions of PHP. PHP5 is just around the corner, and while the first versions might still support HTTP_xxx_VARS, the PHP guys aren't required to continue supporting it.
Take care,
Nik
http://www.bigaction.org/
|
|

August 20th, 2004, 01:55 PM
|
|
Registered User
|
|
Join Date: Aug 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
i cannot get Chapter 6 code to work, regardless of what I do. Do you have the code, please, so I can reference mine. I'm using php 4.3.8 + am totally stuck. Help!!!!!!!
|
|

August 23rd, 2004, 08:48 AM
|
|
Registered User
|
|
Join Date: Aug 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Nicolai,
I agree we should use the later style variables.
However we cant get the code working from the book with either version.
On page 203 the author says
"In the newest versions of PHP, 4.1 and above, these arrays have been deprecated in favor of the following arrays $_POST and $_GET. However, this syntax is not available on servers with older versions of the PHP scripting engine - SO WE WONT USE IT"
Can you help us contact the authors to advise us in this forum?
Regards
RinseBouy
|
|
 |