Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Rate our service form
Old 01-06-2009, 12:41 PM Rate our service form
Novice Talker

Posts: 13
Name: Jean-Pierre
Trades: 0
Hi guys,

Can someone please assist me in creating service rating form. I have gotten so far, but I always get a Parse error: syntax error.

Here is my html code:
HTML Code:
 <th scope="col"><form action="rateservice.php" method="post" class="contentsmall2">
                <br />
                <table border="0" align="center" bordercolor="#87A019" bgcolor="#F1F1F1">
                  <tr>
                    <td colspan="2">&nbsp;</td>
                  </tr>
                  <tr>
                    <td class="contentsmall2">Department:</td>
                    <td><span class="style3">
                      <select name="sendto" class="contentsmall">
                        <option value="jp@blogbytes.co.za">Complaint</option>
                        <option value="jp@blogbytes.co.za">Suggestion</option>
                                            </select>
                    </span></td>
                  </tr>
                                    <tr>
                    <td class="contentsmall2">Service Rating</td>
                    <td><label>
                      <select name="service" class="contentsmall" id="service">
                        <option value="Excellent">Excellent</option>
                        <option value="Good">Good</option>
                        <option value="Fair">Fair</option>
                        <option value="Poor">Poor</option>
                        <option value="No Comment">No Comment</option>
                                                                  </select>
                    </label></td>
                                    </tr>
                  <tr>
                  <tr>
                    <td class="contentsmall2">* Name:</td>
                    <td><input name="Name" class="contentsmall" size="25" /></td>
                  </tr>
                  <tr>
                    <td class="contentsmall2">* Email:</td>
                    <td><input name="Email" class="contentsmall" size="25" /></td>
                  </tr>
                  <tr>
                    <td class="contentsmall2">* Company:</td>
                    <td><input name="Company" class="contentsmall" size="25" /></td>
                  </tr>
                  <tr>
                    <td class="contentsmall2"><span class="style3">* Phone:</span></td>
                    <td><input name="Phone" class="contentsmall" size="25" /></td>
                  </tr>
                  <tr>
                    <td class="contentsmall2"><span class="style3">Subject:</span></td>
                    <td><input name="Subject" class="contentsmall" size="25" /></td>
                  </tr>
                  <tr>
                    <td colspan="2">Message:</td>
                  </tr>
                  <tr>
                    <td colspan="2" align="center"><span class="style3">
                      <textarea name="Message" cols="35" rows="5" class="contentsmall"></textarea>
                    </span></td>
                  </tr>
                  <tr>
                    <td colspan="2" align="center"><input name="send" type="submit" value="Submit" /></td>
                  </tr>
                  <tr>
                    <td colspan="2" align="center"><small>* Indicates a required field</small></td>
                  </tr>
                </table>
              </form></th>
            </tr>
          </table>
          <br />
        </div>
Here the php:
PHP Code:
<?php 
$to 
$_REQUEST['sendto'] ; 
$from $_REQUEST['Email'] ; 
$name $_REQUEST['Name'] ; 
$headers "From: $from"
$subject "Complaint";
$service "Service Rating";

$fields = array(); 
$fields{"Name"} = "Name"
$fields{"Company"} = "Company"
$fields{"Email"} = "Email"
$fields{"Phone"} = "Phone"
$fields{"Subject"} = "Subject"
$fields{"Message"} = "Message"

$body "We have received the following information:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } 

$headers2 "From: info@blogbytes.co.za"
$subject2 "Thank you for contacting us"
$autoreply "Thank you for contacting us. Somebody will get back to you as soon as possible. If you have any more questions, please contact us on 086-121-0-121";

if(
$from == '') {print "You have not entered an email, please go back and try again";} 
else { 
if(
$name == '') {print "You have not entered a name, please go back and try again";} 
else {
if(
$company == '') {print "You have not entered a Company Name, please go back and try again";} 
else {
$send mail($to$subject$body$headers$service); 
$send2 mail($from$subject2$autoreply$headers2); 
if(
$send
{
header"Location: http://lee.blogbytes.co.za/thankyou.html" );} 
else 
{print 
"We encountered an error sending your mail, please notify info@blogbytes.co.za"; } 
}
}
?>
Thanks in advance
jp1981 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-06-2009, 01:15 PM Re: Rate our service form
NullPointer's Avatar
Will Code for Food

Posts: 2,784
Name: Matt
Location: Irvine, CA
Trades: 0
The error you are getting is caused by your php code, not your html. It will be easier to find the error in properly formatted code. If statements, loops, and other blocks should not all be on one line:
PHP Code:
if($from == '')
{
     print 
"blah blah";
}
else
{
     if(
x)
     {
          
//dont forget to tab your code
     
}

Also avoid putting more than one statment on one line, a semicolon almost always means you should start a new line (exception: for loops).

Format you code and then I'll bet the error will stand out.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by NullPointer; 01-06-2009 at 01:17 PM..
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Reply     « Reply to Rate our service form
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10201 seconds with 12 queries