Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Dec 2013
    Posts
    21
    Thanks
    5
    Thanked 0 Times in 0 Posts

    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 submitting.

  • #2
    New Coder
    Join Date
    Dec 2013
    Posts
    21
    Thanks
    5
    Thanked 0 Times in 0 Posts
    In other words how can I use a simple javascript for example HELLO WORLD like window with PHP?

  • #3
    New Coder
    Join Date
    Mar 2006
    Location
    Chennai India
    Posts
    34
    Thanks
    0
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by G.Bregvadze View Post

    just popup the small javascript based window to say that mail was sent successfully?
    You can output javascript using php

    For e.g

    PHP Code:
    echo '<script type="text/javascript">';
    echo 
    'alert("Hello World!")';
    echo 
    '</script>'
    Chris, Developer, Chrisranjana.com
    Php Developers

  • Users who have thanked chrisranjana for this post:

    G.Bregvadze (12-20-2013)

  • #4
    New Coder
    Join Date
    Dec 2013
    Posts
    21
    Thanks
    5
    Thanked 0 Times in 0 Posts
    I used it and it works, so it pop ups the little alert widnows, saying that message is sent, howeevr how can I include here the encoding? as I need to use UTF-8 encoding.

    After popping up this alert, can I redirect the user to homepage?

    Please help with this issue..

  • #5
    New Coder
    Join Date
    Mar 2006
    Location
    Chennai India
    Posts
    34
    Thanks
    0
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by G.Bregvadze View Post
    ..................
    After popping up this alert, can I redirect the user to homepage?

    ..
    You can redirect using javascript.

    You can use

    Code:
      window.location.href = "somepage.html";
    for redirecting to another page
    Chris, Developer, Chrisranjana.com
    Php Developers

  • Users who have thanked chrisranjana for this post:

    G.Bregvadze (12-20-2013)

  • #6
    New Coder
    Join Date
    Dec 2013
    Posts
    21
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Thank you for the resposne, and is there any way to use UTF-8 Encoding? becauuse when I use Georgian language for writing the text in alert and browser shows some not understoodable symbols..

  • #7
    New Coder
    Join Date
    Mar 2006
    Location
    Chennai India
    Posts
    34
    Thanks
    0
    Thanked 5 Times in 5 Posts
    Try using the Javascript functions encodeURIComponent(s) and decodeURIComponent(s)
    Chris, Developer, Chrisranjana.com
    Php Developers

  • Users who have thanked chrisranjana for this post:

    G.Bregvadze (12-24-2013)

  • #8
    New Coder
    Join Date
    Dec 2013
    Posts
    21
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Could you please clarify that an show an example? as I am new to JS

  • #9
    New Coder
    Join Date
    Dec 2013
    Posts
    21
    Thanks
    5
    Thanked 0 Times in 0 Posts
    The problem was solved, thank you for provided help


  •  

    Posting Permissions

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