Re: [PHP] How New Is HERE?
By comment[ing] out line 11, I take it you mean making a comment of line 11. I just did--as this problem woke me from a night's sleep at just past 2:30 AM--and the error message is now: Parse error: parse error, unexpected $ in [path to file] on line 19 Where will this end? Steve Original Message: - From: Olwen Williams [EMAIL PROTECTED] Date: Sat, 27 Dec 2003 18:25:00 +1300 To: [EMAIL PROTECTED] Subject: Re: [PHP] How New Is HERE? Comment out line 11 to checkj it's the cause of the proble. If the error goes away then retype the line. I just tested this code and got no errors. It could be a character that is not what it seems. [EMAIL PROTECTED] wrote: Cesar, Sorry to have taken so long to answer. My day got complicated. Anyway, here's the code all over again, with the last changes I was advised to make. I took out the line spaces and added line numbers. But first, the latest error message: Parse error: parse error, unexpected T_VARIABLE in [path to file] on line 11 The code: 1 html 2 head 3 title 4 persistence demo 5 /title 6 /head 7 body 8 h1Persistence Demo/h1 9 form 10 ?php 11 $txtBoxCounter = $_POST['txtBoxCounter']; -- Olwen Williams See my BB site http://www.bandbclub.com and my new site http://www.handyman.co.nz - A virtual shed for real kiwi blokes. mail2web - Check your email from the web at http://mail2web.com/ . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How New Is HERE?
Interesting that it's the same variable on both lines. The second error would not show untill the first disappeared. Would you have copied and pasted some of the line? I'm still for retyping the lines in case there's something odd lurking in there and not visible. [EMAIL PROTECTED] wrote: By comment[ing] out line 11, I take it you mean making a comment of line 11. I just did--as this problem woke me from a night's sleep at just past 2:30 AM--and the error message is now: Parse error: parse error, unexpected $ in [path to file] on line 19 Where will this end? Steve Original Message: - From: Olwen Williams [EMAIL PROTECTED] Date: Sat, 27 Dec 2003 18:25:00 +1300 To: [EMAIL PROTECTED] Subject: Re: [PHP] How New Is HERE? Comment out line 11 to checkj it's the cause of the proble. If the error goes away then retype the line. I just tested this code and got no errors. It could be a character that is not what it seems. [EMAIL PROTECTED] wrote: Cesar, Sorry to have taken so long to answer. My day got complicated. Anyway, here's the code all over again, with the last changes I was advised to make. I took out the line spaces and added line numbers. But first, the latest error message: Parse error: parse error, unexpected T_VARIABLE in [path to file] on line 11 The code: 1 html 2 head 3 title 4 persistence demo 5 /title 6 /head 7 body 8 h1Persistence Demo/h1 9 form 10 ?php 11 $txtBoxCounter = $_POST['txtBoxCounter']; -- Olwen Williams See my BB site http://www.bandbclub.com and my new site http://www.handyman.co.nz - A virtual shed for real kiwi blokes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How New Is HERE?
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Saturday, 27 December 2003 20:56 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] How New Is HERE? By comment[ing] out line 11, I take it you mean making a comment of line 11. I just did--as this problem woke me from a night's sleep at just past 2:30 AM--and the error message is now: Parse error: parse error, unexpected $ in [path to file] on line 19 Where will this end? Steve Original Message: - From: Olwen Williams [EMAIL PROTECTED] Date: Sat, 27 Dec 2003 18:25:00 +1300 To: [EMAIL PROTECTED] Subject: Re: [PHP] How New Is HERE? Comment out line 11 to checkj it's the cause of the proble. If the error goes away then retype the line. I just tested this code and got no errors. It could be a character that is not what it seems. [EMAIL PROTECTED] wrote: Cesar, Sorry to have taken so long to answer. My day got complicated. Anyway, here's the code all over again, with the last changes I was advised to make. I took out the line spaces and added line numbers. But first, the latest error message: Parse error: parse error, unexpected T_VARIABLE in [path to file] on line 11 The code: 1 html 2 head 3 title 4 persistence demo 5 /title 6 /head 7 body 8 h1Persistence Demo/h1 9 form 10 ?php 11 $txtBoxCounter = $_POST['txtBoxCounter']; -- For what it is worth, I cut and pasted your full html into a file. Under PHP version 4.3.1 It runs from the command line without fault. Apache 1.3.22 It runs without fault (increments properly). What text editor are you using? I saved the code as both Unix and DOS format and it works for both. I've attached my file for you to try. Hope it helps as I can't fault the code. Regards Grant Walters Brainbench 'Most Valuable Professional' for Unix Admin Walters Associates, P O Box 13-043 Johnsonville, Wellington, NEW ZEALAND Telephone: +64 4 4765175 OR 4762661, CellPhone 025488265, ICQ# 23511989 Never argue with an idiot. They drag you down to their level, then beat you with experience. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How New Is HERE?
Steve -- From your private reply to me, we know that ripping out the HERE stuff makes no difference, so it has nothing to do with that. I would also be inclined to rip out all of the bare HTML to make sure you don't have anything funky in there, too, especially since it comes before the error. ...and then [EMAIL PROTECTED] said... % % By comment[ing] out line 11, I take it you mean making a comment of line % 11. I just did--as this problem woke me from a night's sleep at just past % 2:30 AM--and the error message is now: OK; there is obviously some problem with line 11. Since it reads fine for us and runs when we try it, it must be in your actual code. The next things I would try are - if the original file is short, zip it up and attach it, or else make it available for download, so that we can see the *real* thing - insert before and after line 11 an innocuous print testing\n; statement, and then break the line around the = so it becomes three lines and see where the parse error ends up [Oh, and uncomment the line, of course.] % % Parse error: parse error, unexpected $ in [path to file] on line 19 We'll get to that later. Now that we know that there is a problem with line 11, let's fix it first. % % Where will this end? At the error(s), of course :-) % % Steve HTH HAND Happy Holidays :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP] How New Is HERE?
Okay, everyone, here's some real progress. I retyped the file from scratch. I'm both attaching it--it's not a big file--and printing it below: html head titlepersistence demo/title /head body h1Persistence Demo/h1 form ?php $txtBoxCounter = $_POST['txtBoxCounter']; $hdnCounter = $_POST['hdnCounter']; //increment the counters $txtBoxCounter++; $hdnCounter++; print HERE input type = text name = txtBoxCounter value = $txtBoxCounter input type = hidden name = hdnCounter value = $hdnCounter h3The hidden value is $hdnCounter/h3 input type = submit value = click to increment counters HERE; ? /form /body /html My results were mixed, but definitely moved me forward. The H1 head--Persistence Demo--displayed, as did a field with the number 1 in it. After a blank line was printed The hidden value is 1. That was followed by another blank line space, and then a button with click to increment counters in it. When I click the button, I get a box dropping down that says the info I've entered is to be sent over an unencrypted connection and could be read by others, and do I still want to send it. I click Continue, and that box disappears. There ends my success. I'm left with: The H1 head--Persistence Demo--displayed, and the number 1 in it. The blank line followed by The hidden value is 1. The other blank line space, and then the button with click to increment counters in it. No seeming advance to the counters. Whattaya think? Steve Tiano mail2web - Check your email from the web at http://mail2web.com/ . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How New Is HERE?
It looks like your form tag is missing some attributes needed to point your browser to the script as to where to submit the data. if you were to try with your form tag as form action=___SCRIPT_ITSELF_FILENAME___ method=post ?? Andrew. ps: if that doesn't work, may I recommend inserting echo(pre); print_r($_POST); echo(/pre); to see what your post data is? Okay, everyone, here's some real progress. I retyped the file from scratch. I'm both attaching it--it's not a big file--and printing it below: html head titlepersistence demo/title /head body h1Persistence Demo/h1 form ?php $txtBoxCounter = $_POST['txtBoxCounter']; $hdnCounter = $_POST['hdnCounter']; //increment the counters $txtBoxCounter++; $hdnCounter++; print HERE input type = text name = txtBoxCounter value = $txtBoxCounter input type = hidden name = hdnCounter value = $hdnCounter h3The hidden value is $hdnCounter/h3 input type = submit value = click to increment counters HERE; ? /form /body /html My results were mixed, but definitely moved me forward. The H1 head--Persistence Demo--displayed, as did a field with the number 1 in it. After a blank line was printed The hidden value is 1. That was followed by another blank line space, and then a button with click to increment counters in it. When I click the button, I get a box dropping down that says the info I've entered is to be sent over an unencrypted connection and could be read by others, and do I still want to send it. I click Continue, and that box disappears. There ends my success. I'm left with: The H1 head--Persistence Demo--displayed, and the number 1 in it. The blank line followed by The hidden value is 1. The other blank line space, and then the button with click to increment counters in it. No seeming advance to the counters. Whattaya think? Steve Tiano mail2web - Check your email from the web at http://mail2web.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] How New Is HERE?
Bingo! Thanks, everyone! And thanks especially to Andrew! You were right: I needed the action and method attributes. And then it does increment. My last question on this episode: Why did it work before this for some of you trying it out for me? I mean, the code is the code, right? And either it's correct or it's not. How come it worked without these other attributes for some of you? Steve - It looks like your form tag is missing some attributes needed to point your browser to the script as to where to submit the data. if you were to try with your form tag as form action=___SCRIPT_ITSELF_FILENAME___ method=post ?? Andrew. mail2web - Check your email from the web at http://mail2web.com/ . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How New Is HERE?
It incrementeted for me only after I changed $_POST to $_GET, but never gave errors. [EMAIL PROTECTED] wrote: Bingo! Thanks, everyone! And thanks especially to Andrew! You were right: I needed the action and method attributes. And then it does increment. My last question on this episode: Why did it work before this for some of you trying it out for me? I mean, the code is the code, right? And either it's correct or it's not. How come it worked without these other attributes for some of you? Steve - It looks like your form tag is missing some attributes needed to point your browser to the script as to where to submit the data. if you were to try with your form tag as form action=___SCRIPT_ITSELF_FILENAME___ method=post ?? Andrew. mail2web - Check your email from the web at http://mail2web.com/ . -- Olwen Williams See my BB site http://www.bandbclub.com and my new site http://www.handyman.co.nz - A virtual shed for real kiwi blokes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How New Is HERE?
Change: $txtBoxCounter = $_POST['txtBoxCounter] $hdnCounter = $_POST['hdnCounter] to $txtBoxCounter = $_POST['txtBoxCounter']; $hdnCounter = $_POST['hdnCounter']; (Notice the ' at the end of txtBoxCounter and hdnCounter. Merry X'mas [EMAIL PROTECTED] wrote: Okay, for everyone took a break for Christmas, and to update Jasper and Jeremy--who've tried big-time to help me--here's again the sitch and where I stand as of now. I'm on a Macintosh PowerBook running OS X.2.1 and PHP 4.3.0. I'm tryning to run the following code: html head title persistence demo /title /head body h1Persistence Demo/h1 form ?php //increment the counters $txtBoxCounter++; $hdnCounter++; print HERE input type = text name = txtBoxCounter value = $txtBoxCounter input type = hidden name = hdnCounter value = $hdnCounter h3The hidden value is $hdnCounter/h3 input type = submit value = click to increment counters HERE; ? /form /body /html What that gets me is: Parse error: parse error, unexpected $ in [my path to this file] on line 33 register_globals is, of course, off. So I add $txtBoxCounter = $_POST['txtBoxCounter] and $hdnCounter = $_POST['hdnCounter] as separate line right after ?php. And that gets me an unexpected TVARIABLE message. Anyone, please? Thank you. Steve Tiano mail2web - Check your email from the web at http://mail2web.com/ . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How New Is HERE?
Thanks very much, and Merry Christmas to all--rather rude of me to've been whining for help all this time and not remembering the courtesy of holiday wishes. Okay, I made the change to: $txtBoxCounter = $_POST['txtBoxCounter']; $hdnCounter = $_POST['hdnCounter']; Now I get: parse error: parse error, unexpected $ in [my path to this file] on line 34 I'm still missing the big picture. Steve Tiano - Change: $txtBoxCounter = $_POST['txtBoxCounter] $hdnCounter = $_POST['hdnCounter] to $txtBoxCounter = $_POST['txtBoxCounter']; $hdnCounter = $_POST['hdnCounter']; (Notice the ' at the end of txtBoxCounter and hdnCounter. Merry X'mas mail2web - Check your email from the web at http://mail2web.com/ . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How New Is HERE?
Please post your code from line 30 to 40. Place a mark in line 34. =) [EMAIL PROTECTED] wrote: parse error: parse error, unexpected $ in [my path to this file] on line 34 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How New Is HERE?
Cesar, Sorry to have taken so long to answer. My day got complicated. Anyway, here's the code all over again, with the last changes I was advised to make. I took out the line spaces and added line numbers. But first, the latest error message: Parse error: parse error, unexpected T_VARIABLE in [path to file] on line 11 The code: 1 html 2 head 3 title 4 persistence demo 5 /title 6 /head 7 body 8 h1Persistence Demo/h1 9 form 10 ?php 11 $txtBoxCounter = $_POST['txtBoxCounter']; 12 $hdnCounter = $_POST['hdnCounter']; 13 //increment the counters 14 $txtBoxCounter++; 15 $hdnCounter++; 16 print HERE 17 input type = text 18 name = txtBoxCounter 19 value = $txtBoxCounter 20 input type = hidden 21 name = hdnCounter 22 value = $hdnCounter 23 h3The hidden value is $hdnCounter/h3 24 input type = submit 25 value = click to increment counters 26 HERE; 27 ? 28 /form 29 /body 30 /html --- Please post your code from line 30 to 40. Place a mark in line 34. =) mail2web - Check your email from the web at http://mail2web.com/ . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How New Is HERE?
Steve -- ...and then [EMAIL PROTECTED] said... % %Parse error: parse error, unexpected T_VARIABLE in [path to file] on % line 11 % % The code: % ... % 10 ?php % 11 $txtBoxCounter = $_POST['txtBoxCounter']; That certainly looks innocuous enough. Just for fun, strip out the HERE print statement and see if the code is OK. I can't see how it on line 16 would affect this on line 11 (or even anything wrong with it), but let's start with a small case that works and build up from there. HTH HAND Happy Holidays :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP] How New Is HERE?
AFAIK, it has been in PHP since the beginning of PHP4. I could be wrong, but I think it was one of the new features added when 4.0 came out. Here is a little reference material for you on it. http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc Without seeing a code snippet, I can't tell you what your doing wrong. Probably something simple, but hopefully the document above will help you. Another resource which gives a decent guide to HEREDOC's is the fairly new book Core PHP Programming Third Edition. It's been a while since I read it, but if memory serves it has atleast a page or two on it's usage. I also highly recommend that book anyway to any PHP programmer, beginner all the way to highly advanced. I thought I knew almost everything about PHP and even I still learned about a new function or two from the book. Very worthwhile. Jeremy On Thu, 2003-12-25 at 12:44, [EMAIL PROTECTED] wrote: I'm running PHP version 4.3.0 on a Macintosh PowerBook with OS 10.2.1, doing some PHP tutorial exercises. And I've run across something I haven't seen before in the sample code I'm seeing: print HERE [multiple lines of code] HERE; Now, from what I've read, it seems that the point of HERE ... HERE; is to execute all the code between the two HEREs. But when I run this thru my browsers--Netscape 7.02 and IE 5.2--I get the following error message: Parse error: parse error, unexpected $ in [path to file] [line number] Is this HERE ... HERE; new to PHP sometime after version 4.3.0, and I'm just out of luck unless I upgrade? Thank you. Steve Tiano mail2web - Check your email from the web at http://mail2web.com/ . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php