Forum Moderators: coopster

Message Too Old, No Replies

PHP: parse error, unexpected $ ....

How do I debug/track parse error in script?

         

not_a_bozo

7:00 pm on Apr 2, 2003 (gmt 0)

10+ Year Member



Greetings, all!

How do I track down this error? ... =8-(

"Parse error: parse error, unexpected in /home/virtual/site222/fst/var/www/html/member_info/members_only/admin/add.php on line 247"

(And, ... how much of the coding should I present here for your edification?)

thanks again for all your helpful information!

glen
not_a_bozo

DrDoc

7:51 pm on Apr 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, you already know that the error is on line 247 (or possibly 246)... So that should help you :)

Watch for a missing ) or ; or "

andreasfriedrich

7:51 pm on Apr 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Posting line 247 and a few surrounding ones might help ;-)

Andreas

not_a_bozo

8:10 pm on Apr 2, 2003 (gmt 0)

10+ Year Member



thanks for the recommendation to post what is on/near the error line... Herewith, Lines 238 - 256, inclusive ...

238: $messagebody = "Your OC-CAMFT Member Web Page has been set up.\n";
239: $messagebody = $messagebody . "In order to personalize your page, you will need\n";
240: $messagebody = $messagebody . "to log in using your username and password:\n\n";
241: $messagebody = $messagebody . " Username: " . $username . "\n";
242: $messagebody = $messagebody . " Password: " . $password . "\n\n";
243: $messagebody = $messagebody . "To log in, go to:\n\n";
244: $messagebody = $messagebody . " [domain.org...]
245: $messagebody = $messagebody . "You will then be able to enter details about your\n";
246: $messagebody = $messagebody . "practice, upload your logo file and a photo of\n";
247: $messagebody = $messagebody . "yourself, and choose options to select how your web\n";
248: $messagebody = $messagebody . "page will look. If you have any problems or questions,\n";
249: $messagebody = $messagebody . "send email to webmaster@domain.org.\n";
250: $messagebody = $messagebody . "If you are listed on Therapist Finder,\n";
251: $messagebody = $messagebody . "you will also need to email the webmaster\n";
252: $messagebody = $messagebody . "when your page is ready, to have your link added.\n";
253: $messagesubject = "Your OC-CAMFT web page is ready";
254: $messageto = $email;
255: $messagefrom = "From: webmaster@domain.org\n";
256: $messagesend = mail($messageto, $messagesubject, $messagebody, $messagefrom);

[methinks these lines of code, even just staring at line 247, are not helpful as they are taken out of context. eh?]

NOTE: URL and EMAIL brackets (lines 244, 249, & 255) removed, and sitename changed, to protect the innocent coder

not_a_bozo

andreasfriedrich

8:16 pm on Apr 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Using heredoc syntax to quote the text would be much easier.


$messagebody = <<<END
Your OC-CAMFT Member Web Page has been set up.
In order to personalize your page, you will need
to log in using your username and password:
Username: $username
END;

This might solve your parsing error as well ;-)

Andreas

jatar_k

8:46 pm on Apr 2, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



another little tip

$messagebody = $messagebody . "something";

is the same as

$messagebody .= "something";

not_a_bozo

8:51 pm on Apr 2, 2003 (gmt 0)

10+ Year Member



SUPER!

I'll play with both of these suggestions!

Thanks ever so much for your comments and help here.

not_a_bozo
(glen)