found solution on this forum now have new error!

This is a discussion on "found solution on this forum now have new error!" within the PHP Forum section. This forum, and the thread "found solution on this forum now have new error! are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Oct 24th, 2007, 13:25
Junior Member
Join Date: Sep 2007
Location: Cumbria
Age: 24
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
found solution on this forum now have new error!

I used a tutorial to make an email form using php.

First I was only recieving 1 piece of info from the form in the email, then i was recieving an error message but I thought I had found the solution here http://www.webforumz.com/php-forum/8...il-expects.htm

But now I recieve this error message

"Parse error: syntax error, unexpected T_ELSE in D:\vhosts\solidmasonry.co.nz\httpdocs\sendmail.php on line 34"

the code i'm using is
PHP: Select all

<?php
  $title 
$_REQUEST['title'] ;
  
$firstname $_REQUEST['firstname'] ;
  
$lastname $_REQUEST['lastname'] ;
  
$email $_REQUEST['email'] ;
  
$location $_REQUEST['location'] ;
  
$locother  $_REQUEST['locother'] ;
  
$message $_REQUEST['message'] ;
  
$findus $_REQUEST['findus'] ;

  if (!isset(
$_REQUEST['email'])) {
    
header"Location: 

http://www.solidmasonry.co.nz/quote.html
);
  }
  elseif (empty(
$email) || empty($message)) {
    
?>

    <html>
    <head><title>Error</title></head>
    <body>
    <h1>Error</h1>
    <p>
    Oops, it appears you forgot to enter either your
    email address or your message. Please press the BACK
    button in your browser and try again.
    </p>
    </body>
    </html>

    <?
  
}
  
$embody "$title $firstname $lastname $email $location 

 $locother $message $findus"
;

else {
    
mail"Myemail@gmail.com""Quote Form",
 
$message $embody"From: $email" );
    
header"Location: 

http://www.solidmasonry.co.nz/index.html
);
  }
