473,320 Members | 1,916 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.

How can change the error

Parse error: syntax error, unexpected T_STRING in /home/glass9st/public_html/DEMO1/contact.php on line 7



In php code below

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. /* Set e-mail recipient */
  3. $myemail  = "cvinod46@gmail.com";
  4.  
  5. /* Check all form inputs using check_input function */
  6. $yourname = check_input($_POST['yourname'], "Enter your name");
  7. $subject  = check_input($_POST['subject'], "Write a subject");
  8. $email    = check_input($_POST['email']);
  9. $website  = check_input($_POST['website']);
  10. $likeit   = check_input($_POST['likeit']);
  11. $how_find = check_input($_POST['how']);
  12. $comments = check_input($_POST['comments'], "Write your comments");
  13.  
  14. /* If e-mail is not valid show error message */
  15. if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email))
  16. {
  17.     show_error("E-mail address not valid");
  18. }
  19.  
  20. /* If URL is not valid set $website to empty */
  21. if (!preg_match("/^(https?:\/\/+[\w\-]+\.[\w\-]+)/i", $website))
  22. {
  23.     $website = '';
  24. }
  25.  
  26. /* Let's prepare the message for the e-mail */
  27. $message = "Hello!
  28.  
  29. Your contact form has been submitted by:
  30.  
  31. Name: $yourname
  32. E-mail: $email
  33. URL: $website
  34.  
  35. Like the website? $likeit
  36. How did he/she find it? $how_find
  37.  
  38. Comments:
  39. $comments
  40.  
  41. End of message
  42. ";
  43.  
  44. /* Send the message using mail() function */
  45. mail($myemail, $subject, $message);
  46.  
  47. /* Redirect visitor to the thank you page */
  48. header('Location: thanks.html');
  49. exit();
  50.  
  51. /* Functions we used */
  52. function check_input($data, $problem='')
  53. {
  54.     $data = trim($data);
  55.     $data = stripslashes($data);
  56.     $data = htmlspecialchars($data);
  57.     if ($problem && strlen($data) == 0)
  58.     {
  59.         show_error($problem);
  60.     }
  61.     return $data;
  62. }
  63.  
  64. function show_error($myError)
  65. {
  66. ?>
  67.     <html>
  68.     <body>
  69.  
  70.     <b>Please correct the following error:</b><br />
  71.     <?php echo $myError; ?>
  72.  
  73.     </body>
  74.     </html>
  75. <?php
  76. exit();
  77. }
  78. ?>

what can i do
Oct 5 '11 #1
1 1356
omerbutt
638 512MB
i didnt get any errors its working correctly try to check if there is any extra space after <?php starting tag
regards
Omer Aslam
Oct 5 '11 #2

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

Similar topics

9
by: Marina Anufreichik | last post by:
Hi, After deploymnet web application on web server I can access page on local machine and login fine but when I'm trying to access web site from remote machine I can see login page, but when I'm...
5
by: xuatla | last post by:
Hi, I encountered the following compile error of c++ and hope to get your help. test2.cpp: In member function `CTest CTest::operator+=(CTest&)': test2.cpp:79: error: no match for 'operator='...
1
by: Avery Fong | last post by:
The following program will result in a compile error when building under Debug but will compile under Release. Why does is work under Release mode but not under Debug This program is developed...
9
by: Tim D | last post by:
Hi, I originally posted this as a reply to a rather old thread in dotnet.framework.general and didn't get any response. I thought it might be more relevant here; anyone got any ideas? My...
9
by: Jamie | last post by:
I am receiving an Invalid ViewState error after posting back to the same page twice. Consistently the error occurs after the second postback and not after the first. I have looked into creating...
0
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...
0
by: Pulak Kumar Mishra | last post by:
When Change password using SetPassword option. an exception occur and not update password of login.
3
by: mjcjc | last post by:
hi, pls help me out urgently i got the following error when i was trying to create a new document in XML spy v2007 but i dint get any error when using v2004. pls let me know ASAP what to do to...
6
by: DanteEllis | last post by:
Hi, I am using Microsoft Office 2003, but save my Databases in Access 2000 format. I have a table for user verification. I have a login form which works well. I am trying to make a form to...
0
by: drylio | last post by:
Hello, I have one problem. I installing oracle 8.1 with apache (Oracle http server powered by apache, windows 2000 professional) and configure them, but i misunderstand why can't change erros...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
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 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.