RE: [PHP] Parse Error - Help? (AGAIN)
I don't think performance should be as much of a concern as security. When you get warnings about undefined variables, it should make you think about where this variable's value is coming from. If register_globals is off, then this isn't as much of an issue. If I use $id, at least I know it's not coming from user input. Either way, you should develop with E_ALL so that you can make sure that variables are set and checked correctly and to spot all the mistakes/holes that you can. Once you go live, you set it so that NO errors are reported (default in PHP 4.2) so that viewers can't glean any info from failed scripts like path directories and file names... ---John Holmes... -Original Message- From: Maxim Maletsky (PHPBeginner.com) [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 11:19 AM To: 'Nathan'; 'PHP' Subject: RE: [PHP] Parse Error - Help? (AGAIN) You know, I once said the same: better fix the notices and keep the code clean. But as I've done several performance tests I came to a conclusion that there's no much difference debugging the code yourself or let PHP doing it. Often predefining manually a variable resulted to me being even more 'expensive' then when PHP debugs it. I think it is wise using this feature of PHP. The only reason not to is for having the full control of your code. Just my 2 Eurocents Sincerely, Maxim Maletsky Founder, Chief Developer www.PHPBeginner.com // where PHP Begins -Original Message- From: Nathan [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 7:15 PM To: PHP Subject: Re: [PHP] Parse Error - Help? (AGAIN) I'll second that one... always better to code with register_globals = Off and E_ALL reporting level IMHO. # Nathan - Original Message - From: Philip Olson [EMAIL PROTECTED] To: Maxim Maletsky (PHPBeginner.com) [EMAIL PROTECTED] To stop receiving the messages from undefined variables add this at top of your files: error_reporting(55); Or better yet, keep as you're doing and develop with E_ALL and fix those E_NOTICE errors correctly! ;) Regards, Philip Olson -- 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 -- 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] Parse Error - Help?
Copy and paste the parse error into your e-mail. Also, try placing another } at the end of the code. If you're missing a closing bracket somewhere, that will take care of it. Tyler Longren Captain Jack Communications www.captainjack.com [EMAIL PROTECTED] - Original Message - From: Jason Soza [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 24, 2002 10:20 PM Subject: [PHP] Parse Error - Help? Can someone take a look at this code for me? I'm pretty new to programming, but looking at it I think it should work. I'm not saying there aren't plenty of errors, because I'm sure there are. I'm getting a parse error on the last line, and I can't see any reason for it. All of my ifs and functions are closed as far as I see. I guess I'm just looking for an unbiased eye here, I've been staring at this for a couple hours now. If you have comments on to how I could simplify this code, that'd be great too. Otherwise, I just need it to get it working. Thanks in advance - Jason Soza ?php // general config $timestamp = date(mdY); $id = time(); $upload_path = incoming/; // path to your upload directory $extval_use = 1; // turns on/off extension validation // mail config $xmailer = [EMAIL PROTECTED]; $xsender = [EMAIL PROTECTED]; $from = [EMAIL PROTECTED]; $to = [EMAIL PROTECTED]; $subject = Form submission; $boundary = b.md5(uniqid(time())); // form config $name = $_POST[name]; $email = $_POST[email]; $location = $_POST[location]; $color = $_POST[color]; $year = $_POST[year]; $misc = $_POST[misc]; // extension config $extval = array(php, php3, asp, bat, exe, com, jsp, cfml, shtml, dtcl); $filesize_limit_use = 1; // turns on/off size check $filesize_limit = 2048; // file size limit (in kB) // messages $message[fileisbig] = File is bigger than upload limit ( . $filesize_limit . kB); $message[invext] = Files of this type are not allowed, sorry.; $message[incomplete] = Upload is incomplete.; $message[complete] = Upload succesfully completed.; $message[uploadbutton] = Upload; $message[uploadtxt] = File for upload: ; $message[fileexists] = File already exists; // Define functions function filesize_check ($filesize) { if($filesize_limit $filesize) { echo pfont color='red'center . $message[fileisbig]./font/center/p; $rc = 1; } } function ext_valid ($filename) { $extget = substr( strrchr($filename, .), 1); $found = in_array($extget, $extval); if ( $found ) { echo pfont color='red'center . $message[invext]./font/center/p; $rc = 2; } function file_upload ($filename) { if ( file_exists($upload_path.$timestamp.-.$id.-.$filename) ) { echo pfont color='red'center . $message[fileexists]./font/center/p; } else { if( move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'], $upload_path.$timestamp.-.$id.-.$filename) ) { echo pcenter . $message[complete]./center/p; } else { echo pfont color='red'center . $message[incomplete]./font/center/p; } } } function filename_mod ($filename) { ereg_replace([^a-z0-9._], , ereg_replace ( , _, ereg_replace(%20, _, strtolower($orig_name; } $rc = 0; if($filesize_limit_use=1) { $filesize1 = $HTTP_POST_FILES['userfile1']['name'] / 1024; //filesize in kB $filesize2 = $HTTP_POST_FILES['userfile2']['name'] / 1024; //filesize in kB $filesize3 = $HTTP_POST_FILES['userfile3']['name'] / 1024; //filesize in kB $filesize4 = $HTTP_POST_FILES['userfile4']['name'] / 1024; //filesize in kB } if ( isset($HTTP_POST_VARS[upload]) ) { if ($HTTP_POST_FILES['userfile1']['name']) { $orig_name1 = $HTTP_POST_FILES['userfile1']['name']; $filename1 = filename_mod ($orig_name1); filesize_check ($filesize1); if ( $rc == 0 ) { if($extval_use=1) { ext_valid ($filename1); } } if ( $rc == 0 ) { file_upload ($filename1); } } if ($HTTP_POST_FILES['userfile2']['name']) { $orig_name2 = $HTTP_POST_FILES['userfile2']['name']; $filename2 = filename_mod ($orig_name2); filesize_check ($filesize2); if ( $rc == 0 ) { if($extval_use=1) { ext_valid ($filename2); } } if ( $rc == 0 ) { file_upload ($filename2); } } if ($HTTP_POST_FILES['userfile3']['name']) { $orig_name3 = $HTTP_POST_FILES['userfile3']['name']; $filename3 = filename_mod ($orig_name3); filesize_check ($filesize3); if ( $rc == 0 ) { if($extval_use=1) { ext_valid ($filename3); } } if ( $rc == 0 ) { file_upload ($filename3); } } if ($HTTP_POST_FILES['userfile4']['name']) { $orig_name4 = $HTTP_POST_FILES['userfile4']['name']; $filename4 =
Re: [PHP] Parse Error - Help?
On Thursday 25 April 2002 11:20, Jason Soza wrote: Can someone take a look at this code for me? I'm pretty new to programming, but looking at it I think it should work. I'm not saying there aren't plenty of errors, because I'm sure there are. I'm getting a parse error on the last line, and I can't see any reason for it. All of my ifs and functions are closed as far as I see. I guess I'm just looking for an unbiased eye here, I've been staring at this for a couple hours now. If you have comments on to how I could simplify this code, that'd be great too. Otherwise, I just need it to get it working. Thanks in advance - if ( isset($HTTP_POST_VARS[upload]) ) { if ($HTTP_POST_FILES['userfile1']['name']) { $orig_name1 = $HTTP_POST_FILES['userfile1']['name']; $filename1 = filename_mod ($orig_name1); filesize_check ($filesize1); if ( $rc == 0 ) { if($extval_use=1) { ext_valid ($filename1); } } if ( $rc == 0 ) { file_upload ($filename1); } - HERE } Could it be this extra closing brace? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Semper Fi, dude. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Parse Error - Help?
Found it - just added another curly brace to the end of the code and it worked, so I searched up from there and found: function ext_valid ($filename) { $extget = substr( strrchr($filename, .), 1); $found = in_array($extget, $extval); if ( $found ) { echo pfont color='red'center . $message[invext]./font/center/p; $rc = 2; } This function should have another curly brace at the end. Aha! Thanks for your help! Jason -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 7:22 PM To: Jason Soza; [EMAIL PROTECTED] Subject: Re: [PHP] Parse Error - Help? Copy and paste the parse error into your e-mail. Also, try placing another } at the end of the code. If you're missing a closing bracket somewhere, that will take care of it. Tyler Longren Captain Jack Communications www.captainjack.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Parse Error - Help? (AGAIN)
Yike, now I wish I hadn't found it: [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Wrong datatype for second argument in call to in_array in beta_up.asp on line 61 [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Undefined variable: upload_path in beta_up.php on line 73 [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Undefined variable: timestamp in beta_up.php on line 73 [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Undefined variable: id in beta_up.php on line 73 [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Undefined variable: HTTP_POST_FILES in beta_up.php on line 78 [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Undefined variable: upload_path in beta_up.php on line 79 [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Undefined variable: timestamp in beta_up.php on line 79 [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Undefined variable: id in beta_up.php on line 79 [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Undefined variable: message in beta_up.php on line 83 [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Undefined variable: filename3 in beta_up.php on line 177 [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Undefined variable: filename4 in beta_up.php on line 178 What more do I have to do to define variables? I name what each variable is with normal conventions - what would cause the above error messages? I think the one that's most disturbing is the in_array() warning, need that to work! Again, any help would be greatly appreciated! Jason -Original Message- From: Jason Soza [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 7:56 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Parse Error - Help? Found it - just added another curly brace to the end of the code and it worked, so I searched up from there and found: function ext_valid ($filename) { $extget = substr( strrchr($filename, .), 1); $found = in_array($extget, $extval); if ( $found ) { echo pfont color='red'center . $message[invext]./font/center/p; $rc = 2; } This function should have another curly brace at the end. Aha! Thanks for your help! Jason -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 7:22 PM To: Jason Soza; [EMAIL PROTECTED] Subject: Re: [PHP] Parse Error - Help? Copy and paste the parse error into your e-mail. Also, try placing another } at the end of the code. If you're missing a closing bracket somewhere, that will take care of it. Tyler Longren Captain Jack Communications www.captainjack.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] parse error= doc contains no data
On Saturday 20 April 2002 01:24, Pedro Garre wrote: *This message was transferred with a trial version of CommuniGate(tm) Pro* Hi, I set my own error handler as described in the documentation. It seems to work, as I can catch NOTICE errors. The problem is that PARSE errors do not display anywhere, nor are catched by my error handler. The browser just says document contains no data. I know parse errors are not supposed to be catched by my error handler, but ... why are not them processed anywhere ? (display_errors is On in php.ini) Parse errors cannot be trapped. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* He hath eaten me out of house and home. -- William Shakespeare, Henry IV */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] parse error= doc contains no data
Try setting error_reporting = E_ALL ~E_NOTICE, or just E_ALL, in php.ini. Kirk -Original Message- From: Pedro Garre [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 11:25 AM To: php-general Subject: [PHP] parse error= doc contains no data I set my own error handler as described in the documentation. It seems to work, as I can catch NOTICE errors. The problem is that PARSE errors do not display anywhere, nor are catched by my error handler. The browser just says document contains no data. I know parse errors are not supposed to be catched by my error handler, but ... why are not them processed anywhere ? (display_errors is On in php.ini) Thanks in advance. Pedro. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] parse error= doc contains no data
*This message was transferred with a trial version of CommuniGate(tm) Pro* My php.ini has E_ALL and E_NOTICE I have tried several values with function error_reporting, including error_reporting(0) as recommended in the documentation. I am using the example of error handler function provided in the documentation. Note that if I don't set my own error_handler everything works and parse error messages are displayed as usual. More ideas ? Pedro. Johnson, Kirk escribió: *This message was transferred with a trial version of CommuniGate(tm) Pro* Try setting error_reporting = E_ALL ~E_NOTICE, or just E_ALL, in php.ini. Kirk -Original Message- From: Pedro Garre [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 11:25 AM To: php-general Subject: [PHP] parse error= doc contains no data I set my own error handler as described in the documentation. It seems to work, as I can catch NOTICE errors. The problem is that PARSE errors do not display anywhere, nor are catched by my error handler. The browser just says document contains no data. I know parse errors are not supposed to be catched by my error handler, but ... why are not them processed anywhere ? (display_errors is On in php.ini) Thanks in advance. Pedro. -- 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] parse error= doc contains no data
Sorry, I missed the main point of your original question. No more ideas here. -Original Message- From: Pedro Garre [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 3:23 PM To: php-general Subject: Re: [PHP] parse error= doc contains no data *This message was transferred with a trial version of CommuniGate(tm) Pro* My php.ini has E_ALL and E_NOTICE I have tried several values with function error_reporting, including error_reporting(0) as recommended in the documentation. I am using the example of error handler function provided in the documentation. Note that if I don't set my own error_handler everything works and parse error messages are displayed as usual. More ideas ? Pedro. Johnson, Kirk escribió: *This message was transferred with a trial version of CommuniGate(tm) Pro* Try setting error_reporting = E_ALL ~E_NOTICE, or just E_ALL, in php.ini. Kirk -Original Message- From: Pedro Garre [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 11:25 AM To: php-general Subject: [PHP] parse error= doc contains no data I set my own error handler as described in the documentation. It seems to work, as I can catch NOTICE errors. The problem is that PARSE errors do not display anywhere, nor are catched by my error handler. The browser just says document contains no data. I know parse errors are not supposed to be catched by my error handler, but ... why are not them processed anywhere ? (display_errors is On in php.ini) Thanks in advance. Pedro. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error using an include class
On Thursday 11 April 2002 14:30, Andrew Schoenherr wrote: [snip] Problem I have just started using classes, downloaded from www.thewebmasters.net web site. I am working on user authentication and I am getting a parse error when the page loads. Only since I started using the class has this parse error occurred, but I am not sure if it the class that is causing the problem or not. I have included sections that I feel are relevant from my httpd.conf, php.ini and locations and contents of my .htpasswd files. [snip] Whilst it is commendable in providing detailed information about a setup when posting a question, it is best to restrict this to OS version, PHP version webserver version. You seemed to left out the MOST important piece of info which is what line the parse error occurs at. Post an extract of your code, just the 5-10 lines leading up to and including the line on which the error occurs. Also don't just say the error occurs at line 15, *indicate* which is line 15. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* The mosquito exists to keep the mighty humble. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] parse error, mysql select
$query = SELECT DATE_FORMAT( exp_date, \%W, %M %d, %Y\) AS thedate from tifrequest where user='$user' limit 1,1; Missing escape \ in front of quotes -Original Message- From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]] Sent: Monday, April 01, 2002 1:55 PM To: [EMAIL PROTECTED] Subject: [PHP] parse error, mysql select When I execute from browser I get a parse error, but when I enter the query directly into a MySQL command prompt I get a successful return. Can anybody see the problem with this code: $query = SELECT DATE_FORMAT( exp_date, %W, %M %d, %Y) AS thedate from tifrequest where user='$user' limit 1,1; Thanks! My eyes are shot! -- 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] parse error, mysql select
It doesn't like the ; at the end of the statement. I noticed this a while ago. I'd prefer if it didn't choke on the ; but it seems to. It's probably more correct to have the ; there - I don't know why it chokes when going through php. Matt Friedman Web Applications Developer www.SpryNewMedia.com -Original Message- From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]] Sent: Monday April 1, 2002 2:55 PM To: [EMAIL PROTECTED] Subject: [PHP] parse error, mysql select When I execute from browser I get a parse error, but when I enter the query directly into a MySQL command prompt I get a successful return. Can anybody see the problem with this code: $query = SELECT DATE_FORMAT( exp_date, %W, %M %d, %Y) AS thedate from tifrequest where user='$user' limit 1,1; Thanks! My eyes are shot! -- 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] parse error, mysql select
He's not including the ; in the SELECT statement. The ; you're seeing is at end of the PHP statement -Original Message- From: Matt Friedman [mailto:[EMAIL PROTECTED]] Sent: Monday, April 01, 2002 2:02 PM To: 'ROBERT MCPEAK'; [EMAIL PROTECTED] Subject: RE: [PHP] parse error, mysql select It doesn't like the ; at the end of the statement. I noticed this a while ago. I'd prefer if it didn't choke on the ; but it seems to. It's probably more correct to have the ; there - I don't know why it chokes when going through php. Matt Friedman Web Applications Developer www.SpryNewMedia.com -Original Message- From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]] Sent: Monday April 1, 2002 2:55 PM To: [EMAIL PROTECTED] Subject: [PHP] parse error, mysql select When I execute from browser I get a parse error, but when I enter the query directly into a MySQL command prompt I get a successful return. Can anybody see the problem with this code: $query = SELECT DATE_FORMAT( exp_date, %W, %M %d, %Y) AS thedate from tifrequest where user='$user' limit 1,1; Thanks! My eyes are shot! -- 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] parse error, mysql select
Ack! Thanks. Rick Emery [EMAIL PROTECTED] 04/01/02 02:59PM $query = SELECT DATE_FORMAT( exp_date, \%W, %M %d, %Y\) AS thedate from tifrequest where user='$user' limit 1,1; Missing escape \ in front of quotes -Original Message- From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]] Sent: Monday, April 01, 2002 1:55 PM To: [EMAIL PROTECTED] Subject: [PHP] parse error, mysql select When I execute from browser I get a parse error, but when I enter the query directly into a MySQL command prompt I get a successful return. Can anybody see the problem with this code: $query = SELECT DATE_FORMAT( exp_date, %W, %M %d, %Y) AS thedate from tifrequest where user='$user' limit 1,1; Thanks! My eyes are shot! -- 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] Parse Error Suggestions?
On Mon, 18 Mar 2002, Mike At Spy wrote: Anyone have any suggestions for getting better reporting on a generic Parse Error? Code is falling to the end of the script, and I can't find a problem anywhere. I'd guess you left a curly brace open. Try opening the file in an editor that lets you balance your braces. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Parse Error Suggestions?
Good day, It's not really possible to have an error reporting function on a parse error. If there is a parse error, then the program can not be run, period. Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -Original Message- From: Mike At Spy [mailto:[EMAIL PROTECTED]] Sent: Monday, March 18, 2002 10:53 AM To: [EMAIL PROTECTED] Subject: [PHP] Parse Error Suggestions? Anyone have any suggestions for getting better reporting on a generic Parse Error? Code is falling to the end of the script, and I can't find a problem anywhere. I looked on the PHP site for error reporting functions, but apparently they do not handle Parse Errors. Thanks, -Mike -- 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] Parse Error Suggestions?
On Mon, 18 Mar 2002, Mike At Spy wrote: Anyone have any suggestions for getting better reporting on a generic Parse Error? Code is falling to the end of the script, and I can't find a problem anywhere. I'd guess you left a curly brace open. Try opening the file in an editor that lets you balance your braces. I thought the same thing exactly - but I have gone over them a dozen times and I am getting nothing! In fact, shouldn't any script run before the error? i.e. - shouldn't a print or echo before any script runs produce something? Mine isn't! -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Parse Error Suggestions?
Not sure exactly what your code is but if you try to pass a literal where a reference type parameter is defined this produces a blank page. function test( $var ) { echo $var } if you call with test( hello ) you get NO output. Ben At 18:01 18/03/2002, Mike At Spy wrote: On Mon, 18 Mar 2002, Mike At Spy wrote: Anyone have any suggestions for getting better reporting on a generic Parse Error? Code is falling to the end of the script, and I can't find a problem anywhere. I'd guess you left a curly brace open. Try opening the file in an editor that lets you balance your braces. I thought the same thing exactly - but I have gone over them a dozen times and I am getting nothing! In fact, shouldn't any script run before the error? i.e. - shouldn't a print or echo before any script runs produce something? Mine isn't! -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php * Ben Edwards +44 (0)117 9400 636 * * Critical Site Builderhttp://www.criticaldistribution.com * * online collaborative web authoring content management system * * i-Contact Progressive Video http://www.videonetwork.org * * Smashing the Corporate image http://www.subvertise.org * * Bristol Indymedia http://bristol.indymedia.org * * Bristol's radical news http://www.bristle.org.uk * * PGP : F0CA 42B8 D56F 28AD 169B 49F3 3056 C6DB 8538 EEF8 * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error Suggestions?
On Tuesday 19 March 2002 02:01, Mike At Spy wrote: On Mon, 18 Mar 2002, Mike At Spy wrote: Anyone have any suggestions for getting better reporting on a generic Parse Error? Code is falling to the end of the script, and I can't find a problem anywhere. I'd guess you left a curly brace open. Try opening the file in an editor that lets you balance your braces. I thought the same thing exactly - but I have gone over them a dozen times and I am getting nothing! In fact, shouldn't any script run before the error? i.e. - shouldn't a print or echo before any script runs produce something? Mine isn't! The *whole* file gets parsed *before* any code is executed. Check that you don't have any missing semi-colons (;) -- no, that's not a smiley. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Style may not be the answer, but at least it's a workable alternative. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error
For ($i = 1; $i ($nbline+1); $i++) { // Line 17 not : For ($i = 1; $i ($nbline+1); i++) { // Line 17 hope it helps you SR Jérome Moisy a écrit : Hy,When I try to see my page I have this message and I don't know why.If someone can explain to me.Thank You Parse error: parse error, expecting `')'' in liensfr.php on line 17 Source code :html head LINK REL=stylesheet HREF=mmenu.css SCRIPT LANGUAGE=javascript src=dhtml_lib_lite.js/SCRIPT titleLiens/title /head body onload=defilStat(),multiplemenus(); onUnload=clearTimeout(tempo22) SCRIPT LANGUAGE=javascript src=multiplemenusfr.js/SCRIPT brbrbrbr table align=center cellspacing=0 cellpadding=0 border=0 width=80% ?php $db = mysql_connect(database); $sql= SELECT * FROM liens; $res = mysql_query($sql, $db); $nbline = mysql_num_rows($res); For ($i = 1; $i ($nbline+1); i++) { // Line 17 print tr; print td; $req = SELECT nom FROM liens WHERE auto = $i; $result = mysql_query($req, $db); print center; echo $result; print br; $req = SELECT adresse FROM liens WHERE auto = $i; $result = mysql_query($req, $db); print a href='.$result.'; echo $result; print br; $req = SELECT banniere FROM liens WHERE auto = $i; $result = mysql_query($req, $db); If ($result != ) { print img scr='.$result.' width='300' height='150'/abr; } $req = SELECT comment FROM liens WHERE auto = $i; $result = mysql_query($req, $db); echo $result; print /center/td; print /tr; } php? centerfont size=2a href=newliens.php target=_blankAjouter votre lien/a/font/center SCRIPT LANGUAGE=JavaScript texte2 = 'CRAZYMANGA le site de reference !! Episode de grande qualite uniquement en Francais !! - '; x = texte2.length-1; place = 0; function defilStat() { if (place == texte2.length) { place = 0; } if (place = x) { texteDef = texte2.substring((texte2.length-(x-place)),texte2.length) + texte2.substring(0,place); place++; } window.status = texteDef; tempo22 = setTimeout(defilStat(), 150); } /SCRIPT /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] parse error? how can I print spesific message for all error mesage
Thanks Jan!!! It Works -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] parse error? how can I print spesific message for all error mesage
if I write directly localhost/myphp/resmigoster.php on his browser it response Warning: Undefined index: dir in c:\inetpub\wwwroot\kocak\resimgoster.php on line 1 Warning: Undefined index: res in c:\inetpub\wwwroot\kocak\resimgoster.php on line 3 if I write directly localhost/myphp/resmigoster.php?dir=mainres=mine than the script works like mine but I wonder to disable Warning: Undefined index: dir in c:\inetpub\wwwroot\kocak\resimgoster.php on line 1 response if someone directly enter localhost/myphp/resmigoster.php I want to say him that Access Denied Or something like that -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] parse error? how can I print spesific message for allerror mesage
On Tue, 12 Mar 2002, Ceyhun Güler wrote: than the script works like mine but I wonder to disable Warning: Undefined index: dir in c:\inetpub\wwwroot\kocak\resimgoster.php on line 1 response if someone directly enter localhost/myphp/resmigoster.php I want to say him that Access Denied Or something like that use error_reporting() (see manual) to suppres warnings. to give back an error use something like; if (!isset($dir) || !isset($res)) { print Access Denied; exit; } -- Jan Rademaker [EMAIL PROTECTED] http://www.ottobak.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] parse error? how can I print spesific message for allerror mesage
On Tue, 2002-03-12 at 12:32, Ceyhun Güler wrote: if I write directly localhost/myphp/resmigoster.php on his browser it response Warning: Undefined index: dir in c:\inetpub\wwwroot\kocak\resimgoster.php on line 1 Warning: Undefined index: res in c:\inetpub\wwwroot\kocak\resimgoster.php on line 3 if I write directly localhost/myphp/resmigoster.php?dir=mainres=mine than the script works like mine but I wonder to disable Warning: Undefined index: dir in c:\inetpub\wwwroot\kocak\resimgoster.php on line 1 response if someone directly enter localhost/myphp/resmigoster.php I want to say him that Access Denied Or something like that 'The Right Way'--there are several ;)--is to initialize your variables. :) If you don't want to do that, then: 1) Set error_reporting(E_ALL) for development, so you catch all the silly little errors we all make; 2) Set display_errors = Off in php.ini, so that users don't see any errors that are generated; 3) Use set_error_handler() to create your own function which can deal with error messages however you like. To the above, you can add all sorts of things. Using set_error_handling(), for instance, you can have error messages logged to a file, or sent to a socket or pipe--whatever. But turning error_reporting() off while developing is just going to let you get away with all sorts of things which might come back and bite you later (unquoted array keys, etc). -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] parse error? how can I print spesific message for all error mesage
? $dir = $HTTP_GET_VARS[dir]; $dir = str_replace( ,/,$dir); $res = $HTTP_GET_VARS[res]; ? title?=$res;?/title img src=?=$dir;?/?=$res;?.jpg /body My code is running now until if a link comes trough here like resimgoster.php?dir=main products imagesres=pic01 but if you write resimgoster.php to your adress bar without dir and res this script write_ Warning: Undefined index: dir in c:\inetpub\wwwroot\kocak\resimgoster.php on line 1 Warning: Undefined index: res in c:\inetpub\wwwroot\kocak\resimgoster.php on line 3 I want to give a message like Not Avaiable if dir and res is not entered! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] parse error? how can I print spesific message for all error mesage
Can AnyOne Help? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] parse error? how can I print spesific message for all error mesage
please try the following and let us know what the results are. title? echo $res; ?/title img src=? echo $dir; ?/? echo $res; ?.jpg /body - Original Message - From: Ceyhun Güler [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, March 11, 2002 12:41 AM Subject: Re: [PHP] parse error? how can I print spesific message for all error mesage ? $dir = $HTTP_GET_VARS[dir]; $dir = str_replace( ,/,$dir); $res = $HTTP_GET_VARS[res]; ? title?=$res;?/title img src=?=$dir;?/?=$res;?.jpg /body My code is running now until if a link comes trough here like resimgoster.php?dir=main products imagesres=pic01 but if you write resimgoster.php to your adress bar without dir and res this script write_ Warning: Undefined index: dir in c:\inetpub\wwwroot\kocak\resimgoster.php on line 1 Warning: Undefined index: res in c:\inetpub\wwwroot\kocak\resimgoster.php on line 3 I want to give a message like Not Avaiable if dir and res is not entered! -- 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] parse error? how can I print spesific message for all error mesage
Your line 2 doesn't end with a semicolon and causes the parse error on the next line. I don't think you can suppress parse errors because your code isn't running yet. once your code is running you can append die() to any decision statement or you can append echo If (!isset($r)) die($r wasn't set); If (!isset($r)) echo $r wasn't set; Hope this helps, Hugh - Original Message - From: Ceyhun Güler [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 10, 2002 12:05 PM Subject: [PHP] parse error? how can I print spesific message for all error mesage Parse error: parse error in c:\inetpub\wwwroot\kocak\resimgoster.php on line 3 How can I print my own message like sorry not avaiable! for all error happening in my php file but I want to make it only for this file I don' t want to configure My IIS My script was which Michael Kimsal was helped me to translate with can anyone translate my script to php? post--- ? $d = $HTTP_GET_VARS[dir]; $r = $HTTP_GET_VARS[res] $d = str_replace(%,/,$d); ? title?=$r;?/title body img src=?=$d;?/?=$r;? /body ThankS! -- 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] Parse Error Line Numbers
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Steven Walker declared Does anyone know how line numbers are figured? I get errors like the following: Parse error: parse error in /home/sites/site104/users/walker/web/admin/_fileutils.php on line 74 Is PHP preprocessing the code to remove comments and white space? The larger my code file, the more inaccurate the parse error line number. In this case, the actual error was on line 83. Well I hope someone provides a more technically accurate answer than mine :-) but my take on it is that php reports the line it was on when it encountered the error with isn't the same as where you've made your mistake. - -- - --- www.explodingnet.com |Projects, Forums and +Articles for website owners - -- Nick Wilson -- |and designers. -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8cqKJHpvrrTa6L5oRArJ8AJ4jXm+TYxKbXhqhtAgmgR14wycojACgh4zX vSFDxyu6sWvE7G14Jp91MZg= =P2dl -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error Line Numbers
my take on it is that php reports the line it was on when it encountered the error with isn't the same as where you've made your mistake. That sometimes is the case, depending on the error/omission. However, in my case the error is reported on a line number -before- the actual line number I found it on. I understand that compile/parse-time errors do not provide a lot of accuracy... I'm just trying to understand a little better how it generally preprocesses the file. Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED] On Tuesday, February 19, 2002, at 11:07 AM, Nick Wilson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Steven Walker declared Does anyone know how line numbers are figured? I get errors like the following: Parse error: parse error in /home/sites/site104/users/walker/web/admin/_fileutils.php on line 74 Is PHP preprocessing the code to remove comments and white space? The larger my code file, the more inaccurate the parse error line number. In this case, the actual error was on line 83. Well I hope someone provides a more technically accurate answer than mine :-) but my take on it is that php reports the line it was on when it encountered the error with isn't the same as where you've made your mistake. - -- - --- www.explodingnet.com |Projects, Forums and +Articles for website owners - -- Nick Wilson -- |and designers. -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8cqKJHpvrrTa6L5oRArJ8AJ4jXm+TYxKbXhqhtAgmgR14wycojACgh4zX vSFDxyu6sWvE7G14Jp91MZg= =P2dl -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error
What's line 19? Or, better yet, what's the previous statement? (it may span on several lines). Bogdan Jason Whitaker wrote: Ok I got this error: Parse error: parse error, expecting `','' or `';'' in c:\www\hosted\witakr\index.php on line 20 this is line 20: print (table border=0 align=center width=100% cellspacing=0 cellpadding=0); where? -- Jason Whitaker -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error
Ok Jason, Parse error: parse error, expecting `','' or `';'' in c:\www\hosted\witakr\index.php on line 20 this is line 20: print (table border=0 align=center width=100% cellspacing=0 cellpadding=0); where? Possibly an 'imbalance' starting higher up the code, eg no closing somewhere? =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Parse Error
I'd definitely check Line 19. You probably forgot a ; Matthew Walker Ecommerce Project Manager Mountain Top Herbs -Original Message- From: Jason Whitaker [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 4:01 PM To: [EMAIL PROTECTED] Subject: [PHP] Parse Error Ok I got this error: Parse error: parse error, expecting `','' or `';'' in c:\www\hosted\witakr\index.php on line 20 this is line 20: print (table border=0 align=center width=100% cellspacing=0 cellpadding=0); where? -- Jason Whitaker -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.323 / Virus Database: 180 - Release Date: 2/8/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.323 / Virus Database: 180 - Release Date: 2/8/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Parse error
Check for a missing line or block terminator just above line 19. Kirk -Original Message- From: Ron Clark [mailto:[EMAIL PROTECTED]] Sent: Monday, February 04, 2002 11:32 AM To: [EMAIL PROTECTED] Subject: [PHP] Parse error I am getting the following error trin to use the mysql_connect command in a script: Parse error: parse error in /usr/home/rclark/phptest/addrecord.php on line 19 Here is line 19: $connection = mysql_connect(localhost,phpkid,d0wn) or die (Could not connect to server); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse error: parse error in/test/put_file.php on line 14???
The problem is here $pos = strrpos($file, \); must be $pos = strrpos($file, \\); Regards, Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS - Original Message - From: Alex Elderson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 18, 2001 11:26 AM Subject: [PHP] Parse error: parse error in/test/put_file.php on line 14??? Hi, What do i wrong? I get this err: Parse error: parse error in /test/put_file.php on line 14 put_file.php begin- ?php if ($submit) { include('include.php'); $pos = strrpos($file, \); if ($pos === FALSE) { $pos = strrpos($file, /); if ($pos === FALSE) { $pos = 0; } } $name = substr($file, $pos + 1); $applicationn = substr($file, strrpos($file, .)); $fd = fopen($file, r) or die(can't open the file); $file_bin = fread($fd, filesize($file)); fclose($fd); $file_bin = mysql_escape_string($file_bin); $sql = INSERT INTO files (id, name, description, file, application) VALUES ('', '$name', '$description', '$file_bin', '$application'); $result = mysql_query ($sql) or die('fout'); } ? put_file.php end- include.php begin- ?php $conn = mysql_connect(localhost,user,password); mysql_select_db(test, $conn); ? include.php end- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] parse error when requiring
Maybe you could give a little more info on what the parse error actually says? On Thu, 2001-12-06 at 06:51, Oosten, Sjoerd van wrote: I have a question about require... I have a session_start() on top of every page and an if-else construction. ? session_start() if ($SessieEIA-Login == 1) { ? On the bottom of every page ? } else { require error.php; } ? This works fine, but now i made the files sessionstart.php and bottom.php sessionstart.php -- ? session_start() if ($SessieEIA-Login == 1) { ? bottom.php -- ? } else { require error.php; } ? And i require these files on top resp. bottom of the page and i get two parse errors. Can somebody tell me why? Thanks in advance! Sjoerd van Oosten Digitaal vormgever [EMAIL PROTECTED] Datamex E-sites B.V. http://www.esites.nl Minervum 7368 Telefoon: (076) 5 730 730 4817 ZH BREDA Telefax: (076) 5 877 757 ___ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] parse error when requiring
Parse error: parse error in /home/sites/site139/web/EIA/sessionstart.php on line 10 It's strange that line number 10 doesn't exist! Sjoerd van Oosten Digitaal vormgever [EMAIL PROTECTED] Datamex E-sites B.V. http://www.esites.nl Minervum 7368 Telefoon: (076) 5 730 730 4817 ZH BREDA Telefax: (076) 5 877 757 ___ -Oorspronkelijk bericht- Van: Andrew Forgue [mailto:[EMAIL PROTECTED]] Verzonden: donderdag 6 december 2001 16:13 Aan: Oosten, Sjoerd van CC: [EMAIL PROTECTED] Onderwerp: Re: [PHP] parse error when requiring Maybe you could give a little more info on what the parse error actually says? On Thu, 2001-12-06 at 06:51, Oosten, Sjoerd van wrote: I have a question about require... I have a session_start() on top of every page and an if-else construction. ? session_start() if ($SessieEIA-Login == 1) { ? On the bottom of every page ? } else { require error.php; } ? This works fine, but now i made the files sessionstart.php and bottom.php sessionstart.php -- ? session_start() if ($SessieEIA-Login == 1) { ? bottom.php -- ? } else { require error.php; } ? And i require these files on top resp. bottom of the page and i get two parse errors. Can somebody tell me why? Thanks in advance! Sjoerd van Oosten Digitaal vormgever [EMAIL PROTECTED] Datamex E-sites B.V. http://www.esites.nl Minervum 7368 Telefoon: (076) 5 730 730 4817 ZH BREDA Telefax: (076) 5 877 757 ___ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] parse error when requiring
Parse error: parse error in /home/sites/site139/web/EIA/sessionstart.php on line 10 It's strange that line number 10 doesn't exist! Do you have an include statement in sessionstart.php? -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] parse error when requiring
There is a semi-colon missing on the session_start() line. PHP can't pin down the exact line number of an error where the error is a missing terminator. Kirk -Original Message- From: Oosten, Sjoerd van [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 8:44 AM To: 'Andrew Forgue' Cc: '[EMAIL PROTECTED]' Subject: RE: [PHP] parse error when requiring Parse error: parse error in /home/sites/site139/web/EIA/sessionstart.php on line 10 It's strange that line number 10 doesn't exist! On Thu, 2001-12-06 at 06:51, Oosten, Sjoerd van wrote: I have a question about require... I have a session_start() on top of every page and an if-else construction. ? session_start() if ($SessieEIA-Login == 1) { ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] parse error when requiring
You forgot the semicolon (;) after session_start() This works fine, but now i made the files sessionstart.php and bottom.php sessionstart.php -- ? session_start() if ($SessieEIA-Login == 1) { ? bottom.php -- ? } else { require error.php; } ? And i require these files on top resp. bottom of the page and i get two parse errors. -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] parse error when requiring
hmm it still doesn't work. Maybe its because if have an if statement in the include which is closed in bottom.php? Sjoerd van Oosten Digitaal vormgever [EMAIL PROTECTED] Datamex E-sites B.V. http://www.esites.nl Minervum 7368 Telefoon: (076) 5 730 730 4817 ZH BREDA Telefax: (076) 5 877 757 ___ -Oorspronkelijk bericht- Van: Jon Farmer [mailto:[EMAIL PROTECTED]] Verzonden: donderdag 6 december 2001 16:49 Aan: Oosten, Sjoerd van; 'Andrew Forgue' CC: [EMAIL PROTECTED] Onderwerp: Re: [PHP] parse error when requiring Parse error: parse error in /home/sites/site139/web/EIA/sessionstart.php on line 10 It's strange that line number 10 doesn't exist! Do you have an include statement in sessionstart.php? -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse Error
Just use var $VAL_ID; Names of variables always start with a $ sign. Alberto wrote: Parse error: parse error, expecting `T_VARIABLE' in /sdr/httpd/Prisa/DATA/private/libs/captura/valores.php on line 18 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Parse Error
might be a syntax error in the .lib file you are including (missing ;, possibly)... let me know. -Original Message- From: Alberto [mailto:alberto arround [EMAIL PROTECTED]] Sent: 29 October 2001 10:14 To: [EMAIL PROTECTED] Subject: [PHP] Parse Error Parse error: parse error, expecting `T_VARIABLE' in /sdr/httpd/Prisa/DATA/private/libs/captura/valores.php on line 18 ? / // // Trabaja con valores/indices // / include(/sdr/httpd/Prisa/DATA/private/libs/db/db_sql.lib); class val_valores { / // // Todos los campos de la tabla // / var VAL_ID; -- Line 18 var VAL_TICKER; var VAL_ID_FEED; Where is the problem? Can't figure it :( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Parse Error
oops, missed that one! -Original Message- From: Alexander Weber [mailto:[EMAIL PROTECTED]] Sent: 29 October 2001 10:08 To: Alberto Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Parse Error Just use var $VAL_ID; Names of variables always start with a $ sign. Alberto wrote: Parse error: parse error, expecting `T_VARIABLE' in /sdr/httpd/Prisa/DATA/private/libs/captura/valores.php on line 18 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] parse error AFTER end of included file??
You need to close off this bit of code with a brace '}': if (!isset($page_id)) { Kirk -Original Message- From: Jaxon [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 28, 2001 9:34 AM To: [EMAIL PROTECTED] Subject: [PHP] parse error AFTER end of included file?? Hi, Can anyone tell me why I have a parse error here? I'm including this file, which is 16 lines, but the error being thrown by the including page reports a parse error in this file on line 17 ???: ?php if (!isset($page_type)) { $page_type = foo; } if (!isset($page_id)) { $sql=select page_id from table where fieldname = $value; $link_id = mysql_connect($host, $usr, $pass) or die (mysql_error()); mysql_select_db($database, $link_id); //select database catalog $result = mysql_query ($sql, $link_id) or die (mysql_error()); //return result set to php if (!$result) echo wait - no result set!; $page_id = mysql_result($result, 0, fieldname); ? cheers, jaxon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] parse error AFTER end of included file??
doh! thanks for spotting that Kirk! cheers, j -Original Message- From: Johnson, Kirk [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 28, 2001 11:49 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] parse error AFTER end of included file?? You need to close off this bit of code with a brace '}': if (!isset($page_id)) { Kirk -Original Message- From: Jaxon [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 28, 2001 9:34 AM To: [EMAIL PROTECTED] Subject: [PHP] parse error AFTER end of included file?? Hi, Can anyone tell me why I have a parse error here? I'm including this file, which is 16 lines, but the error being thrown by the including page reports a parse error in this file on line 17 ???: ?php if (!isset($page_type)) { $page_type = foo; } if (!isset($page_id)) { $sql=select page_id from table where fieldname = $value; $link_id = mysql_connect($host, $usr, $pass) or die (mysql_error()); mysql_select_db($database, $link_id); //select database catalog $result = mysql_query ($sql, $link_id) or die (mysql_error()); //return result set to php if (!$result) echo wait - no result set!; $page_id = mysql_result($result, 0, fieldname); ? cheers, jaxon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Parse Error
?php $link = mysql_pconnect (kron, jutta, geheim) { or die (Connexion impossible); } ^ ^ Those two {}'s aren't needed for an or dosomething operation. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse error: Needs T_VARIABLE or $
You are trying to add the output of a function call, called twice, BTW, to a string, apparantly. You don't saw what $tdStr is, really, in the scope. Jason Lustig wrote: This is really weird. Very, very, very weird. I have the following code in a script: if (!empty(trim($rowData[3]))) { $tdStr.= trim($rowData[3]); } Now, when I run it, I get the following error: Parse error: parse error, expecting `T_VARIABLE' or `'$'' in c:\server\wwwroot\contributors.php on line 70 (note: line 70 is the first liine of the code snippet above) Now, this shouldn't be a problem. There is no problem with the parens, and I don't see anything wrong with the code. Can someone help me out with this? This is happening in another script (when I use the empty() function) and it is really weird... --Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse error: Needs T_VARIABLE or $
Try this: $r = trim($rowData[3]); if ( !empty( $r ) ) { $tdStr.= trim($rowData[3]); } I tokk a look at the manual: 1. Note: empty() is a language construct. so: !empty is like to say !if or !while : so it's wrong- 2. Note that this is meaningless when used on anything which isn't a variable; i.e. empty (addslashes ($name)) has no meaning since it would be checking whether something which isn't a variable is a variable with a false value. - Original Message - From: Jason Lustig [EMAIL PROTECTED] To: Php-General@Lists. Php. Net [EMAIL PROTECTED] Sent: Friday, June 29, 2001 11:55 PM Subject: [PHP] Parse error: Needs T_VARIABLE or $ This is really weird. Very, very, very weird. I have the following code in a script: if (!empty(trim($rowData[3]))) { $tdStr.= trim($rowData[3]); } Now, when I run it, I get the following error: Parse error: parse error, expecting `T_VARIABLE' or `'$'' in c:\server\wwwroot\contributors.php on line 70 (note: line 70 is the first liine of the code snippet above) Now, this shouldn't be a problem. There is no problem with the parens, and I don't see anything wrong with the code. Can someone help me out with this? This is happening in another script (when I use the empty() function) and it is really weird... --Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse error..help!
Here is another error i keep on getting, this is suppose to send me an email each time someone enters in my website but i keep on gettong this error message: Parse error: parse error in /home/virtual/ppcu/home/httpd/html/php2/login.php on line 8 I don't see anything wrong, please help. ? SetLogging(1); Function AccessHit ( That's not how you define a function. Use: function AccessHit() { ... } -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse error..help!
In reply to [EMAIL PROTECTED]: Return-Path: [EMAIL PROTECTED] Received: from toye.php.net (va.php.net [198.186.203.51]) by cobalt1.intermedia.com.sg (8.10.2/8.10.2) with SMTP id f4IDicZ30638 for [EMAIL PROTECTED]; Fri, 18 May 2001 21:44:39 +0800 Received: (qmail 23365 invoked by uid 1013); 18 May 2001 13:47:20 - Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:[EMAIL PROTECTED] Delivered-To: mailing list [EMAIL PROTECTED] Received: (qmail 23359 invoked from network); 18 May 2001 13:47:20 - Reply-To: [EMAIL PROTECTED] From: Taline Makssabo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Fri, 18 May 2001 09:49:35 -0400 Message-ID: [EMAIL PROTECTED] MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Subject: [PHP] Parse error..help! X-UIDL: #l6!fL$#!:Bj!n1f!! Here is another error i keep on getting, this is suppose to send me an email each time someone enters in my website but i keep on gettong this error message: Parse error: parse error in /home/virtual/ppcu/home/httpd/html/php2/login.php on line 8 I don't see anything wrong, please help. ? SetLogging(1); Function AccessHit ( $NL = (\n); $H = getLastHost(); $R = getLastRef(); $To = [EMAIL PROTECTED]; $Sub = Page Accessed; $D = Date(D d M y h:ia,time()); $Msg = $H + $NL + $R + $NL + $D; mail($To,$Sub,$Msg); ); AccessHit(); ? $NL = (\n)? It should be $NL = \n; Regards, Keith Ng ___ Co-founder K-Designs Incorporated [EMAIL PROTECTED] http://www.k-designs.com.sg/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse error..help!
In reply to [EMAIL PROTECTED]: Return-Path: [EMAIL PROTECTED] Received: from toye.php.net (va.php.net [198.186.203.51]) by cobalt1.intermedia.com.sg (8.10.2/8.10.2) with SMTP id f4IDicZ30638 for [EMAIL PROTECTED]; Fri, 18 May 2001 21:44:39 +0800 Received: (qmail 23365 invoked by uid 1013); 18 May 2001 13:47:20 - Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:[EMAIL PROTECTED] Delivered-To: mailing list [EMAIL PROTECTED] Received: (qmail 23359 invoked from network); 18 May 2001 13:47:20 - Reply-To: [EMAIL PROTECTED] From: Taline Makssabo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Fri, 18 May 2001 09:49:35 -0400 Message-ID: [EMAIL PROTECTED] MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Subject: [PHP] Parse error..help! X-UIDL: #l6!fL$#!:Bj!n1f!! Here is another error i keep on getting, this is suppose to send me an email each time someone enters in my website but i keep on gettong this error message: Parse error: parse error in /home/virtual/ppcu/home/httpd/html/php2/login.php on line 8 I don't see anything wrong, please help. ? SetLogging(1); Function AccessHit ( $NL = (\n); $H = getLastHost(); $R = getLastRef(); $To = [EMAIL PROTECTED]; $Sub = Page Accessed; $D = Date(D d M y h:ia,time()); $Msg = $H + $NL + $R + $NL + $D; mail($To,$Sub,$Msg); ); AccessHit(); ? Right... so all in all the code should be: --- ? SetLogging(1); function AccessHit() { $NL = \n; $H = getLastHost(); $R = getLastRef(); $To = [EMAIL PROTECTED]; $Sub = Page Accessed; $D = Date(D d M y h:ia,time()); $Msg = $H + $NL + $R + $NL + $D; mail($To,$Sub,$Msg); } AccessHit(); ? --- Regards, Keith Ng ___ Co-founder K-Designs Incorporated [EMAIL PROTECTED] http://www.k-designs.com.sg/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse error..help!
It should be something like: function AccessHit() { ... } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse error..help!
Were you a LISP programmer or something? Taline Makssabo [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Here is another error i keep on getting, this is suppose to send me an email each time someone enters in my website but i keep on gettong this error message: Parse error: parse error in /home/virtual/ppcu/home/httpd/html/php2/login.php on line 8 I don't see anything wrong, please help. ? SetLogging(1); Function AccessHit ( $NL = (\n); $H = getLastHost(); $R = getLastRef(); $To = [EMAIL PROTECTED]; $Sub = Page Accessed; $D = Date(D d M y h:ia,time()); $Msg = $H + $NL + $R + $NL + $D; mail($To,$Sub,$Msg); ); AccessHit(); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse error..help!
Also take off the semicolon of the closing of the function } Taline Makssabo [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Here is another error i keep on getting, this is suppose to send me an email each time someone enters in my website but i keep on gettong this error message: Parse error: parse error in /home/virtual/ppcu/home/httpd/html/php2/login.php on line 8 I don't see anything wrong, please help. ? SetLogging(1); Function AccessHit ( $NL = (\n); $H = getLastHost(); $R = getLastRef(); $To = [EMAIL PROTECTED]; $Sub = Page Accessed; $D = Date(D d M y h:ia,time()); $Msg = $H + $NL + $R + $NL + $D; mail($To,$Sub,$Msg); ); AccessHit(); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Parse error help!
Perhaps you want something like this: $Msg = $H.$NL.$R.$NL.$D; HTH Sam Masiello Systems Analyst Chek.Com (716) 853-1362 x289 [EMAIL PROTECTED] -Original Message- From: Taline Makssabo [mailto:[EMAIL PROTECTED]] Sent: Friday, May 18, 2001 11:18 AM To: [EMAIL PROTECTED] Subject:[PHP] Parse error help! Thanks for all the help guys but one more minor issue, i am not receiving the email that someone accessed my page...why?? ? Function AccessHit() { $NL = \n; $H = getLastHost(); $R = getLastRef(); $To = [EMAIL PROTECTED]; $Sub = Page Accessed; $D = Date(D d M y h:ia,time()); $Msg = $H + $NL + $R + $NL + $D; mail($To,$Sub,$Msg); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse error with simple script
Hi again, Ok, I wasnt that tired after all :) and had the belliant idea of loading my script in vi and lo and behold here is what I saw: $user| =| 'root' ; Nice, huh? This was generated by this cute editor called BlueFish.. no more bluefish for me. Mohamed~ Mohamed LRHAZI wrote: Hello All, I am sure this is simple, but I really cant figure it out by myself.. at least not tonight :) This simple script gives : Parse error: parse error in /var/www/html/test.php on line 2 # cat /var/www/html/test.php ?php $user = root ; echo hello $user; ? If I comment (//) line 2, it works and the hello shows up. If I replace the double quotes with single quotes, it gives the same parse error. I already tried overwritng my php.ini with the original one and also tried reinstalling the mod_php rpm. Thanks a lot for any hints. Mohamed~ I am using Linux Mandrake 8.0 with these rpms: rpm -qa|egrep php\|apache php-ldap-4.0.4pl1-6mdk apache-common-1.3.19-3mdk apache-modules-1.3.19-3mdk apache-mod_perl-1.3.19_1.25-3mdk apache-1.3.19-3mdk php-common-4.0.4pl1-6mdk apache-suexec-1.3.19-3mdk mod_php-4.0.4pl1-6mdk php-imap-4.0.4pl1-6mdk apache-conf-1.3.19-3mdk php-4.0.4pl1-6mdk apache-manual-1.3.19-3mdk php-gd-4.0.4pl1-6mdk php-readline-4.0.4pl1-6mdk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse error with simple script
hehe;) Mohamed LRHAZI [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi again, Ok, I wasnt that tired after all :) and had the belliant idea of loading my script in vi and lo and behold here is what I saw: $user| =| 'root' ; Nice, huh? This was generated by this cute editor called BlueFish.. no more bluefish for me. Mohamed~ Mohamed LRHAZI wrote: Hello All, I am sure this is simple, but I really cant figure it out by myself.. at least not tonight :) This simple script gives : Parse error: parse error in /var/www/html/test.php on line 2 # cat /var/www/html/test.php ?php $user = root ; echo hello $user; ? If I comment (//) line 2, it works and the hello shows up. If I replace the double quotes with single quotes, it gives the same parse error. I already tried overwritng my php.ini with the original one and also tried reinstalling the mod_php rpm. Thanks a lot for any hints. Mohamed~ I am using Linux Mandrake 8.0 with these rpms: rpm -qa|egrep php\|apache php-ldap-4.0.4pl1-6mdk apache-common-1.3.19-3mdk apache-modules-1.3.19-3mdk apache-mod_perl-1.3.19_1.25-3mdk apache-1.3.19-3mdk php-common-4.0.4pl1-6mdk apache-suexec-1.3.19-3mdk mod_php-4.0.4pl1-6mdk php-imap-4.0.4pl1-6mdk apache-conf-1.3.19-3mdk php-4.0.4pl1-6mdk apache-manual-1.3.19-3mdk php-gd-4.0.4pl1-6mdk php-readline-4.0.4pl1-6mdk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] parse error is always on line 1 == error ?
On Fri, Apr 27, 2001 at 08:49:46AM +0200, Jimmy Lantz wrote: Hi, I have a problem, that when I get a parse error it always says that it's on line 1 in this or that file. Where is the configuration option to set this right? When I had this problem it turned out that the files in question had been created on a Macintosh in Adobe GoLive, I think. The newline characters in files created by this program are different to those used on Unix or DOS computers, which messes up things to the effect that the PHP parser only sees a single line. I used a tool from the Perl Power Tools page to convert the Mac files to Unix format, and the problem went away: http://language.perl.com/ppt/src/nlcvt/index.html Cheers, Frank -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] parse error is always on line 1 == error ?
I use BBEdit on the Mac, uploading PHP code to a Unix server, and I get parse errors on line 1 unless I remember to set line breaks to Unix \n (rather than Mac and Windows line endings, which use different characters). You may be running into a similar problem. Jimmy Lantz wrote: Hi, I have a problem, that when I get a parse error it always says that it's on line 1 in this or that file. Where is the configuration option to set this right? I have on another server seen that it's possible to get it to state the actual error line. John Platte Truth binds the mind to what satisfies it, but worldly thinking does not satisfy and therefore ignites curiosity. -- St. Theophan the Recluse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] parse error is always on line 1 == error ?
Yes, thank you you're right this is exactly what it was, I used Dreamweaver on a mac to edit the files, but now if I encounter parse error I convert them with BBEdit. Thank you. Jimmy Lantz I use BBEdit on the Mac, uploading PHP code to a Unix server, and I get parse errors on line 1 unless I remember to set line breaks to Unix \n (rather than Mac and Windows line endings, which use different characters). You may be running into a similar problem. Jimmy Lantz wrote: Hi, I have a problem, that when I get a parse error it always says that it's on line 1 in this or that file. Where is the configuration option to set this right? I have on another server seen that it's possible to get it to state the actual error line. John Platte Truth binds the mind to what satisfies it, but worldly thinking does not satisfy and therefore ignites curiosity. -- St. Theophan the Recluse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse Error for a weirdo!
Are you using short tag? or asp tag? What happen if you use ?php ?? Regards, -- Yasuo Ohgaki ouarz.net [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hiya, I am not a weirdo (at least I think so) ;) Considere this (Notice the line number): === Parse error: parse error in test_the_bug.php on line 1 === Seem normal, isn't it... but i is not!!! Since I last re-builted PHP, all, error messages do not return the correct line number... It is always saying line 1! What I have done?!? I can't work it out... I have rebuilt PHP many time now but with no success... Apart that every thing work fine :( but it is quiete ennoying to track and debug all my php errors :( So my config is Linux RedhaT with PHP Version 4.0.4pl1 './configure' '--with-mysql' '--with-apxs' '--with-gd=/usr/local' '--with-jpeg-dir=/usr/local' '--enable-ftp' '--with-imap' '--with-zlib' '--with-gettext' PLEASE HELP! Thanks in advance! Franck -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse error - script help.
Hi Dddogbruce, @ 10:58:47 PM on 4/16/2001, Dddogbruce (@home.com) wrote: Ok, I know it's messy - no, I don't care. :P Parse error: parse error in C:/XITAMI/owen/website/tss/guestbookSG.php on line 43 ... ? $space = " "; if( $submitfrm ) { echo "your entry will be added shortly."; $submitmsg = file( "gb.txt" ); $fp = fopen( "gb.txt", 'a' ); rewind($fp); fwrite( $fp, "fwrite( $fp, "table border=\"0\" cellpadding=\"0\" ^^^ Remove the quotation mark. cellspacing=\"0\" tr td width=\"236\"pfont size=\"1\"b$subject/b : a href=\"mailto:$email\"$name/a/td /tr tr td width=\"236\"font size=\"1\"p$submition/td /tr /tablebr" ); fclose( $fp ); } else { include ( "guestbooks.php" ); } ? ... It isn't working. Pfft! -Owen -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse error - script help.
Hi Brian, @ 11:14:55 PM on 4/16/2001, Brian Clark wrote: fwrite( $fp, "fwrite( $fp, "table border=\"0\" cellpadding=\"0\" ^^^ Remove the quotation mark. Duh, Brian. You have an extra fwrite($fp) in there. -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse error
I think it is because you put a ';' in the isset() after the '}' i believe if you remove it it will work. -elias http://www.kameelah.org/eassoft ""Mike"" [EMAIL PROTECTED] wrote in message 9av0j6$h2k$[EMAIL PROTECTED]">news:9av0j6$h2k$[EMAIL PROTECTED]... Im getting a "missing )" error on line 77 but cant seem to find it.Am I missing something else thats causing it? for ($i =1;$i=15;$i++) { if(!(isset(${'R'.$i.'P'};)))// line 77 { ${'R'.$i.'P'};="NULL"; } } Thanks Mike [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse error after end of file
titleAccessible Computers ?="$page_title"?/title DEFANGED_meta name=keywords content="stuff" DEFANGED_meta name=description content='? if ($description) { echo "$description"; } else { echo "Accessible Computers"; ?' Looks like you're missing a } here. regards Wagner -- "I haven't committed a crime. What I did was fail to comply with the law." David Dinkins, New York City Mayor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse error after end of file
At 03:59 PM 4/9/2001, DRN wrote: you need to make sure that ALL your curly brackets are closed and that all lines that require semi-colons have them ~kurth Hi, I am trying to include a header to my document, I my problem is I keep getting a parse error on the line after the header ends. I cannot see what is causing this, can someone see what I have done wrong, the code is below. Cheers for your help, Donald ' ? if ($no_menu_link==Home) { echo ""; } else { echo ""; } ? ? if ($no_menu_link==Home) { echo "Home | "; } else { echo "Home | "; } if ($no_menu_link==Catalogue) { echo "Catalogue | "; } else { echo "Catalogue | "; } if ($no_menu_link==Information) { echo "Information | "; } else { echo "Information | "; } if ($no_menu_link==Search) { echo "Search | "; } else { echo "Search | "; } if ($no_menu_link==Contact) { echo "Contact | "; } else { echo "Contact"; } ? ps. the no_menu_link variable is defined on the page calling the include so that the page does not have a link to itself. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse error after end of file
Kurth Bemis [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... | At 03:59 PM 4/9/2001, DRN wrote: | you need to make sure that ALL your curly brackets are closed and that all | lines that require semi-colons have them | | ~kurth D'oh, I don't know how I didn't see that, but it had been annoying me for ages. Cheers for your help once again, Donald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] parse error
Worked for me, but I had to make sure that $messagearray was in fact an array. So wrap that block of code in this: if(is_array($messagearray) sizeof($messagearray)) { } --Joe On Mon, Apr 09, 2001 at 01:13:00AM +0100, kenny.hibs wrote: I am getting a parse error in the following line of code ** foreach ($messagearray as $value) { //print("strlen: " . strlen($value)); if (strlen($value) = 22) { ? script alert('Your post is too long...use the forum for longer stories.') /script ? $message=""; break; } } * can anyone see whats causing the problem kenny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] /**\ *Joe Stump - PHP/SQL/HTML Developer * * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net * * "Better to double your money on mediocrity than lose it all on a dream." * \**/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] parse error
Three questions : 1. What is the parse error. 2. What line corresponds with the parse error. 3. What are the two lines above the line in #2 Regarding your code, it works (no parse error) for me. Two possible issues/guesses/warnings are : a. Foreach is php4+ (see manual for alternatives) b. $messagearray must be an array (see is_array()) Also, it helps people debug if the exact error is given as it takes much less time to debug (i.e. don't have to read all the code). Good luck ;) regards, Philip On Mon, 9 Apr 2001, kenny.hibs wrote: I am getting a parse error in the following line of code ** foreach ($messagearray as $value) { //print("strlen: " . strlen($value)); if (strlen($value) = 22) { ? script alert('Your post is too long...use the forum for longer stories.') /script ? $message=""; break; } } * can anyone see whats causing the problem kenny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] parse error inside comment????
Thanks for the pointer! It was actually a missing quote " in the function declaration ABOVE the one that the error was being reported in. Quite strange. regards, jaxon On 3/20/01 4:09 PM, "Johnson, Kirk" [EMAIL PROTECTED] wrote: Look for a missing terminator (semi-colon or curly brace) just *above* the line in the error message. Kirk -Original Message- From: Jaxon [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 20, 2001 1:18 PM To: [EMAIL PROTECTED] Subject: [PHP] parse error inside comment To summarize, a parse error is showing up on a file being 'required', even if the lines in question are commented out. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] parse error on line after last one???
At 06:31 PM 27/02/2001, Jaxon wrote: Hi all, Can anyone tell me why Im getting an unhelpful error when trying to pull up a file? The index.php Im calling is including a functions file functions.inc.php Im getting a parse error on line 144 but functions.inc.php only has 143 lines...! does this actually mean anything, or is it just poor error reporting?? Chances are, you are missing a } closing off something in that file, and its assuming that "well, if you havent closed it off yet, you need to do it at least by the last line" so its assuming that you need to add in a line 144 with a closing } in reality, it means you have to go back into your functions.inc.php and see where you are missing the } and the error should go away. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] parse error on line after last one???
From: "Jaxon" [EMAIL PROTECTED] Hi all, Can anyone tell me why Im getting an unhelpful error when trying to pull up a file? The index.php Im calling is including a functions file functions.inc.php Im getting a parse error on line 144 but functions.inc.php only has 143 lines...! does this actually mean anything, or is it just poor error reporting?? I think this usually means you have opened a block (e.g. an if statement), and forgotten to close it. Cheers Simon Garner -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] parse error driving me nuts ...
Instead of if ((mysql_num_rows($result)) = 1) try if ((mysql_num_rows($result)) == 1) HTH Jon -Original Message- From: Andrew [mailto:[EMAIL PROTECTED]] Sent: 15 February 2001 15:34 To: [EMAIL PROTECTED] Subject: [PHP] parse error driving me nuts ... hi, can anyone help me spot the parse error? It's throwing up on the first "if" line, and for the life of me I cannot find it! :) tia, andrew ?php include("db_connect_params.inc"); $sql="select path from PHOTO where pid =1"; $link_id = mysql_connect($host, $usr, $pass); $result = mysql_db_query($database, $sql, $link_id) or die("no result"); if ((mysql_num_rows($result)) = 1) { $row=mysql_fetch_array($result); extract($row); echo "img src =\"$path\"/imgbr"; } else { if (!isset($ii)) $ii = 1; $i = 1; while($row=mysql_fetch_array($result)) { extract($row); $displayed[$i]=$path; echo "a href=\"$PHP_SELF?ii=$i\"$i/anbspnbsp"; $i++; } echo "img src =\"$displayed[$ii]\"/imgbr"; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] parse error driving me nuts ...
Try to use == instead of = Sorin Ifrim - Original Message - From: Andrew [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 15, 2001 5:33 PM Subject: [PHP] parse error driving me nuts ... hi, can anyone help me spot the parse error? It's throwing up on the first "if" line, and for the life of me I cannot find it! :) tia, andrew ?php include("db_connect_params.inc"); $sql="select path from PHOTO where pid =1"; $link_id = mysql_connect($host, $usr, $pass); $result = mysql_db_query($database, $sql, $link_id) or die("no result"); if ((mysql_num_rows($result)) = 1) { $row=mysql_fetch_array($result); extract($row); echo "img src =\"$path\"/imgbr"; } else { if (!isset($ii)) $ii = 1; $i = 1; while($row=mysql_fetch_array($result)) { extract($row); $displayed[$i]=$path; echo "a href=\"$PHP_SELF?ii=$i\"$i/anbspnbsp"; $i++; } echo "img src =\"$displayed[$ii]\"/imgbr"; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] parse error driving me nuts ...
hi, can anyone help me spot the parse error? It's throwing up on the first "if" line, and for the life of me I cannot find it! :) tia, andrew ?php include("db_connect_params.inc"); $sql="select path from PHOTO where pid =1"; $link_id = mysql_connect($host, $usr, $pass); $result = mysql_db_query($database, $sql, $link_id) or die("no result"); if ((mysql_num_rows($result)) = 1) Well I don't know if it will give a parse error or not, but you have made the oh way too common C error in your IF statement. if ((mysql_num_rows($result)) = 1) should be: if ((mysql_num_rows($result)) == 1) - John Vanderbeck - Admin, GameDesign -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] parse error driving me nuts ...
Jon, John, Ifrim, the == worked ... thank you!! gotta read up on it now :) Cameron, dropping the extra () did not work :( thanks for the suggestions folks! andrew -Original Message- From: Jon Haworth [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 15, 2001 10:38 AM To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]' Subject: RE: [PHP] parse error driving me nuts ... Instead of if ((mysql_num_rows($result)) = 1) try if ((mysql_num_rows($result)) == 1) HTH Jon -Original Message- From: Andrew [mailto:[EMAIL PROTECTED]] Sent: 15 February 2001 15:34 To: [EMAIL PROTECTED] Subject: [PHP] parse error driving me nuts ... hi, can anyone help me spot the parse error? It's throwing up on the first "if" line, and for the life of me I cannot find it! :) tia, andrew ?php include("db_connect_params.inc"); $sql="select path from PHOTO where pid =1"; $link_id = mysql_connect($host, $usr, $pass); $result = mysql_db_query($database, $sql, $link_id) or die("no result"); if ((mysql_num_rows($result)) = 1) { $row=mysql_fetch_array($result); extract($row); echo "img src =\"$path\"/imgbr"; } else { if (!isset($ii)) $ii = 1; $i = 1; while($row=mysql_fetch_array($result)) { extract($row); $displayed[$i]=$path; echo "a href=\"$PHP_SELF?ii=$i\"$i/anbspnbsp"; $i++; } echo "img src =\"$displayed[$ii]\"/imgbr"; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] parse error driving me nuts ...
Jon, John, Ifrim, the == worked ... thank you!! gotta read up on it now :) Cameron, dropping the extra () did not work :( thanks for the suggestions folks! andrew Remember that '=' means assign what is on the right to what is on the left, whereby '==' means is what is on the left equal to what is on the right. C, and C based languages allow you to out an assignemtn statement even when you intend a relational expression. It is a very common pitfall. I know I have fallen into it in my C work many times :( - John Vanderbeck - Admin, GameDesign -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse error on blank line...
I gotta agree here. It happens every once in a while and it usually turns out to be something like that... also check to see if you have any here-docs in there that aren't terminated correctly (the ending signal must appear at the first column of a line and be followed by a semicolon). I don't know what else to suggest, but try commenting out some blocks of code systematically and see when it goes away... the thing's got to quit erroring out at some point. --Toby April wrote: No, I have the same thing happen all the time. It happens after a combination of }'s and ;'s where either a } or a ; is missing. Seriously. - Original Message - From: "Jackson, Michael" [EMAIL PROTECTED] To: "'johnny p.'" [EMAIL PROTECTED]; "April" [EMAIL PROTECTED]; "Jackson, Michael" [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, February 05, 2001 4:48 PM Subject: RE: [PHP] Parse error on blank line... Even if I was missing a brace, doesn't it seem odd that it would always give me a syntax error on the same line? It's as if it's arbitrarily deciding to break there... If I add a new line after ?php, it still gives the exact same line number... And again, I can comment it out, and it will still give me an error on the same line number. Again, this is the same line NUMBER - It apparently doesn't matter what snippet of code exists there. -Original Message- From: johnny p. [mailto:[EMAIL PROTECTED]] Sent: Monday, February 05, 2001 05:38 PM To: April; Jackson, Michael; [EMAIL PROTECTED] Subject: RE: [PHP] Parse error on blank line... I'm not sure where it is, but I agree that you are missing a curly brace somewhere. Take a break from your code for a bit, come back to it, and start matching braces. I suggest getting a coffee or some tea. johnny p. -Original Message- From: April [mailto:[EMAIL PROTECTED]] Sent: Monday, February 05, 2001 4:31 PM To: Jackson, Michael; [EMAIL PROTECTED] Subject: Re: [PHP] Parse error on blank line... You missed a } in there. Inside of that else, you have an if, but you never close the else. 190 showmainscreen(); 191} 192 should be 190 showmainscreen(); 191} 192} - Original Message - From: "Jackson, Michael" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 05, 2001 4:23 PM Subject: [PHP] Parse error on blank line... Hello all, I hope this doesn't turn out to be a stupid question, but we will see... I am getting parse errors on blank lines. Not commented, but totally blank. And seemingly no matter how I manipulate the text, it turns out to always be on the same line. I'm using vim with syntax tags to help me check my basic syntax, and everything seems to be closed - I am at a total loss as to what could be wrong! Let me try to clarify: Take the following snippet of code - It errors out on line 193. I have no idea why. I added blank lines to shift the code around - and if I eliminated all of the blank lines, I still error out on 193. 001 ?php . 181 ## 182 # BEGIN CODE # 183 ## 184 185 if ($goodtogo != "yes") { 186sanitize_session(); 187 } 188 else { 189if ($state == "main") { 190 showmainscreen(); 191} 192 193 194 195 196elseif ($state == "add") { 197 adduser($product,$username); 198} 199elseif ($state == "search") { 200 searchuser($username); 201} 202else { 203 doh(); 204} 205 } 206 207 208 # END CODE # 209 210 ? Any help is greatly appreciated! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse error on blank line...
You missed a } in there. Inside of that else, you have an if, but you never close the else. 190 showmainscreen(); 191} 192 should be 190 showmainscreen(); 191} 192} - Original Message - From: "Jackson, Michael" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 05, 2001 4:23 PM Subject: [PHP] Parse error on blank line... Hello all, I hope this doesn't turn out to be a stupid question, but we will see... I am getting parse errors on blank lines. Not commented, but totally blank. And seemingly no matter how I manipulate the text, it turns out to always be on the same line. I'm using vim with syntax tags to help me check my basic syntax, and everything seems to be closed - I am at a total loss as to what could be wrong! Let me try to clarify: Take the following snippet of code - It errors out on line 193. I have no idea why. I added blank lines to shift the code around - and if I eliminated all of the blank lines, I still error out on 193. 001 ?php . 181 ## 182 # BEGIN CODE # 183 ## 184 185 if ($goodtogo != "yes") { 186sanitize_session(); 187 } 188 else { 189if ($state == "main") { 190 showmainscreen(); 191} 192 193 194 195 196elseif ($state == "add") { 197 adduser($product,$username); 198} 199elseif ($state == "search") { 200 searchuser($username); 201} 202else { 203 doh(); 204} 205 } 206 207 208 # END CODE # 209 210 ? Any help is greatly appreciated! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse error on blank line...
argh, nm, I'm an idiot. - Original Message - From: "April" [EMAIL PROTECTED] To: "Jackson, Michael" [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, February 05, 2001 4:31 PM Subject: Re: [PHP] Parse error on blank line... You missed a } in there. Inside of that else, you have an if, but you never close the else. 190 showmainscreen(); 191} 192 should be 190 showmainscreen(); 191} 192} - Original Message - From: "Jackson, Michael" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 05, 2001 4:23 PM Subject: [PHP] Parse error on blank line... Hello all, I hope this doesn't turn out to be a stupid question, but we will see... I am getting parse errors on blank lines. Not commented, but totally blank. And seemingly no matter how I manipulate the text, it turns out to always be on the same line. I'm using vim with syntax tags to help me check my basic syntax, and everything seems to be closed - I am at a total loss as to what could be wrong! Let me try to clarify: Take the following snippet of code - It errors out on line 193. I have no idea why. I added blank lines to shift the code around - and if I eliminated all of the blank lines, I still error out on 193. 001 ?php . 181 ## 182 # BEGIN CODE # 183 ## 184 185 if ($goodtogo != "yes") { 186sanitize_session(); 187 } 188 else { 189if ($state == "main") { 190 showmainscreen(); 191} 192 193 194 195 196elseif ($state == "add") { 197 adduser($product,$username); 198} 199elseif ($state == "search") { 200 searchuser($username); 201} 202else { 203 doh(); 204} 205 } 206 207 208 # END CODE # 209 210 ? Any help is greatly appreciated! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Parse error on blank line...
I'm not sure where it is, but I agree that you are missing a curly brace somewhere. Take a break from your code for a bit, come back to it, and start matching braces. I suggest getting a coffee or some tea. johnny p. -Original Message- From: April [mailto:[EMAIL PROTECTED]] Sent: Monday, February 05, 2001 4:31 PM To: Jackson, Michael; [EMAIL PROTECTED] Subject: Re: [PHP] Parse error on blank line... You missed a } in there. Inside of that else, you have an if, but you never close the else. 190 showmainscreen(); 191} 192 should be 190 showmainscreen(); 191} 192} - Original Message - From: "Jackson, Michael" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 05, 2001 4:23 PM Subject: [PHP] Parse error on blank line... Hello all, I hope this doesn't turn out to be a stupid question, but we will see... I am getting parse errors on blank lines. Not commented, but totally blank. And seemingly no matter how I manipulate the text, it turns out to always be on the same line. I'm using vim with syntax tags to help me check my basic syntax, and everything seems to be closed - I am at a total loss as to what could be wrong! Let me try to clarify: Take the following snippet of code - It errors out on line 193. I have no idea why. I added blank lines to shift the code around - and if I eliminated all of the blank lines, I still error out on 193. 001 ?php . 181 ## 182 # BEGIN CODE # 183 ## 184 185 if ($goodtogo != "yes") { 186sanitize_session(); 187 } 188 else { 189if ($state == "main") { 190 showmainscreen(); 191} 192 193 194 195 196elseif ($state == "add") { 197 adduser($product,$username); 198} 199elseif ($state == "search") { 200 searchuser($username); 201} 202else { 203 doh(); 204} 205 } 206 207 208 # END CODE # 209 210 ? Any help is greatly appreciated! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Parse error on blank line...
Even if I was missing a brace, doesn't it seem odd that it would always give me a syntax error on the same line? It's as if it's arbitrarily deciding to break there... If I add a new line after ?php, it still gives the exact same line number... And again, I can comment it out, and it will still give me an error on the same line number. Again, this is the same line NUMBER - It apparently doesn't matter what snippet of code exists there. -Original Message- From: johnny p. [mailto:[EMAIL PROTECTED]] Sent: Monday, February 05, 2001 05:38 PM To: April; Jackson, Michael; [EMAIL PROTECTED] Subject: RE: [PHP] Parse error on blank line... I'm not sure where it is, but I agree that you are missing a curly brace somewhere. Take a break from your code for a bit, come back to it, and start matching braces. I suggest getting a coffee or some tea. johnny p. -Original Message- From: April [mailto:[EMAIL PROTECTED]] Sent: Monday, February 05, 2001 4:31 PM To: Jackson, Michael; [EMAIL PROTECTED] Subject: Re: [PHP] Parse error on blank line... You missed a } in there. Inside of that else, you have an if, but you never close the else. 190 showmainscreen(); 191} 192 should be 190 showmainscreen(); 191} 192} - Original Message - From: "Jackson, Michael" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 05, 2001 4:23 PM Subject: [PHP] Parse error on blank line... Hello all, I hope this doesn't turn out to be a stupid question, but we will see... I am getting parse errors on blank lines. Not commented, but totally blank. And seemingly no matter how I manipulate the text, it turns out to always be on the same line. I'm using vim with syntax tags to help me check my basic syntax, and everything seems to be closed - I am at a total loss as to what could be wrong! Let me try to clarify: Take the following snippet of code - It errors out on line 193. I have no idea why. I added blank lines to shift the code around - and if I eliminated all of the blank lines, I still error out on 193. 001 ?php . 181 ## 182 # BEGIN CODE # 183 ## 184 185 if ($goodtogo != "yes") { 186sanitize_session(); 187 } 188 else { 189if ($state == "main") { 190 showmainscreen(); 191} 192 193 194 195 196elseif ($state == "add") { 197 adduser($product,$username); 198} 199elseif ($state == "search") { 200 searchuser($username); 201} 202else { 203 doh(); 204} 205 } 206 207 208 # END CODE # 209 210 ? Any help is greatly appreciated! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse error on blank line...
No, I have the same thing happen all the time. It happens after a combination of }'s and ;'s where either a } or a ; is missing. Seriously. - Original Message - From: "Jackson, Michael" [EMAIL PROTECTED] To: "'johnny p.'" [EMAIL PROTECTED]; "April" [EMAIL PROTECTED]; "Jackson, Michael" [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, February 05, 2001 4:48 PM Subject: RE: [PHP] Parse error on blank line... Even if I was missing a brace, doesn't it seem odd that it would always give me a syntax error on the same line? It's as if it's arbitrarily deciding to break there... If I add a new line after ?php, it still gives the exact same line number... And again, I can comment it out, and it will still give me an error on the same line number. Again, this is the same line NUMBER - It apparently doesn't matter what snippet of code exists there. -Original Message- From: johnny p. [mailto:[EMAIL PROTECTED]] Sent: Monday, February 05, 2001 05:38 PM To: April; Jackson, Michael; [EMAIL PROTECTED] Subject: RE: [PHP] Parse error on blank line... I'm not sure where it is, but I agree that you are missing a curly brace somewhere. Take a break from your code for a bit, come back to it, and start matching braces. I suggest getting a coffee or some tea. johnny p. -Original Message- From: April [mailto:[EMAIL PROTECTED]] Sent: Monday, February 05, 2001 4:31 PM To: Jackson, Michael; [EMAIL PROTECTED] Subject: Re: [PHP] Parse error on blank line... You missed a } in there. Inside of that else, you have an if, but you never close the else. 190 showmainscreen(); 191} 192 should be 190 showmainscreen(); 191} 192} - Original Message - From: "Jackson, Michael" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 05, 2001 4:23 PM Subject: [PHP] Parse error on blank line... Hello all, I hope this doesn't turn out to be a stupid question, but we will see... I am getting parse errors on blank lines. Not commented, but totally blank. And seemingly no matter how I manipulate the text, it turns out to always be on the same line. I'm using vim with syntax tags to help me check my basic syntax, and everything seems to be closed - I am at a total loss as to what could be wrong! Let me try to clarify: Take the following snippet of code - It errors out on line 193. I have no idea why. I added blank lines to shift the code around - and if I eliminated all of the blank lines, I still error out on 193. 001 ?php . 181 ## 182 # BEGIN CODE # 183 ## 184 185 if ($goodtogo != "yes") { 186sanitize_session(); 187 } 188 else { 189if ($state == "main") { 190 showmainscreen(); 191} 192 193 194 195 196elseif ($state == "add") { 197 adduser($product,$username); 198} 199elseif ($state == "search") { 200 searchuser($username); 201} 202else { 203 doh(); 204} 205 } 206 207 208 # END CODE # 209 210 ? Any help is greatly appreciated! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parse error
Should probably put the whole thing. Why does this produce a parse error (I know that include statements do weird things to if structures): if($username != "") { code code code } else { include("file.php3"); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Parse error
Which line is producing the error?? M@ -Original Message- From: Liam Gibbs [mailto:[EMAIL PROTECTED]] Sent: 23 January 2001 17:32 To: [EMAIL PROTECTED] Subject: Re: [PHP] Parse error Should probably put the whole thing. Why does this produce a parse error (I know that include statements do weird things to if structures): if($username != "") { code code code } else { include("file.php3"); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]