www.webdeveloper.com
Results 1 to 5 of 5

Thread: Popup Window when mail is Sent

Hybrid View

  1. #1
    Join Date
    Dec 2013
    Posts
    6

    Popup Window when mail is Sent

    Hi,

    Well, I have a page with many forms and finally user submits those forms with some added code in text form.

    I can redirect the user to the homepage when the mail is sent, but can I make in that way, that instead of redirecting to home page, just popup the small javascript based window to say that mail was sent successfully?



    Code:
    header("Location: .../index.html");
    This is what I am using in PHP file to redirect to homepage after submittin

  2. #2
    Join Date
    Dec 2013
    Posts
    6
    In other words how can I use a simple javascript for example HELLO WORLD like window with PHP?

  3. #3
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,348
    If you are submitting a web form then you would have the page redirect to a confirmation page that says Sent OK or whatever message you want, no pop ups needed and that would be done in PHP not JavaScript...
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

  4. #4
    Join Date
    Dec 2013
    Posts
    6
    The idea is that I do not want to redirect to any page, just after clicking the submit button, show an alert, little window, saying that message was sent successfully.. then user clicks OK, and stays on the same page, is it possible??

  5. #5
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,348
    Ok, third time they say is a charm, Don't know what is wrong with the internet tonight but have tried to respond twice already.

    You need to look at AJAX for your needs, plenty of subject matter on AJAX here for you to search or just read the forums.

    a. Your set up would be a page that serves the form you will be submitting.
    b. Javascript in that page will then push to a script the details about who and what to send.
    c. The server script returns an OK value for which the Javascript will be listening for a return signal that indicates failure or success.
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles