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

  • SEARCH
  • Home
  • 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 7849385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:30:08+00:00 2026-06-02T18:30:08+00:00

I’m using the code below to send an email to my address alerting me

  • 0

I’m using the code below to send an email to my address alerting me of a new user sign up:

<?php
$errors  = '';
$myemail = 'name@mydomain.com';
if (empty($_POST['email']) || empty($_POST['email']) || empty($_POST['email'])) {
    $errors .= "\n Error: all fields are required";
}

$name          = $_POST['name'];
$email_address = $_POST['email'];
$message       = $_POST['message'];

if (!preg_match(
      "/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i",
      $email_address
   )) {
    $errors .= "\n Error: Invalid email address";
}

if (empty($errors)) {
    $to            = $myemail;
    $email_subject = "Invitation Request: $email_address";
    $email_body    = "has received a new invitation request. " .
                     "\n Email: $email_address";

    $headers = "From: $myemail\n";
    $headers .= "Reply-To: $email_address";

    mail($to, $email_subject, $email_body, $headers);
    //redirect to the 'thank you' page
}
?>

Currently it redirects users to a new page but instead I want it to allow for a javascript pop-up success/fail message much like those used in modern websites.

Here is the message code (CSS and Javascript):

<script type="text/javascript" src="jquery-1.3.2.min.js"></script>

<style type="text/css">
/* Status Message */
.message { 
    display: none; 
    margin: 0 0 13px 0; 
    padding: 13px 13px 13px 52px; 
    background: url('icon_check.gif') left no-repeat #EFA; 
    background-position: 13px 5px; 
    border: solid 1px #BD8; '
    width: 300px; 
}
</style>

<script language="javascript" type="text/javascript">
$(document).ready(function(){
   $("#Button1").click(function(event){
     $(".message").show();
     $(".message").fadeOut(2500);
   });
 });
</script>

and here’s the html for the success message:

<div class="message">Your Invitation Request Has Been Received!</div>

Is it possible to do this? I’ve looked in several places for the answer over the past two days and I can’t seem to change the right thing. Any help would be appreciated.

  • 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-02T18:30:09+00:00Added an answer on June 2, 2026 at 6:30 pm

    With your current setup, the best way to do this would be to redirect back to the signup page with a query string that tells the page to open the window from there.

    header("Location: /signup.php?success=true");
    

    and in the JS

    <script>
    
    <?php
    if(isset($_GET['success']) && $_GET['success'] == 'true'){
         echo "window.open( '/success.html', 'success', '[options],[..],[..]' );";
    }
    ?>
    
    </script>
    

    Also, I recommend using filter_var to validate emails.

    filter_var('bob@example.com', FILTER_VALIDATE_EMAIL) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
I am reading a book about Javascript and jQuery and using one of the
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported

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.