?>
Can any one see the problem?
I'm a complete virgin to php!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Oct 24th, 2007, 13:33
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: found solution on this forum now have new error!

} <--- (Remove this curly brace

$embody = "$title $firstname $lastname $email $location $locother $message $findus";
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Oct 24th, 2007, 13:45
Junior Member
Join Date: Sep 2007
Location: Cumbria
Age: 24
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Re: found solution on this forum now have new error!

tried removing the curly bracket but still getting the same error message!

Any other suggestions??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Oct 24th, 2007, 13:49
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: found solution on this forum now have new error!

Add curly brace there --> }else {

mail( "Myemail@gmail.com", "Quote Form", $message $embody, "From
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Oct 24th, 2007, 13:53
Junior Member
Join Date: Sep 2007
Location: Cumbria
Age: 24
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Re: found solution on this forum now have new error!

now it says the error is on line 36!!
AAAAAAARRRRRRRGGGGGGGGGHHHHHHH!!!!!!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Oct 24th, 2007, 14:07
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: found solution on this forum now have new error!

Few deep breaths -- everyone gets an annoying but or 30

PHP: Select all

<?php

  $title 
$_REQUEST['title'] ;
  
$firstname $_REQUEST['firstname'] ;
  
$lastname $_REQUEST['lastname'] ;
  
$email $_REQUEST['email'] ;
  
$location $_REQUEST['location'] ;
  
$locother  $_REQUEST['locother'] ;
  
$message $_REQUEST['message'] ;
  
$findus $_REQUEST['findus'] ;

if (!isset(
$_REQUEST['email'])) {
    
header"Location: http://www.solidmasonry.co.nz/quote.html);

} else if (empty(
$email) || empty($message)) {

?>

    <html>
    <head><title>Error</title></head>
    <body>
    <h1>Error</h1>
    <p>
    Oops, it appears you forgot to enter either your
    email address or your message. Please press the BACK
    button in your browser and try again.
    </p>
    </body>
    </html>
<?
} else {

    
$embody "$title $firstname $lastname $email $location $locother $message $findus";

    
mail"Myemail@gmail.com""Quote Form",
     
$message $embody"From: $email" );
    
header"Location: http://www.solidmasonry.co.nz/index.html);
  }
?>
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Oct 24th, 2007, 14:16
Junior Member
Join Date: Sep 2007
Location: Cumbria
Age: 24
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Re: found solution on this forum now have new error!

Parse error: syntax error, unexpected T_VARIABLE in D:\vhosts\solidmasonry.co.nz\httpdocs\sendmail.php on line 70

Line 70 is
mail( "Myemail@gmail.com", "Quote Form",
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Oct 24th, 2007, 14:21
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: found solution on this forum now have new error!

add a fullstop between $message and $embody
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Oct 24th, 2007, 14:50
Junior Member
Join Date: Sep 2007
Location: Cumbria
Age: 24
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Re: found solution on this forum now have new error!

New error message

Warning: Cannot modify header information - headers already sent by (output started at D:\vhosts\solidmasonry.co.nz\httpdocs\sendmail.php :2) in D:\vhosts\solidmasonry.co.nz\httpdocs\sendmail.php on line 71
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Oct 24th, 2007, 15:04
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: found solution on this forum now have new error!

put ob_start(); at the top of your code and ob_end_flush just after the header.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Oct 24th, 2007, 15:05
Junior Member
Join Date: Sep 2007
Location: Cumbria
Age: 24
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Re: found solution on this forum now have new error!

This is doing my head in now!

this is the code for the form

Code: Select all
<form method="post" action="sendmail.php">
<select name="title">
<option value="mr">Mr</option>
<option value="mrs">Mrs</option>
<option value="miss">Miss</option>
<option value="ms">Ms</option>
<option value="other">Other</option>
</select><br/>
  First Name:<input name="firstname" type="text" /><br/>
  Last Name:<input name="lastname" type="text" /><br/>
  Email: <input name="email" type="text" /><br />
  Location: <select name="location">
<option value="city">Auckland - Auckland City</option>
<option value="franklin">Auckland - Franklin</option>
<option value="gbisland">Auckland - Great Barrier Island</option>
<option value="helensville">Auckland - Helensville</option>
<option value="hibcoast">Auckland - Hibiscus Coast</option>
<option value="manukau">Auckland - Manukau City</option>
<option value="northshore">Auckland - North Shore</option>
<option value="papakure">Auckland - Papakura City</option>
<option value="waitakere">Auckland - Waitakere City</option>
<option value="warkworth">Auckland - Warkworth</option>
<option value="wellsford">Auckland - Wellsford</option>
<option value="other">Other</option>
</select></br>
If other location please tell us: <input name="locother" type="text" /><br/>
  What work do you require?:<br />
  <textarea name="message" rows="15" cols="40">
  </textarea><br />
Where did you hear about us?<input name="findus" 

type="text" /><br/>
  <input type="submit"  value="Request Quote"/>
</form>
all I want is for the information selected by the client to be sent to my email.

Somebody HELP please *flutters eyelashes*
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Oct 24th, 2007, 15:10
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: found solution on this forum now have new error!

Did you do what I just said? Any errors?
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old Oct 24th, 2007, 15:23
Junior Member
Join Date: Sep 2007
Location: Cumbria
Age: 24
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Re: found solution on this forum now have new error!

I think I did what you said

PHP: Select all


    <?php

      ob
-start();

      
$title $_REQUEST['title'] ;

      
$firstname $_REQUEST['firstname'] ;

      
$lastname $_REQUEST['lastname'] ;

      
$email $_REQUEST['email'] ;

      
$location $_REQUEST['location'] ;

      
$locother  $_REQUEST['locother'] ;

      
$message $_REQUEST['message'] ;

      
$findus $_REQUEST['findus'] ;



    if (!isset(
$_REQUEST['email'])) {

        
header"Location: 

http://www.solidmasonry.co.nz/quote.html
);



    } else if (empty(
$email) || empty($message)) {



    
?>



        <html>

        <head><title>Error</title></head>

        <body>

        <h1>Error</h1>

        <p>

        Oops, it appears you forgot to enter either your

        email address or your message. Please press the BACK

        button in your browser and try again.

        </p>

        </body>

        </html>

    <?

    
} else {



        
$embody "$title $firstname $lastname $email $location 

$locother $message $findus"
;


        
mail"katrina.lemon@gmail.com""Quote Form",

          
$message$embody"From: $email" );

        
header"Location: 

http://www.solidmasonry.co.nz/index.html
);

      }

ob_end_flush

    ?>
this is is error code

Fatal error: Call to undefined function: start() in D:\vhosts\solidmasonry.co.nz\httpdocs\sendmail.php on line 4

maybe i misunderstood your instructions
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #14  
Old Oct 24th, 2007, 15:24
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: found solution on this forum now have new error!

Use:
PHP: Select all

ob_start() 


not:
PHP: Select all

ob-start() 

Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #15  
Old Oct 24th, 2007, 15:28
Junior Member
Join Date: Sep 2007
Location: Cumbria
Age: 24
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Re: found solution on this forum now have new error!

changed that sorry

Error message

Warning: Cannot modify header information - headers already sent by (output started at D:\vhosts\solidmasonry.co.nz\httpdocs\sendmail.php :2) in D:\vhosts\solidmasonry.co.nz\httpdocs\sendmail.php on line 73
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!