How do i change the path of data ajax false from returning to homepage, when using a PHP mail form in jquery mobile?

I have a put a php mail form in the quote page of my mobile site. However when i send the form it returns to the route page rather than the quote page, i have used the data ajax false action as i dont want to send via ajax. i have left the thanks page blank as i want it to remain on the same page showing sent or declined message.  Can someone help please? 
<?php
// OPTIONS - PLEASE CONFIGURE THESE BEFORE USE!
$yourEmail = "[email protected]"; // the email address you wish to receive these mails through
$yourWebsite = "www.firstcalltransport.co.uk"; // the name of your website
$thanksPage = ''; // URL to 'thanks for sending mail' page; leave empty to keep message on the same page
$maxPoints = 4; // max points a person can hit before it refuses to submit - recommend 4
$requiredFields = "name,email,collection,delivery,comments"; // names of the fields you'd like to be required as a minimum, separate each field with a comma
// DO NOT EDIT BELOW HERE
$error_msg = array();
$result = null;
$requiredFields = explode(",", $requiredFields);
function clean($data) {
  $data = trim(stripslashes(strip_tags($data)));
  return $data;
function isBot() {
  $bots = array("Indy", "Blaiz", "Java", "libwww-perl", "Python", "OutfoxBot", "User-Agent", "PycURL", "AlphaServer", "T8Abot", "Syntryx", "WinHttp", "WebBandit", "nicebot", "Teoma", "alexa", "froogle", "inktomi", "looksmart", "URL_Spider_SQL", "Firefly", "NationalDirectory", "Ask Jeeves", "TECNOSEEK", "InfoSeek", "WebFindBot", "girafabot", "crawler", "www.galaxy.com", "Googlebot", "Scooter", "Slurp", "appie", "FAST", "WebBug", "Spade", "ZyBorg", "rabaz");
  foreach ($bots as $bot)
  if (stripos($_SERVER['HTTP_USER_AGENT'], $bot) !== false)
  return true;
  if (empty($_SERVER['HTTP_USER_AGENT']) || $_SERVER['HTTP_USER_AGENT'] == " ")
  return true;
  return false;
if ($_SERVER['REQUEST_METHOD'] == "POST") {
  if (isBot() !== false)
  $error_msg[] = "No bots please! UA reported as: ".$_SERVER['HTTP_USER_AGENT'];
  // lets check a few things - not enough to trigger an error on their own, but worth assigning a spam score..
  // score quickly adds up therefore allowing genuine users with 'accidental' score through but cutting out real spam
  $points = (int)0;
  foreach ($badwords as $word)
  if (
  strpos(strtolower($_POST['comments']), $word) !== false ||
  strpos(strtolower($_POST['name']), $word) !== false
  $points += 2;
  if (strpos($_POST['comments'], "http://") !== false || strpos($_POST['comments'], "www.") !== false)
  $points += 2;
  if (isset($_POST['nojs']))
  $points += 1;
  if (preg_match("/(<.*>)/i", $_POST['comments']))
  $points += 2;
  if (strlen($_POST['name']) < 3)
  $points += 1;
  if (strlen($_POST['comments']) < 15 || strlen($_POST['comments'] > 1500))
  $points += 2;
  if (preg_match("/[bcdfghjklmnpqrstvwxyz]{7,}/i", $_POST['comments']))
  $points += 1;
  // end score assignments
  foreach($requiredFields as $field) {
  trim($_POST[$field]);
  if (!isset($_POST[$field]) || empty($_POST[$field]) && array_pop($error_msg) != "Please fill in all the required fields and submit again.\r\n")
  $error_msg[] = "Please fill in all the required fields and submit again.";
  if (!empty($_POST['name']) && !preg_match("/^[a-zA-Z-'\s]*$/", stripslashes($_POST['name'])))
  $error_msg[] = "The name field must not contain special characters.\r\n";
  if (!empty($_POST['email']) && !preg_match('/^([a-z0-9])(([-a-z0-9._])*([a-z0-9]))*\@([a-z0-9])(([a-z0-9-])*([a-z0-9]))+ ' . '(\.([a-z0-9])([-a-z0-9_-])?([a-z0-9])+)+$/i', strtolower($_POST['email'])))
  $error_msg[] = "That is not a valid e-mail address.\r\n";
  if (!empty($_POST['url']) && !preg_match('/^(http|https):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\ /?/i', $_POST['url']))
  $error_msg[] = "Invalid website url.\r\n";
  if ($error_msg == NULL && $points <= $maxPoints) {
  $subject = "Automatic Form Email";
  $message = "You received this e-mail message through your website: \n\n";
  foreach ($_POST as $key => $val) {
  if (is_array($val)) {
  foreach ($val as $subval) {
  $message .= ucwords($key) . ": " . clean($subval) . "\r\n";
  } else {
  $message .= ucwords($key) . ": " . clean($val) . "\r\n";
  $message .= "\r\n";
  $message .= 'IP: '.$_SERVER['REMOTE_ADDR']."\r\n";
  $message .= 'Browser: '.$_SERVER['HTTP_USER_AGENT']."\r\n";
  $message .= 'Points: '.$points;
  if (strstr($_SERVER['SERVER_SOFTWARE'], "Win")) {
  $headers   = "From: $yourEmail\r\n";
  } else {
  $headers   = "From: $yourWebsite <$yourEmail>\r\n";
  $headers  .= "Reply-To: {$_POST['email']}\r\n";
  if (mail($yourEmail,$subject,$message,$headers)) {
  if (!empty($thanksPage)) {
  header("Location: $thanksPage");
  exit;
  } else {
  $result = 'Your mail was successfully sent.';
  $disable = true;
  } else {
  $error_msg[] = 'Your mail could not be sent this time. ['.$points.']';
  } else {
  if (empty($error_msg))
  $error_msg[] = 'Your mail looks too much like spam, and could not be sent this time. ['.$points.']';
function get_data($var) {
  if (isset($_POST[$var]))
  echo htmlspecialchars($_POST[$var]);
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link href="CSS/stylesheetnew.css" rel="stylesheet" type="text/css">
<link href="../jquery-mobile/jquery.mobile-1.0a3.min.css" rel="stylesheet" type="text/css">
<script src="../jquery-mobile/jquery-1.5.min.js" type="text/javascript"></script>
<script src="../jquery-mobile/jquery.mobile-1.0a3.min.js" type="text/javascript"></script>
<style type="text/css">
  p.error, p.success {
  font-weight: bold;
  padding: 10px;
  border: 1px solid;
  p.error {
  background: #ffc0c0;
  color: #F00;
  p.success {
  background: #b3ff69;
  color: #4fa000;
</style>
</head>
<body>
<div data-role="page" id="home">
  <div data-role="header" data-position="fixed">
   <h1>FIRSTCALL TRANSPORT</h1>
</div>
    <div data-role="navbar" data-position="fixed">
                                <ul>
                                  <li><a href="#about">About</a></li>
                                  <li><a href="#services">Services</a></li>
                                  <li><a href="#contact">Contact</a></li>
                                  <li><a href="#quote">Quote</a></li>
                                </ul>
  </div>
  <div data-role="content"> </div>
     <div data-role="footer" data-position="fixed" > </div>
</div>
</div>
<div data-role="page" id="quote">
  <div data-role="header" data-position="fixed">
    <h1>GET A QUOTE</h1>
  </div>
  <div data-role="content">
   <?php
if (!empty($error_msg)) {
  echo '<p class="error">ERROR: '. implode("<br />", $error_msg) . "</p>";
if ($result != NULL) {
  echo '<p class="success">'. $result . "</p>";
?>
<form action="<?php echo basename(__FILE__); ?>" method="post" data-ajax="false"  >
<noscript>
  <p><input type="hidden" name="nojs" id="nojs" /></p>
</noscript>
<p>
  <label for="name">Name: *</label>
  <input type="text" name="name" id="name" value="<?php get_data("name"); ?>" /><br />
  <label for="email">E-mail: *</label>
  <input type="text" name="email" id="email" value="<?php get_data("email"); ?>" /><br />
        <label for="company">Company:</label>
  <input type="text" name="company" id="company" value="<?php get_data("company"); ?>" /><br />
  <label for="collection">Collection: *</label>
  <input type="text" name="collection" id="collection" value="<?php get_data("collection"); ?>" /><br />
    <label for="delivery">Delivery: *</label>
  <input type="text" name="delivery" id="delivery" value="<?php get_data("delivery"); ?>" /><br />
  <label for="comments">Message: *</label>
  <textarea name="comments" id="comments" rows="5" cols="20"><?php get_data("comments"); ?></textarea><br />
  <input type="submit" name="submit" id="submit" value="Send" <?php if (isset($disable) && $disable === true) echo ' disabled="disabled"'; ?> />
</p>
</form>  </div>
     <div data-role="footer" >  </div>
  </div>
  </div>           
</body>
</html>

My wife has left me for four weeks, favouring to be with our son who lives 4,000 km away. I now have to cook for myself and the steaks taste horrible. What am I doing wrong?
If you do not know what I have (not) done to make the steak taste horrible, my question is as hard to answer as your question above.
Please give us more info like giving us the code that sends the page to the homepage rather than to the previous page.

Similar Messages

  • How do i change the email address for my icloud account on my 4s. when i sign in on line it is my new email address so i thought it would change automatically but obviously not!

    how do i change the email address for my icloud account on my 4s. when i sign in on line it is my new email address so i thought it would change automatically but obviously not!

    Settings>iCloud...scroll down...delete account. Then setup iCloud with your new ID.
    You can't change the Apple ID for your iCloud account, you have to delete it.

  • My mother used to be the bill payer on my iTunes account so now every time I send an email from my iCloud account it sent with her name, how can I change the settings so emails are sent from myself?

    My mother used to be the bill payer on my iTunes account so now every time I send an email from my iCloud account it sent with her name, how can I change the settings so emails are sent from myself?
    I've changed the bill payer to myself but it stills says on emails that I sent that its from my mother.

    In order for the "From" field to show you options on the "from" addresses available, you must set them up in the Preferences > Accounts first.
    I can't show you a screen shot of the from field because I currently only have one account, so the from address used is the default. However, when I had more than one, then options will show up in your compose/reply window.
    You'd need to add an account here:

  • How do you change the default setting for RTF documents from TextEdit to MS Word

    How do you change the default setting for RTF documents from TextEdit to MS Word, I download forms from the Canadian government and they use RTF as a standard, they are supposed to open as MS Word documents (Yes I have Office for MAC 2011) but when download the document it goes to TextEdit which messes up the form format. I can down load it right click and go "open with" MS Word but how can I get the default chnaged to save this step.

    richr604 wrote:
    Thanks I knew this, I like Safari as I want to keep everything MAC, but if I use Firefox the documents open in MS Word straight away, I was just curious if there was some setting I could change?
    In Firefox > Preferences, click the Applications tab. If RTF is there, use the pulldown menu in the Action column to pick MS Word. If RTF is not there, there are instructions here for how to add file types.

  • How do I change the name of my new computer from "MacBook Air-2" to "iMac"?

    How do I change the name of my new computer from "MacBook Air-2" to "iMac"?

    Open the Sharing pane of System Preferences and change it.
    (95420)

  • How do I change the reading pane or preview pane from vertical to horizontal in Mail?

    How do I change the reading pane or preview pane from vertical to horizontal in Mail?

    From the Mail menu bar click Mail > Preferences then select the Viewing tab.
    Select:  Use classic layout

  • How do I change the spacing before or after a hard return in Pages 5.5.2?    I am working on an academic article and need to specify paragraph formatting (OS X Yosemite 10.10.2)

    How do I change the spacing before or after a hard return in Pages 5.5.2?    I am working on an academic article and need to specify paragraph formatting (OS X Yosemite 10.10.2)

    Hi Michele,
    Select the paragraphs where you want to change the spacing.
    Format Panel > Text > Spacing
    You can change 1.0 - Single to something else, or type a number in Before or After.
    Regards,
    Ian.

  • How can I change the default setting for downloading photos from email?

    How can I change the default setting for downloading photos from emails I receive?  It shows the default as Photoshop Elements 4.0 and is not supported by this system.  That was my last computer!!
    Thanks,
    Sheila

    That has nothing to do with styles nor Pages, it is a System/Printer Driver setting.
    You can experiment to see if the Printer Settings stick with your document, but in the past this has not worked.
    Peter

  • How can i change the language of OS X Lion from english to any language?

    how can i change the language of OS X Lion from english to any language? i want to change the entire language menu and everything

    Here is the solution of changing the language of the Login Screen:
    I just found the answer in this post: http://support.apple.com/kb/HT4102
    Essentially login with an admin account, open terminal and perform sudo languagesetup
    It then lets you choose the default login language!
    <Edited by Host>
    LL

  • How do I change the preferred application to open documents from Libra office to Microsoft office?

    How do I change the preferred application to open documents from Libra office to Microsoft office?

    Select a document of that type in the Finder, choose Get Info from the File menu, click on Open With, select the desired application, and press the Change All button.
    (116411)

  • How can I change the Microsoft Office Click to Run from drive letter 'Q' to something else?

    How can I change the Microsoft Office Click to Run from drive letter 'Q' to something else?
    We have a legacy app that used drive letter 'Q' already, now the newer machines are coming in with 'Q' preassigned to Microsoft Office Click to Run, and it is causing problems.  There has to be a way to change the drive letter assignment to some
    other letter besides 'Q' 

    Hi,
    Office that is delivered by Click-to-Run is installed on the Q drive, this cannot be changed.
    To work around this problem, uninstall the Click-to-Run version of Office and then install with the traditional MSI-based installation.
    To switch to using an MSI-based Office edition, you can learn something useful from this link below:
    http://office.microsoft.com/en-us/excel-help/click-to-run-switch-to-using-an-msi-based-office-edition-HA101850538.aspx
    Regards,
    Melon Chen
    TechNet Community Support

  • How do you change the My Info data?

    I have a couple of questions I hope someone can help me with.  First, how do you change the data listed on MY INFO?  Secondly, when I go to MY CONTACTS I do not get the + to add or the edit function.  Can someone please help with these questions?

    go to Settings -> General -> Siri->my info and choose from the contact list the right info. If your information in the contact list is wrong, then yu might want to start with correcting that info first

  • How can i change the path for uploadin videos??

    i m using javax.servlet.servletcontext for setting the path for storin upload videos...
    by using the getrealpath able to store videos in web-inf file...
    how can i change the location...

    this is the part of code in which i want to change my storage location:
    ** * The base path corresponds to the base directory of the
    * application context's WEB-INF directory. This means that
    * this directory is NOT visible to the end user.
    public static String getBasePath(javax.servlet.ServletContext context)
    { return context.getRealPath("/") + "WEB-INF" + directorySep;}
    /** * The temporary directory used to store files while they are
    * being uploaded. */
    public static String getTempPath(javax.servlet.ServletContext context)
    { return getBasePath(context); }
    /** * Gets the upload directory - used to indicate the local file
    * system storage area.
    can u tell me now how to change the context value???
    and how to change the storage loction??

  • How do you change the last opened date in Lion?

    In many screens the files are organized automatically by last opened date.  This information is not available when you click command info on the individual file, however, if you list out the files and click on the option to show last opened on the row on the top you will see this information.
    From time to time it is useful to change the creation and modification dates to move where files are displayed in various windows.  While there are utilities and articles about changing the creation and last modified date using third party software or the terminal, I have not been able to find any way to change the last opened date.  This is useful if you wish to hide a file you recently opened so that another user can't just find it as one of the last opened files. 
    When I googled this question all the solutions using terminal either with touch -t or touch -mt commands changed the creation and modification dates, but did not affect the last opened date.
    Anyone have a solution to this?

    Thank you MacNix!!!!!

  • How to manually change the material staging date

    Hi All,
    Please help me to manually change the material staging date in MF60?....
    Problem iam facing is planned order created for 30.06.2011, but when i do staging today it is not staging due to period for july not openned...
    so I manually planned to change the material staging date in MF60...
    Please help me on this...
    Thanks,
    Manikandan.P

    Hi
    Please find the code below for changoing the status in the delivery  and the standard program for updating the status  RVDELSTA
    SELECT SINGLE * from vbfa  where VBTYP_N = 'U' and vbelv = ' '.
    if sy-subrc = 0.
    UPDATE  vbfa  SET PLMIN = ' ' where vbelv = ' '  and vbtyp_n = 'U'.
    endif.
    please go through the bote  445763   if the  problem is in inter company billing proforma
    Regards
    Damu

Maybe you are looking for

  • How can I change the color of a box in book layout?

    I am try to change the color of a photo box when making a book. Will the box print? and if so how can I change the color Thank you Mark

  • An SQL query query

    Hi, I am using ASP, VB and MSAccess. I am trying to pass a parameter from one page to another to drill down. Basically, I have one product entry that is in multiple categories on my website. So, say it's a dress, it is therefore related to category 1

  • Safari 5.1 Shuts Down When Try To Print after upgrade to Lion

    As soon as I upgraded to Lion - I noticed that if I try to print anything in Safari - it shuts down I can use Firefox perfectly - but not Safari I have uninstalled all extensions, and checked through my plugins, but still same problem Any help will b

  • Passing file-handle to a perl routine

    Please Unix guys/gals: I would like to pass a file-handle to a perl routine. In faq5 I've found that wherever perl expects a file-handle, one can supply an integer containing it. As far as I can see both open (handle, ".filename"); $hand = *handle ;

  • How do I achieve Full peace of mind on a tight Budget?

    I am looking to complete an Open Directory Project with managed Network Directories and Networked Home directories. 3TB of available storage should be sufficient (for now). I will be moving users who are use to having their Macs set up as home comput