dcsimg
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,937
    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...
    STOP using $ prefix on JavaScript variable names...
    Please remember to wrap any code you have in forum tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

  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,937
    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.
    STOP using $ prefix on JavaScript variable names...
    Please remember to wrap any code you have in forum tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

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