help me find the error.

Thread Solved

Join Date: Jan 2009
Posts: 4
Reputation: tracyn2k2 is an unknown quantity at this point 
Solved Threads: 0
tracyn2k2 tracyn2k2 is offline Offline
Newbie Poster

help me find the error.

 
0
  #1
Jan 28th, 2009
Hi everyone, i've just studied basic PHP and i usually study online. I wite this code for contact form.But i cannot find error and fix it-Because i'm new :-). Please help me. Thank very much

  1. ]<?php
  2.  
  3. /* Subject and Email Variable*/
  4.  
  5. $emailSubject = 'Email from Clients';
  6. $webMaster = 'tracyn2k2@yahoo.com';
  7.  
  8. /* Gathering Data Variables */
  9.  
  10.  
  11. $nameField = $_POST['name'];
  12. $emailField = $_POST['email'];
  13. $phonenumberField = $_POST['phonenumber'];
  14. $commentsField = $_POST['comments'];
  15.  
  16. $body = " From: $email\r\n Name: $name\r\n Phone number: $phonenumber\r\n Comments: $comments\r\n";
  17.  
  18. $success = mail($webMaster, $emailSubject, $body);
  19.  
  20. /* Result sender */
  21.  
  22. echo ("
  23. <html>
  24. <head>
  25. <title>Untitled Document</title>
  26. <style type="text/css">
  27. <!--
  28. body {
  29. background-color: #000000;
  30. }
  31. .style1 {
  32. font-family: Arial, Helvetica, sans-serif;
  33. font-size: 0.7em;
  34. color: #FFFFFF;
  35. font-weight: bold;
  36. }
  37. a:link {
  38. text-decoration: none;
  39. color: #FFFF33;
  40. }
  41. a:visited {
  42. text-decoration: none;
  43. color: #FFFF33;
  44. }
  45. a:hover {
  46. text-decoration: none;
  47. color: #0066FF;
  48. }
  49. a:active {
  50. text-decoration: none;
  51. color: #0099FF;
  52. }
  53. -->
  54. </style></head>
  55.  
  56. <body>
  57. <div id="content"><img src="images/banner.jpg" align="top">
  58. <p>&nbsp;</p>
  59. <p class="style1"><a href="index.html">Back to Homepage </a></p>
  60. <p class="style1">&nbsp;</p>
  61. <p class="style1">Dear Clients,</p>
  62. <p class="style1">Thank you for your inquiries. We will reply you within 24 hours.</p>
  63. <p class="style1">&nbsp;</p>
  64. <p class="style1">Best Regards,</p>
  65. <p class="style1">&nbsp;</p>
  66. <p class="style1">Fusion CyberWorks. </p>
  67. </div>
  68. </body>
  69. </html>");
  70. ?>
Last edited by peter_budo; Jan 30th, 2009 at 2:15 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,326
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 162
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: help me find the error.

 
0
  #2
Jan 28th, 2009
  1. echo ("
  2. <html>
  3. <head>
  4. <title>Untitled Document</title>
  5. <style type="text/css">
  6.  
the first dquote in the style declaration ends the text in the echo statement, then there is no semicolon, variable, dot, or other structure php understands so there is an error
replace the dquotes in <style type="text/css"> with single quotes or escape them.
and check the rest of the script <p class="style1" .
These would show up (like above) if you had an editor with syntax highlighting, as do unclosed braces <div>without</div> etc
i use a notepad replacement(google) for that reason
Last edited by almostbob; Jan 28th, 2009 at 6:59 am.
Failure is not an option It's included free
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 4
Reputation: tracyn2k2 is an unknown quantity at this point 
Solved Threads: 0
tracyn2k2 tracyn2k2 is offline Offline
Newbie Poster

Re: help me find the error.

 
0
  #3
Jan 29th, 2009
Hi almostbob. Thank your helping.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC