Parse error: syntax error, unexpected T_VARIABLE in C:\Inetpub\vhosts\dspseed.in\httpdocs\dspseed\oder now_mail.php on line 13
my code is as folow : - <?php
-
extract($_POST);
-
-
echo $_POST[product]."<br>".$_POST[variety]."<br>".$_POST[item1]."<br>".$_POST[name]."<br>".$_POST[city]."<br>".$_POST[phone]."<br>".$_POST[add1]."<br>".$_POST[remark]."<br>";
-
-
$recipient=$_POST[mail];
-
$headers = "MIME-Version: 1.0\r\n";
-
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n<br>";
-
$headers .= "To:$recipient\r\n<br>";
-
$headers .= "From: dsp seeds\r\n<br>";
-
-
$to="order@dspseed.in";
-
$subject="From:"$_POST[mail];
-
-
$message.="<div aling=center><strong>Wel come DSP Seeds</strong></div>";
-
$message .= "Crop Name: $_POST[product]<br>";
-
$message .= "Variety: $_POST[variety]<br>";
-
$message .= "Quantity (Item): $_POST[item1]<br>";
-
$message .= "Name: $_POST[name]<br>";
-
$message .= "City: $_POST[city], ";
-
$message .= "Phone No: $_POST[phone]<br>";
-
$message .= "Address: $_POST[add1]<br>";
-
$message .= "Remark: $_POST[remark]<br>";
-
-
if(mail($to, $subject, $message, $headers))
-
{
-
header("Location:ordernow.php?error=success");
-
}
-
-
-
?>
Hi,
Can you please re-post the code using code tags? This will make it easier to read and give some indication of which line is line 13. Also could you post line13 in addition to the full code. This will helps us to help you out.
Thanks
nathj
EDIT>>>>>
It could be that the $message variable is not instantiated before you try adding to it.
Change -
$message.="<div aling=center><strong>Wel come DSP Seeds</strong></div>";
-
to -
$message="<div aling=center><strong>Wel come DSP Seeds</strong></div>";
-
5 11060
It means there is a syntax error on line 13 in oder now_mail.php
Hi,
Can you please re-post the code using code tags? This will make it easier to read and give some indication of which line is line 13. Also could you post line13 in addition to the full code. This will helps us to help you out.
Thanks
nathj
EDIT>>>>>
It could be that the $message variable is not instantiated before you try adding to it.
Change -
$message.="<div aling=center><strong>Wel come DSP Seeds</strong></div>";
-
to -
$message="<div aling=center><strong>Wel come DSP Seeds</strong></div>";
-
The following is where the syntax error occurs: -
$subject="From:"$_POST[mail];
-
You should either be concatenating the variable to the string or using interpolation like so: -
// Concatenation
-
$subject = "From:" . $_POST['mail'];
-
// Interpolation
-
$subject = "From: {$_POST['mail']}";
-
You should also be using, for associative elements of an array, strings. Notice how the above have quotes around the "mail" index. If you had error reporting turned on (which you should for development and testing) then PHP would've complained about this.
Also, why are you extracting the $_POST array and then never using the data? Redundant!
Mark.
Following on from Markus post I can see when reviewing the code again that you have that same issue elsewhere in the code - where $message is compiled. You should follow Markus advice for the debugging - it'll help loads and save tons of time.
Cheers
nathj
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Ehartwig |
last post by:
I recently created a script for user verification, solved my emailing
issues, and then re-created the script in order to work well with the
new PHP 5 that I installed on my server. After...
|
by: Wescotte |
last post by:
The error message Parse error: syntax error, unexpected $end in FILE on
line X is one I run into frequently and I know the cause is I missed an
ending quote.
Is there an easy way to determine...
|
by: Anna MZ |
last post by:
I am new to php and have written the following mysql code to enter the details of a new user in the admin subdomain of my website:
$sql = "INSERT INTO 'users' ('userid', 'username', 'upassword')...
|
by: soidariti |
last post by:
database error - parse error, unexpected $, expecting kEND
AddUserAuthorisationToUsers.rb migration file
1. class AddUserAuthorisationToUsers < ActiveRecord::Migration
2. def self.up
...
|
by: kestrel |
last post by:
I have some html code that is supposed to be displayed by php echo. But for some reason i keep getting a syntax error, and i cant figure out what is going on.
Heres what i have
<?php...
|
by: nazgul42 |
last post by:
I am writing a very simple login script for a website that I am also writing, but when I try to run it, the only error I get is:
Parse error: parse error, unexpected $ in...
|
by: basswhizz |
last post by:
Hi guys im having trouble with somethings else now can you help out thanks!!
Im getting this error message
Parse error: syntax error, unexpected $end
Here's my code cheers!!]
<?php
//...
|
by: brkseven |
last post by:
Looking for help with this Contact Form.
The error is on line 1, but that' doesn't mean a lot, I think. In fact, a php syntax check passed it, but I was hoping for an easy syntax error, it looks...
|
by: vultren |
last post by:
Parse error: syntax error, unexpected $end in
I keep getting that, I have no clue where to fix it. Any help would be VERY APPRECIATED!
<?php
if(isset($_POST)) {
// EDIT THE 2 LINES...
|
by: Adam Pelling |
last post by:
I'm getting this error
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/neblncbt/public_html/forum/includes/acp/acp_board.php on line 69
Here is the...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| | |