Search Help Board

PHP Articles
PHP Help
Bulletin Board

PHP Manual (NEW!)
First Time PHP'ers
Help with programming
Sql assignment help
PHP Homework Help

C# Help

 parse error
Author:  (
Date:   10-18-03 08:17

Can someone explain why I am getting a parse error? Im a newbie at scripts. Here is the parse error message:

Parse error: parse error, expecting `']'' in /home/www/ on line 19

 Re: parse error
Author:  (
Date:   10-18-03 08:37

missing a '] in the code on line 19

try showing the code

 Re: parse error
Author:  (
Date:   10-18-03 11:53

Thanks Bastien. I am not even sure the free web host allows "sendmail''.
They will not answer my email. They do offer PHP though.

Anyway, here is the script:

$to = '[email protected]*****.com'; //Address mail is to be sent to

$from = $_REQUEST['email']; //Sets the senders mail address

$subject = $_REQUEST['subject']; //Sets the subject from the mail form

$confirm = 'confirm.php'; //Sets the page to direct to if the mail is sent

$error = 'mailerror.php'; //Sets the page to direct to if the mail is unsent

// Don't touch anything else //

$mailheader = "From: $email\r\n";
$mailheader .= "Reply-To: $email\r\n";
if (isset($HTTP_POST_VARS)){
$mailbody = '';
while (list($key, $value) = each($HTTP_POST_VARS))
$mailbody .= $key . ' = ' . $value . "\r\n";
$mailforms = mail($to, $subject, $mailbody, $mailheader);


 Re: parse error
Author:  (4.20.98.---)
Date:   10-18-03 14:06

Hey Matt,

Post the code in the confirm.php.. thats where the error is. If you read the error code it shows that thats the file having the error. Post the code and see if we can help ya out. I tested the code above and only got the parse error for confirm.php cause i dont have it.. lol

 Re: parse error
Author:  (
Date:   10-18-03 15:08

Sorry about that Prophit. I discovered I did that too late unfortunately.
Anyway, heres the latest. I reinstalled a "fresh" copy of the contact.php script and its working! Now onto my newest problem. One which I may not have any control over unless I find a "pay" host.
I know that my webhost allows PHP, but I am not sure if they offer "sendmail". Is there a way of telling other then their website? I contacted them too, but got no response.
My website address is:
If you click on the "contact" page, you will see the new error message.
Also, could you have a look at the "mainpage" of "" which is: and tell me if they offer sendmail? Thanks alot, Matt

 Re: parse error
Author:  (4.20.98.---)
Date:   10-19-03 13:00

Hrm i think you took the best step in contacting them. I cant really tell if the do or not. But you might want to change you redirect in your sendmail.php script to send you back to contact_us.php instead of contact.php

 Re: parse error
Author:  (
Date:   10-19-03 13:21

Thanks for checking Prophit. I will email them again to ask. I thought I saw a little script somewhere that will "ask" the server if it offers sendmail. On the redirect, I am changing that today. I just haven't been too concerned because I haven't submitted the site yet and I may be chaginging that page to a plain old "email" page if the webhost doesn't offer sendmail.

 Re: parse error
Author:  (4.20.98.---)
Date:   10-19-03 13:38

Right on.. hrm i havent scene any scripts.. i will check my books and see if can find anything.. i know there are some sendmail scripts but you already have one made. But im sure you have to pay or have to add it throught the host.

 new error message
Author:  (
Date:   10-25-03 18:49

Well, now I am getting this error message after hitting the submit button:

"Warning: Cannot add header information - headers already sent by (output started at /home/www/ in /home/www/ on line 93"

Let me know if anyone wants to see the script, its a new one I tried, supposed to be VERY easy for newbies at scripts........"hmmm ,alrighty then"

Thanks much

 Re: new error message
Author:  (
Date:   10-27-03 17:06

you either have a blank line or space near the top of the file...remove it or comment it out...php will take any blank space/blank lines to mean that some output is to be sent to the browser


 Re: parse error
Author:  (219.95.99.---)
Date:   04-17-04 22:10

can someone make this parse error correct? i've been thinking how to get the right solutions.

Parse error: parse error in c:\apache\htdocs\eksperi\blocks\block-BeritaHarianPendidikan.php on line 40

$content .= "Berita Semasa";
$content .= "";
$content .= "


 toi chua biet gi` ve trang wet na`y xin dc chi giup
Author:  (203.162.177.---)
Date:   07-28-04 00:33

day la trang wet gi ` vay ? cac ban co the gio thieu cho tui duoc chu ! nhung ma` phai la tieng viet
xin chan thanh` cam on ! bastien wrote:
> missing a '] in the code on line 19
> try showing the code

 Re: parse error
Author:  (
Date:   09-21-04 16:05

I am getting this error:

Parse error: parse error in /home/httpd/vhosts/ on line 32

This is my script that is giving me the problem, can someone help? please? The first line is line 31

$stat = new CVentriloStatus
$stat -> m_cmdprog = "ventrilo_status"; // Adjust accordingly.
$stat -> m_cmdcode = "2"; // Detail mode.
$stat -> m_cmdhost = ""; // ventrilo server.
$stat- > m_cmdport = "3784"; // Port to be statused.
$stat -> m_cmdpass = ""; // password if needed

Go to Top  |  Go to Topic  |  Threaded View  |  Search 
New Topic
 Reply To This Message
 Your Name:
 Your Email:
Email replies to this thread, to the address above.

Provided By