Forms from website into Database HELP PLEASE!

Discussion in 'PHP' started by adwright72, Jul 31, 2006.

  1. #1
    Hi,

    Can anyone tell me in simple steps what i need to do to get forms from a website into a database. I have set up so that forms are sent to my email and can be recieved, but i want to collect the names and email addresses to go automatically into a database. is this possible?

    Many thanks in advance for any help given

    Andrew
     
    adwright72, Jul 31, 2006 IP
  2. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yes it's possible.

    If you have an email script already, it'll be easy. Just look for a tutorial on MySQL or whatever platform you have access to.

    Paste yuor current form handler here if you fancy your chances; maybe one of us is bored enough to help out a first time poster :)
     
    T0PS3O, Jul 31, 2006 IP
  3. adwright72

    adwright72 Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    The form handler is with uk2.net and its called 'formmail'

    Hope that elightens.

    Thanks for your help and for anyone else about to help me out in the future :)
     
    adwright72, Jul 31, 2006 IP
  4. Juls

    Juls Well-Known Member

    Messages:
    1,867
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    170
    #4
    I dont think that you will be able to tweak the form handler because it is hosted with uk2.net.
     
    Juls, Jul 31, 2006 IP
  5. iqra_psh

    iqra_psh Active Member

    Messages:
    992
    Likes Received:
    113
    Best Answers:
    0
    Trophy Points:
    85
    #5
    if possible attache your php file here and i will code it,
    or maybe if you need i will send form like that i already did one myself.
     
    iqra_psh, Jul 31, 2006 IP
  6. danielbruzual

    danielbruzual Active Member

    Messages:
    906
    Likes Received:
    57
    Best Answers:
    0
    Trophy Points:
    70
    #6
    In the part of the script where you send the mail you have to add the following code:

    
    mysql_connect('localhost','username','password');
    mysql_select_db('dbname');
    mysql_query("INSERT INTO tablename(emailaddress, name)"."VALUES('$email','$name')");
    
    Code (markup):
    You just have change the information according to your host settings and database settings, and of course the variable names.
     
    danielbruzual, Jul 31, 2006 IP
    ahkip likes this.
  7. iqra_psh

    iqra_psh Active Member

    Messages:
    992
    Likes Received:
    113
    Best Answers:
    0
    Trophy Points:
    85
    #7
    Looks like good teacher:)
    Hope he understand what you just explained.

     
    iqra_psh, Jul 31, 2006 IP
  8. adwright72

    adwright72 Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    OOPS sorry I think the post above addresses this!...


    Thanks for everyones help, i asked uk2 what they could do and they replied with

    "We don't have a stock script for inserting these values into a database, but there are many free third-party scripts available from other sources to do this for you. You already have the CGI service required to run these."

    Does anyone know of a third party script that i can use to add these email addresses into a data base.

    Many thanks in advance

    Andrew
     
    adwright72, Aug 3, 2006 IP