473,769 Members | 2,249 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

php form parse error

Hi,
I know i shouldn't work on php forms when i'm going on 30 hours of no sleep,
but i did anyway. I'm trying to get the below to work, and i keep getting a
parse error line 74, an unexpected
','
there is none, so i'm assuming it's on another line, i've checked around,
but don't see it. I'm probably missing something so simple that i'll call
myself dumb for a month, but that's later, as of now i'd appreciate any
help/suggestions.
Thanks.
Dave.
<?php
// orderform.php script
// Created 20040730 by Dave M Mehler
// Purpose: collect order form information, process it, data verification,
// email designated users, and redirect visitor to a thank you page.
?>
<html>
<head>
<title>streetfr eakzperformance product order</title>
</head>
<body bgcolor="#fffff f" text="#000000" link="#cbda74" vlink="#808040"
alink="#808040" >
<?
$form = "
<form action=\"orderf orm.php\" method=\"post\" >
<input type=\"hidden\" name=\"seenform \" value=\"y\">
<h1>Streetfreak zperformance Product Ordering Page</h1>
<p>Thank you for wishing to purchase products produced by
<b>streetfreakz performance.com </b>! Please fill out the following form,
fields marked with a * (*) are required. You will recieve a confirmation
email</p>
Your Name:<br />
<input type=\"text\" name=\"name\" size=\"20\" maxlength=\"20\ "
value=\"\"><br />
Your Email:<br />
<input type=\"text\" name=\"email\" size=\"20\" maxlength=\"40\ "
value=\"\"><br />
Your Comments:<br />
<textarea name=\"comments \" rows=\"3\" cols=\"30\"></textarea><br />
<input type=\"submit\" value=\"submit! \">
<input type=\"clear\" value=\"clear!\ ">
</form>
";
// If we haven't already seen the form ($seenform passed by hidden
// form value), show the form.
if ($seenform != "y") :
print "$form";
// The user has filled out the form. Now verify the information
else :
$error_flag = "n";
// ensure that the name variable is not empty
if ($name == "") :
print "<font color=\"red\">* You forgot to enter your name!</font>
<br />";
$error_flag = "y";
endif;
// ensure that the email variable is not empty
if ($email == "") :
print "<font color=\"red\">* You forgot to enter your email!</font>
<br />";
$error_flag = "y";
else :
// convert all email alphabetical characters to lowercase
$email = strtolower(trim ($email));
// ensure the email address is of valid syntax
if (! @eregi('^[0-9a-z]+'.
'@'.
'([0-9a-z-]+\.)+'.
'([0-9a-z]){2,4}$', $email)) :
print "<font color=\"red\">* You entered an invalid email
address!</font> <br />";
$error_flag = "y";
endif;
endif;
endif;
// If the $error_flag has been set, redisplay the form
if ($error_flag == "y") :
print "$form";
else :
// change $recipient to be the recipient of the form information
$recipient = "te******@examp le.com";
// email subject
$subject = "streetfreakzpe rformance product order request ($name)";
// extra email headers
$headers = "From: $email";
// send the email or produce an error
mail($recipient , $subject, $comments, $headers) or die("Could not send
email!");
// send the user an appropriate message
print "Thank you", $name, "for taking a moment to send us your comments!";
endif;
?>
</body>
</html>
Jul 17 '05 #1
3 2001
dave wrote:
print "Thank you", $name, "for taking a moment to send us your comments!";

Concatenation is made with . and not with ,

Aphrael
--
"La demande mondiale d’ordinateurs n’excédera pas cinq machines."
(Thomas Watson, Fondateur d'IBM, 1945)
Jul 17 '05 #2
On Fri, 30 Jul 2004 14:19:14 +0000, dave wrote:
Hi,
I know i shouldn't work on php forms when i'm going on 30 hours of no sleep,
but i did anyway. I'm trying to get the below to work, and i keep getting a
parse error line 74, an unexpected
','
there is none, so i'm assuming it's on another line, i've checked around,
but don't see it. I'm probably missing something so simple that i'll call
myself dumb for a month, but that's later, as of now i'd appreciate any
help/suggestions.
Thanks.
Dave.

[ snip ]

print "Thank you", $name, "for taking a moment to send us your comments!";

[ snip ]
Ahh Perl coder eh? =)

PHP doens't recognise commas for concatenation purposes, but rather the
"normal" . (dot).
HTH.

Regards,

Ian

--
Ian.H
digiServ Network
London, UK
http://digiserv.net/

Jul 17 '05 #3
On Fri, 30 Jul 2004 16:11:09 GMT, "Ian.H" <ia*@WINDOZEdig iserv.net> wrote:
On Fri, 30 Jul 2004 14:19:14 +0000, dave wrote:
I know i shouldn't work on php forms when i'm going on 30 hours of no sleep,
but i did anyway. I'm trying to get the below to work, and i keep getting a
parse error line 74, an unexpected
','
there is none, so i'm assuming it's on another line, i've checked around,
but don't see it. I'm probably missing something so simple that i'll call
myself dumb for a month, but that's later, as of now i'd appreciate any
help/suggestions.


[ snip ]
print "Thank you", $name, "for taking a moment to send us your comments!";


[ snip ]

Ahh Perl coder eh? =)

