473,320 Members | 2,122 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Simple Web Post Form Error (Parse error)

Parse error: syntax error, unexpected T_STRING in /home/pbgwell/public_html/process-form_CC.php on line 16

Hi all! First post so take it easy on me if i make a mistake. I have done many post forms before, and basically I do it "fool proof" way, save the last one as the new one and edit the data. I am not the PHP expert but I am not totally clueless either, and this has worked until now. I have checked for semicolons and quotes, but the thing is, I dont even have to bec I have tested between two different version on a different domain, and the same part of the error code works in one and doesnt in another. I have also checked my web page form code and thats fine too. Here is the code... (not final version but I deleted a lot of stuff to streamline for testing).. I have use that
$headers = "From: $email";
line in all my sites and this is the first time it comes up with an error. I must be missing something else, help!

__________________________________________
Expand|Select|Wrap|Line Numbers
  1.  
  2. <?php
  3. // Pick up the form data and assign it to variables
  4. $firstname = $_POST['firstname'];
  5. $lastname = $_POST['lastname'];
  6. $email = $_POST['email'];
  7.  
  8. // Build the email (replace the address in the $to section with your own)
  9. $to = 'jd@ds.com';
  10. $subject = "PBG.com Service Request from $first $last";
  11. $body = "New Contact Form Information
  12.  
  13. First Name: $firstname
  14. Last Name: $lastname
  15. Email: $email
  16.  
  17. $headers = "From: $email";
  18.  
  19. // Send the mail using PHPs mail() function
  20. mail($to, $subject, $body, $headers);
  21.  
  22. // Redirect
  23. header("Location: form_ty.htm");
  24.  
  25.  
__________________________________________
Aug 24 '10 #1
2 1671
johny10151981
1,059 1GB
check your line 15 in this page. need "; at the end

Expand|Select|Wrap|Line Numbers
  1. Email: $email";
Aug 24 '10 #2
Gezuuuuuuuz.... I know ZERO basic PHP and ya, I guess thats called closing the body tag? Ya just learned that from more research, and easy to miss when you dont know anything... thanks so much for the straightforward and direct response, just what I needed!
Aug 25 '10 #3

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

Similar topics

2
by: entoone | last post by:
I'm getting the following error Parse error: parse error, expecting `','' or `';'' in /home/notarywe/public_html/php/update2.php on line 108 Here is line 108 <input type="text" name="ud_first"...
3
by: Marten van Urk | last post by:
I got the following error in my page Parse error: parse error, unexpected T_ELSE in line 25 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Club</title>...
2
by: Salim | last post by:
Hi people, keep getting this errorParse error: parse error, unexpected T_STRING in order_fns.php line 91. the code is below for the file and I've indicated line 91 <?php function...
4
by: learning_C++ | last post by:
Hi, I try to use input = new istrstream(argv,strlen(argv)); in my code, but it always says error: " error: parse error before `(' token" please help me! Thanks, #include <map>
3
by: bb nicole | last post by:
Below is the code i create when i click on the job title hyperlink, it will display the job information where call from database. But the error message is: Parse error: parse error, unexpected $end...
5
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')...
1
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 ...
1
epots9
by: epots9 | last post by:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/html/xxx.php on line xxx I get that message when i try to run my...
1
by: Phaelle | last post by:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' What does that error mean? I can´t find the mistake!! In another script, I have got another kind of mistake : parse...
14
by: dbldeegd | last post by:
My Java Script executes fine on an test HTML page, but on the required page which is php results in an error. the page The script drops in message box when the page is loaded since the script...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.