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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:21:14+00:00 2026-05-31T12:21:14+00:00

I am just started with PHP and have a rather simple problem I can’t

  • 0

I am just started with PHP and have a rather simple problem I can’t seem to figure out. I have set up a basic PHP script with will send me the content from my sites contact page. The script itself is fine – and so is the validator. Now what I am trying to achieve is getting a simple popup (similar to an alert function in javascript). Here is my try:

if ($valid) {
        //*isUTF8($subject);
        //*isUTF8($formcontent);
        sendMail();
        $body = $successMarkup . $backMarkup;
        $title = "Form sent";
        @header("location:formsent.php");
    } else {
        $body = $errorMarkup . $errorMarkupEnd . $backMarkup;
        $title = "Form errors";
    }

The file formsent.php I am refering to here only includes basic html markup as well as an javascript alert which is executed as soon as you open the page:

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Contact Success</title>
</head>

<body>
<script language="Javascript">
<!--
alert ("Thank you for your message! I will come back to you as soon as possible!")
//-->
</script>
</body>
</html>

Here my question:
After I send the filled out contactsheet via the send button I get a popup with the message shown above – BUT to do so it leaves the actual page I am on and shows me only a white screen.

How can I get that popup message implemented without leaving the page I am on?

  • 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-31T12:21:15+00:00Added an answer on May 31, 2026 at 12:21 pm

    Try using this one: http://jquery.malsup.com/form/ with jQuery to make an Ajax form submit simple.
    The examples, shown on that page are quite enough to implement your type of a story.
    just put:

    <script>
    $(document).ready(function(){ 
      $('form#form_id').ajaxForm(
         function(data){ 
           alert(data); 
         }
        )
    })
    </script>
    

    And so everything you need to do in your sendmail script is to echo the needed message, no redirecting required.

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

Sidebar

Related Questions

I have just started out with testing some php mvc framework In it, it
I just started working with PHP and have managed to run a simple CRUD
I just started using php arrays (and php in general) I have a code
I have just started PHP and MySQL and have created a login form and
I just got started with php. I have a form in a web page
I have just started connecting android app with php My file works very fine
I just started study of class and object in php. I have a very
I have just started learning PHP, and here's my first doubt... Both of these
I have just started writing apps for IOS5. I currently have a PHP webservice
We have just started rolling out RSA SecurID tokens to our staff members. Most

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.