Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7580305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:53:04+00:00 2026-05-30T17:53:04+00:00

I don’t really understand what’s going on here. I have a jquery script that

  • 0

I don’t really understand what’s going on here. I have a jquery script that sends form post data to a signup script, where upon an email is sent to the user signing up and the users Id is returned back to the calling jquery function where it is forwarded to yet another script for processing.

Problem: The script works great if I leave out the mail function, however, introducing it into the script blocks the variable from being returned to the calling jquery function. Any ideas what’s going on? Here is the Jquery script:

<script>
/* attach a submit handler to the form */
$("#purchaseForm").submit(function(event) {

    var intRegex = /^\d+$/;


/* stop form from submitting normally */
event.preventDefault(); 


    $.post("process_signup.php", $("#purchaseForm").serialize(),function(data){
                                                if(intRegex.test(data)){
                    if(data!=0){
                        alert(data);
                    document.getElementById("bag_contents_hidden").value=data;  
                    $.post("process_order.php", $("#bag_contents").serialize(), function(data2){
                    if(data2){
                    window.location.replace("?process=100&success=1");  
                    }else{
                    window.location.replace("?process=100&fail=1"); 
                    }
                });

            }
        }

else{       //Not Important, validation stuff       


}



        });

  });

//

PHP 
                      if($oid){
               if(mail($email,$title,$message,$headers,'O DeliveryMode=b')){

                    echo $oid;
                    unset($_POST['processorder_hidden']);
                    }else{
                    echo 0; 
                          }
                }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T17:53:05+00:00Added an answer on May 30, 2026 at 5:53 pm

    Since you are expecting a data from the post request any errors generated by mail function is sure to create problems.

    Here is a correct way to solve it

    $status = @mail($to, $subject, $content); //suppress the error generated from being passed to the view
    
    //instead handle it later
    if($status) {
       //handle success
    } else {
      //handle unsuccess
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Don't think that I'm mad, I understand how php works! That being said. I
Don't worry, I'm not going to ask that question, yet again... I am wanting
DON'T ASK WHY but... I have a regex that needs to be case insensitive
Don't understand, if Data.Map is and [] is. I found this out while wondering
Don't yell at me! i have seen many threads claiming that HTML cannot be
Don't you hate it when you have class Foobar { public: Something& getSomething(int index)
Don't let below code scare you away . The question is really simple, only
Don't really know how to formulate the title, but it should be pretty obvious
I don't understand where the extra bits are coming from in this article about
Don't know whats exactly going on, but it's definitely killing my time for nothing.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.