PHP doens't recognise commas for concatenation purposes, but rather the
"normal" . (dot).


Although something similar with echo:

echo "Thank you", $name, "for taking a moment to send us your comments!";

... would work, as it takes a variable number of arguments and prints them
all.

--
Andy Hassall <an**@andyh.co. uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4111
by: Steven | last post by:
I got a "Parse error: parse error in ..." in this line: if(empty($_POST){ ..... But if I fist assign $ssn=$_POST; and then if(empty($ssn){ ... it is working. Any advice? Thanks in advance.
6
3547
by: Roy G. Vervoort | last post by:
With them help of newsgroups I created a form that makes it possible to sent an email with an attachement thats on the internet.. How can i attache a file thats on the users harddrive? this works great (i upladed the file bijlage.doc) "FileName"=>"http://www.royvervoort.nl/testatt/bijlage.doc", i would like to attche the file from my c drive
9
944
by: Jason | last post by:
I'm struggling with this email code and I'm not php freak since I'm starting to learn php stuff. Could use some help... It seems that I get too many parse errors all over and cannot figure went wrong since most of these appears right to me... <?PHP $to = "scoobyood@jace41.com" ; $name = $_POST ;
8
6557
by: Greg A | last post by:
Hi: I have my index.php page. For the header, sidebar, and footer, those are separate php pages that I call into the index.php page. My sidebar.php page has a form in it, that works fine if I load the page by itself. However when I try to use it in the index.php page being called by an include, it doesn't work.
3
5652
by: John | last post by:
Dear all, It been more than 3 days I am trying to debug this program, I interpret it using activePerl and it is giving (perl -wc code_process.pl) no error syntax but when I put it online, change to the appropriate mode and test the html form it gave me an 500 internel server error. I really need it to be done soon, I would not post here before I test it as much as I can,
10
600
by: headware | last post by:
I know that you can call the method of one from from inside another form by doing something like this Forms("MyForm").MyFunction(12, 34) However, you have to know that MyForm has a function called MyFunction. Can you specify a string for the function name like you can with the form name? That is can I do something like Forms("MyForm")."MyFunction"
13
2380
by: Vesuvius2001 | last post by:
hi im wondering is anyone can help me with this peice of code what i am trying todo is to create a register page where users type information which goes into a database heres the code FORM CODE <html> <head> <title>Signup Form</title>
0
1915
by: kammaldeep | last post by:
hi, i m newbie 2 PHP & to b frank ... will alwaz be ... i dont think i will go into much details with PHP as my work doesnot include workin with PHP bt i have a forum .. and i want to make a personal contact page in it .... and save all details in my new database.... i have website in the root folder i get dis error
1
1350
by: atiq | last post by:
I want the thank page to be displayed for about second after the user has submit the form and then to go to another URL say, http://www.google.com. Below is the code: <?php // $mailto - set to the email address you want the form // sent to, eg //$mailto = "youremailaddress@example.com" ; $mailto = 'atiqisthebest@hotmail.com' ; // $subject - set to the Subject line of the email, eg
0
9424
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10223
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10000
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9866
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8879
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3968
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3571
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.