By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,225 Members | 2,170 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,225 IT Pros & Developers. It's quick & easy.

parse error, unexpected T_VARIABLE

P: 1

I'm getting this error in my code (trying to make a submit button work) and can't figure out what the problem is. Can someone help me?

Parse error: parse error, unexpected T_VARIABLE in C:\Inetpub\vhosts\\httpdoc s\contact.php on line 3

Here is the code:[php]<?php
$your_name = $_GET['name'];
$your_E-mail = $_GET['email'];
$your_message_here = $_GET['message'];
$recipient_email = “ ”
$subject = “from ” . $your_E-mail;
$headers = “From: ” your_name .” <” . $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>";
<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.
<script>resizeTo(300, 300)</script>[/php]redsky
May 1 '08 #1
Share this Question
Share on Google+
4 Replies

P: 158
On line 3 of your script you cannot declare a variable with '-' change that to a underscore and it should work.
May 1 '08 #2

Expert 100+
P: 1,168
And use code tags in your posts!
May 2 '08 #3

Expert 5K+
P: 6,050
be sure to change all the oter $your_Emails because you swtich between lower and uppercase, hypen and no hypen.
May 2 '08 #4

Expert 2.5K+
P: 4,258
Please enclose your posted code in [code] tags (See How to Ask a Question).

This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

Please use [code] tags in future.

May 2 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.