473,405 Members | 2,154 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,405 software developers and data experts.

Feedback form problem

64
I have a feedback form code which does email but does not display the correct content.

In place of the email address, it displays "+1"

And the body message is "1"

It works well when I test it on localhost.

As in

FROM: +1

MESSAGE:+1

What is missing in my code, some body help

My code

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. require_once 'functions.php';
  3. require_once'template.php';
  4.  
  5. Head('Make an Order/enquiry');
  6. ?>
  7.  
  8. <div id="pgcontent">
  9. <h3><em>Place your Order/Enquiry</em></h3>
  10. <?php
  11.  
  12. // Change to your own email address
  13.  
  14. $your_email = "sunny@lavis-casual.com";
  15.  
  16. // This is what is displayed in the email subject line
  17.  
  18. $subject = "LAVIS-CASUAL email order/enquiry";
  19.  
  20. // This is displayed if all the fields are not filled in
  21.  
  22. $empty_fields_message = "<p>Please go back and complete all the fields in the form.</p>";
  23.  
  24. // This is displayed when the email has been sent
  25. $thankyou_message = "<p>Thankyou. Your message has been sent. We will be contacting you shortly.</p>";
  26.  
  27. $name = "";
  28.  
  29. $email = "";
  30.  
  31. $message = "";
  32.  
  33. //Email variables
  34. $name = stripslashes(isset($_POST['txtName']));
  35.  
  36. $email = stripslashes(isset($_POST['txtEmail']));
  37.  
  38. $message = stripslashes(isset($_POST['txtMessage']));
  39.  
  40.  
  41. if (!isset($_POST['txtName'])) {
  42. ?>
  43. <form name="frmOrder" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
  44.     <p>
  45.       <label>Full Name:</label>
  46.       <br>
  47.     <input type="text" title="Enter your name" name="txtName" size="50"></p>
  48.     <p>
  49.       <label>Email address:</label>
  50.       <br>
  51.       <input name="txtEmail" type="text" title="Enter your email address" value="" size="50">
  52.     </p>
  53.     <p><label>Your message:</label><br>
  54.     <textarea name="txtMessage" cols="50" rows="5" title="Enter your message"></textarea>
  55.     </p>
  56.     <p><label title="Send your message">
  57.     <input type="submit" value="Send" onClick="return checkOrder();"></label>
  58.     <input name="Reset" type="reset" value="Clear form">
  59.     </p>
  60. </form>
  61.  
  62. <?php
  63.  
  64. }
  65.  
  66. else {
  67.  
  68.     // Stop the form being used from an external URL
  69.  
  70.     // Get the referring URL
  71.  
  72.     $referer = $_SERVER['HTTP_REFERER'];
  73.  
  74.     // Get the URL of this page
  75.  
  76.     $this_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER["REQUEST_URI"];
  77.  
  78.     // If the referring URL and the URL of this page don't match then
  79.  
  80.     // display a message and don't send the email.
  81.  
  82.     if ($referer != $this_url) {
  83.  
  84.         echo "You do not have permission to access this form from another URL.";
  85.  
  86.         exit;
  87.  
  88.     }
  89.  
  90.     // The URLs matched so send the email
  91.  
  92.     mail($your_email, $subject, $message, "From: $name <$email>");
  93.  
  94.     // Display the thankyou message
  95.  
  96.     echo $thankyou_message;
  97.  
  98. }
  99. ?>
  100. <script>
  101. function checkOrder()
  102. {
  103.     with (window.document.frmOrder) 
  104.     {
  105.         if (txtName.value.length < 3)
  106.             {
  107.             alert('Enter Your full name!');
  108.             txtName.focus();
  109.             return false;
  110.             } 
  111.  
  112.         else if (txtEmail.value.length < 1 || txtEmail.value.indexOf("@", 0) == -1)
  113.         {            
  114.         alert ("Please enter a valid email address!");
  115.         txtEmail.focus();
  116.         return false; 
  117.         }   
  118.  
  119.         else if (txtMessage.value == "") 
  120.         {
  121.             alert('Enter your order/enquiry details!');
  122.             txtMessage.focus();
  123.             return false;
  124.         } 
  125.  
  126.         else 
  127.         {
  128.             return true;
  129.         }
  130.     }
  131. }
  132. </script>
  133. </div>
  134.  
  135. <?php
  136. Footer();
  137. ?>
  138.  
  139.  
Aug 5 '09 #1
0 1409

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

Similar topics

2
by: Mindful_Spirit | last post by:
I'm trying to set up a basic email feed back form like this, and was wondering about some basic configuration settings. I have used code from this website. I have it working just fine. I'm...
7
by: Armand Karlsen | last post by:
On one page of a site I'm doing for a college project, I have a feedback form: http://www.zen62775.zen.co.uk/Test/contact/contact_feedback.html All parts of this page validate, except for the...
6
by: Patrick De Ridder | last post by:
I use a form with text boxes. The user enters data in the text boxes. The data is written away to a file. I wish to give the user feedback on the form, before the data is written away to the file -...
4
by: Michiel Alsters | last post by:
Hello everybody, I hope anybody can help me. I'll try to give a brief overview of my problem. I have running a program that performs a heavy calculation. To give the user feedback what the...
6
by: Zagor | last post by:
I have a feedback form in my website with three TextBoxes and a SEND button in a user control. Below is a piece of the code: //On click event for the send LinkButton private void...
4
by: clintonG | last post by:
I'm wondering if anybody has figured out how to implement this feedback methodology which displays Characters Remaining when using the TextBox TextMode="MultiLine" attribute which will cause the...
4
by: ianbarton | last post by:
Hello all I am trying to setup a feedback form on my webpage using some script provided by my ISP. I really don't know a lot about PHP and it's syntax etc. The feedback form only has 4...
1
by: lali | last post by:
hi everybody, i am doing a project and i have strucked in middle of my code usiong asp. the problem is, in the feedback form there are many fields which are manidatory.when an user fills the form...
9
by: gs | last post by:
the feedback for the install of c#2008 places 97 to 99% cpu load for way too long on athlon x64 3800+ PC. 3/4 an hour later its only about 80% complete, continuing with 98% CPU load! Next time...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...
0
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...
0
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...

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.