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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Contact form without redirecting-'submit' button

    Friends, I want a simple contact form of 3 fields on my website which emails data on my email address or write a file on my server or just other any way inform me that data.

    But I dont want that "submit" button redirects to other 'thankyou' page where code is located.

    Plzzzzzzzz suggest or tell me what I have to do??

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,079
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    A "thank you" page will only be shown if you code (redirect to) that.

    You cannot send form data by email.

    The trouble with using this long-obsolete method (mailto) to send form results is its unpredictability. The method it is highly dependent on the browser in use
    and the email client in use (some people have only Yahoo, Gmail or Hotmail). In particular, your visitor must have Outlook or Outlook Express as the default
    client for this to work correctly. Even if your visitor is using Internet Explorer, but the default mail client is different (e.g. Eudora or Thunderbird), your mailto form will
    not work. With all of the browser troubles, you're likely to lose about half of your users' messages. Most of the email clients that can successfully
    send a mail will prompt the user with a somewhat threatening security dialog prior to sending - this can scare many users from continuing. Other users will not wish to reveal their email address. Also, what about people with Javascript disabled?

    In addition, if you place an unobfuscated email address in your webpage, the bots will quickly find it and inundate you in spam.

    In fact few browsers these days accept mailto: as a form action. You need a really old browser (<IE6) for it to work as more modern browsers simply
    open the email program (if any) and ignore the form. If you are going to use a form then use a server-side CGI formmail script as the action - there are
    several good free ones out there.


    For a simple PHP form feedback script see:- http://www.thesitewizard.com/archive/feedbackphp.shtml


    For more info see:- http://apptools.com/rants/mailto.php


    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.
    Last edited by Philip M; 02-26-2012 at 10:48 AM.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • Users who have thanked Philip M for this post:

    Real Hyder (02-26-2012)

  • #3
    New Coder
    Join Date
    Feb 2012
    Location
    England
    Posts
    77
    Thanks
    0
    Thanked 12 Times in 11 Posts
    The PHP mail() function can be used to send email

    You will have to have your form redirect to somewhere, as that is where the script to process it is.

    The best solution I can think of is having your PHP script process the form data, and then redirect you back to the page you were on.

  • Users who have thanked Co1dFusion for this post:

    Real Hyder (02-26-2012)

  • #4
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thanks friends,

    This is the solution :/ Okk if nothing other then I have to use it..

    Can somebody tells me the script to install in the php page which redirect user back to the page you were on???

  • #5
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thaaaaaaaaaaaaaaaaaak you friends.


    http://www.thesitewizard.com/archive/feedbackphp.shtml


    This works what I want. Thaaaaaaanks : )))))))))))))))))

    Thank you.


  •  

    Tags for this Thread

    Posting Permissions

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