Free Web Hosting Forum
Go Back   Free Web Hosting Forum > Website Building > Scripts and Code Snippets
Reload this Page Getting an error from server when pushing send button (contact/form.php)
Reply
 
Thread Tools Display Modes
(#1 (permalink))
Old
Junior Member
Gangsta2Guns is on a distinguished road
 
Posts: 8
Join Date: Jun 2009
Default Getting an error from server when pushing send button (contact/form.php) - 06-07-2009, 11:36 PM

Think i posted this in a wrong section.. so i post it here too...

Hi i own a Flash website and in that one i have a contact form witch users can send me feed back in... but if i use the form i get this error message back from the server..

PHP Error Message

Parse error: syntax error, unexpected '"' in /home/a8325874/public_html/contact.php on line 10

Free Web Hosting

This is the php im using... I suspect its an error im my code but i cant seem to find it, and if im wrong how do i get it to work on this server?

PHP Code:
<?php  

    
    $your_name 
$_GET['name'];  
    
$your_email $_GET['email'];  
    
$your_message $_GET['message'];  
     
    
$recipient_email "scripts4he@yahoo.com"

    
$subject "from: " $your_email"; 
    $headers = "
From" . $yourname . " <" . $your_email . ">n
    
$headers .= 'Content-type: text/html; charset=iso-8859-1';  
     
    
$content "<html><head><title>Contact letter</title></head><body><br>";   
    
$content .= "Name: <b>" $your_name "</b><br>";  
    
$content .= "E-mail: <b>" $your_email "</b><br><hr><br>";  
    
$content .= $your_message;  
    
$content .= "<br></body></html>";  

    
mail($recipient_email,$subject,$content,$headers);  
?>  
<html>  
    <body bgcolor="#282E2C">  
        <div align="center" style="margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold">  
            Your message was sent. Thank you.  
        </div>  
    </body>  
</html>  
<script>resizeTo(300, 300)</script>

Last edited by Gangsta2Guns; 06-07-2009 at 11:39 PM.
Reply With Quote
(#2 (permalink))
Old
Leder678's Avatar
Senior Member
Leder678 is on a distinguished road
 
Posts: 1,338
Join Date: Jan 2009
Location: Norway
Send a message via MSN to Leder678
Default 06-09-2009, 10:19 PM

Code:
<?php   

     
    $your_name = $_GET['name'];   
    $your_email = $_GET['email'];   
    $your_message = $_GET['message'];   
      
    $recipient_email = "scripts4he@yahoo.com";  

    $subject = "from: " . $your_email;  
    $headers = "From: " . $yourname . " <" . $your_email . ">n;  
    $headers .= 'Content-type: text/html; charset=iso-8859-1';   
      
    $content = "<html><head><title>Contact letter</title></head><body><br>";    
    $content .= "Name: <b>" . $your_name . "</b><br>";   
    $content .= "E-mail: <b>" . $your_email . "</b><br><hr><br>";   
    $content .= $your_message;   
    $content .= "<br></body></html>";   

    mail($recipient_email,$subject,$content,$headers);   
?>   
<html>   
    <body bgcolor="#282E2C">   
        <div align="center" style="margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold">   
            Your message was sent. Thank you.   
        </div>   
    </body>   
</html>   
<script>resizeTo(300, 300)</script>
There you go, look at this line and see if you can find the error without looking at the code above:

Code:
$subject = "from: " . $your_email";
Hint it's a " as it says in the php error message.



Site showcase: PremiumScriptingdotCOM

Follow me on twitter @PScripting

Please AT LEAST read the 10 bolded lines of the TOS at:
http://www.000webhost.com/includes/tos.php
Reply With Quote
Reply

Thread Tools
Display Modes

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




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com