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 8918585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:47:35+00:00 2026-06-15T05:47:35+00:00

I am using a simple php form I found here http://www.1stwebdesigner.com/tutorials/custom-php-contact-forms/comment-page-2/#comments But I am

  • 0

I am using a simple php form I found here http://www.1stwebdesigner.com/tutorials/custom-php-contact-forms/comment-page-2/#comments

But I am having few issues with it. When clicking the submit button I want to be able to stay on my website instead of being redirected on mail.php and just print/echo the sent message on my website instead.

Also I want to make the fields have requirements, like not being empty which I know how to do in php but I must first solve the redirect issue.

  • 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-06-15T05:47:37+00:00Added an answer on June 15, 2026 at 5:47 am

    What you need is $.ajax from jQuery. This will send a POST request without reloading the page.

    Lets say your button is called myButton then for the onClick() event you would call the function

    $.ajax({
      type: "POST",
      url: "some.php",
      data: { name: "John", location: "Boston" }
    }).success(function( msg ) {
      alert( "Data Saved: " + msg );
    });
    

    In your some.php you would then just use $_POST['name'] and $_POST['location'] to retrieve the information.

    Edit

    Suppose you had an input field. You can retrieve information from such a field via jQuery as well. You can just then send the information from the input field via ajax to you php script

    $('#yourInputField').val();
    

    where yourInputField is the ID of the input field. With this you can get this information to the script. If you have multiple elements in a form you might want to look at the function serialize(). Does the same thing in principle, just compresses all the information into a JSON string.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is a simple form I am using to send XML data in admin_xml.php
I'm using a simple web form and some PHP script to send the completed
I have a relatively simple question. Will using PHP guarantee that a form is
Does anyone have any experience positioning the jquery.datepicker found at http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerClickInput.html Functionality-wise it works
I'm using a very simple PHP form on my websites, but the form will
I'm using a simple form to upload 5 files: <form enctype=multipart/form-data action=openaccount.php method=post> <h4>Proof
I'm using jQuery to post a form to a php file, simple script to
i am trying to do a simple form that adds a new comment using
I am using simple PHP query to fetch rows from the database, there are
I am using PHP Simple HTML DOM Parser and it is consuming a lot

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.