How to insert values from form into database table when it is sent as mail?

Discussion in 'JavaScript and AJAX' started by smm, Oct 18, 2006.

  1. smm

    smm New Member

    Joined:
    Oct 18, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    :confused:
    I have used a javascript to send a mail to the client which contains some values from the form..what should i do to enter these values into the database table at the same time it sends a mail..actually when the submit button is clicked it redirects to another page..

    is there any way to clear this problem..
     
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    JavaScript can't send mail on its own, you must be submitting the form data to a server-side script with sends out the mail, if you can write a server-side script with accepts the form data, inserts it into the database and then sends out the mail, then your problem is solved.
    JavaScript is a client side scripting language, its capabilities are limited to the machine it is executed on (i.e. the client's browser), so you have to post the data to some server-side script.
     
  3. ryan

    ryan New Member

    Joined:
    Aug 19, 2006
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    0
    Try using a simle PHP script ;)
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice