Close

Results 1 to 14 of 14
  1. #1
    DF VIP Member Spennyboy's Avatar
    Join Date
    Sep 2003
    Location
    Stock Exchange
    Posts
    11,193
    Thanks
    221
    Thanked:        121
    Karma Level
    1113

    Default Online Form - saves entry to database - emails user receipt

    Hey guys,

    I want a form on a page (on its own) where i can fill in information of a few fields - then when that form is submitted i want it to save it either a) in a access database b) just as a .txt file. on the server.

    I then want a generated receipt with that info sent to an email address specified.

    What am i look at code/script wise?

    ta.

  2. #2
    DF VIP Member BBK's Avatar
    Join Date
    May 2006
    Location
    here
    Posts
    12,422
    Thanks
    234
    Thanked:        128
    Karma Level
    1084

    Default Re: Online Form - saves entry to database - emails user receipt

    Have to ask spenny, but why access or text? Does your host offer php? If they do, then this is like 10 minutes work.

  3. #3
    DF VIP Member Spennyboy's Avatar
    Join Date
    Sep 2003
    Location
    Stock Exchange
    Posts
    11,193
    Thanks
    221
    Thanked:        121
    Karma Level
    1113

    Default Re: Online Form - saves entry to database - emails user receipt

    Quote Originally Posted by BBK View Post
    Have to ask spenny, but why access or text? Does your host offer php? If they do, then this is like 10 minutes work.
    cos im a n00b and know no better.

    Im basically trying to learn HTML and as a first little project want to make a little form that does like above.

    Tell me more about the PHP route... ?
    Last edited by Spennyboy; 16th January 2009 at 05:48 PM.

  4. #4
    DF VIP Member Over Carl's Avatar
    Join Date
    Apr 2006
    Location
    London
    Posts
    13,125
    Thanks
    3,975
    Thanked:        1,690
    Karma Level
    1252

    Default Re: Online Form - saves entry to database - emails user receipt

    If you do wanna go down the access route - I think you need to look up ms adodb objects or something like that. I remember years ago having to use a slightly different version that connected to an oracle database as part of a uni project.

  5. #5
    DF Super Moderator
    DejaVu's Avatar
    Join Date
    Nov 2005
    Location
    Essex
    Posts
    9,107
    Thanks
    1,836
    Thanked:        4,004
    Karma Level
    954

    Default Re: Online Form - saves entry to database - emails user receipt

    PHP runs in conjunction with an online database called MySQL (which is where all the data will be saved). You can then pull the information from the MySQL database and create the reciept information. Which can then be automatically emailed to the customer.

    This is relatively easy practice for a good website designer and shouldnt take too long.

    All e-commerce systems should automatically set this up for you. OS-Commerce I know for one does... Looking there, if you understand basic PHP, you can probably reverse engineer the same sort of thing (it can be quite involved though).


  6. #6
    DF VIP Member StephenDon24's Avatar
    Join Date
    May 2007
    Location
    Manchester
    Posts
    972
    Thanks
    0
    Thanked:        0
    Karma Level
    257

    Default Re: Online Form - saves entry to database - emails user receipt

    Don't go down the access route - real nightmare and very very limited in functionality. As said above with php/mysql this is easy and you can download prewritten scripts to do the email stuff for you. Google Natemail and phpmailer for examples of such scripts.

    If you know sql then putting that in to php to gather from a form is a walk in the park. .


    Code:
    $val1 = $_POST['form_val1'];
    $val2 = $_POST['form_val2'];
    $val3 = $_POST['form_val3'];
    mysql_query("INSERT INTO table_name (field1, field2, field3) 
    VALUES ('$val1', '$val2', '$val3')");
    etc etc

  7. #7
    DF VIP Member rIKmAN's Avatar
    Join Date
    Mar 2002
    Location
    Stafford
    Posts
    6,502
    Thanks
    1,061
    Thanked:        645
    Karma Level
    636

    Default Re: Online Form - saves entry to database - emails user receipt

    You can also use PHP to send the email, and the data either direct from the form or pulled from the MySQL database, or both, depending what you want.

  8. #8
    DF Super Moderator
    DejaVu's Avatar
    Join Date
    Nov 2005
    Location
    Essex
    Posts
    9,107
    Thanks
    1,836
    Thanked:        4,004
    Karma Level
    954

    Default Re: Online Form - saves entry to database - emails user receipt

    Looks like Stephen could well be your man on this Spenny!


  9. #9
    DF VIP Member stixson's Avatar
    Join Date
    Feb 2001
    Location
    UK
    Posts
    261
    Thanks
    2
    Thanked:        0
    Karma Level
    293

    Default Re: Online Form - saves entry to database - emails user receipt

    the asp side of things is piece of wee. Access is an ok database for small stuff such as invoices/addresses etc. Can also send an email too...
    I intend to live forever, or die trying.

  10. #10
    DF VIP Member BBK's Avatar
    Join Date
    May 2006
    Location
    here
    Posts
    12,422
    Thanks
    234
    Thanked:        128
    Karma Level
    1084

    Default Re: Online Form - saves entry to database - emails user receipt

    Bloody hell, 2 months later and it gets dragged back up. How odd!

  11. #11
    DF VIP Member stixson's Avatar
    Join Date
    Feb 2001
    Location
    UK
    Posts
    261
    Thanks
    2
    Thanked:        0
    Karma Level
    293

    Default Re: Online Form - saves entry to database - emails user receipt

    apologies BBK. Next time i will look at the date of the thread and then determine if i can actually help someone with something i do know...
    I intend to live forever, or die trying.

  12. #12
    DF VIP Member BBK's Avatar
    Join Date
    May 2006
    Location
    here
    Posts
    12,422
    Thanks
    234
    Thanked:        128
    Karma Level
    1084

    Default Re: Online Form - saves entry to database - emails user receipt

    LOL not you m8, I blame Deja Vu, but with his username maybe we shouldn't be too surprised

  13. #13
    DF Super Moderator
    DejaVu's Avatar
    Join Date
    Nov 2005
    Location
    Essex
    Posts
    9,107
    Thanks
    1,836
    Thanked:        4,004
    Karma Level
    954

    Default Re: Online Form - saves entry to database - emails user receipt

    My bad...

    Least there's some better information here now for future visitors, who will also bring it back from the depths, if they search proper!

    Better still -
    http://docstore.mik.ua/orelly/webprog/webdb/ch12_02.htm
    Solved!


  14. #14
    DF VIP Member BBK's Avatar
    Join Date
    May 2006
    Location
    here
    Posts
    12,422
    Thanks
    234
    Thanked:        128
    Karma Level
    1084

    Default Re: Online Form - saves entry to database - emails user receipt

    Quote Originally Posted by DejaVu View Post
    disagree Most php coders don't use the inbuilt mail() now because its not as secure as classes like phpmailer and safemail both are an absolute piece of piss to implement too

Similar Threads

  1. where can you buy swords form the uk online?
    By arv2k in forum Home Audio/Video, Electronic Toys & Gadgets
    Replies: 4
    Last Post: 1st October 2002, 04:24 PM
  2. Online Polls
    By WTD in forum The Dog and Duck
    Replies: 15
    Last Post: 26th September 2002, 01:03 AM
  3. MOHAA Online
    By cooper in forum PC Gaming
    Replies: 4
    Last Post: 7th September 2002, 10:47 PM
  4. Medal Of Honor Online
    By sanic in forum PC Gaming
    Replies: 4
    Last Post: 4th September 2002, 03:37 PM
  5. RTCW online
    By huggles in forum PC Gaming
    Replies: 3
    Last Post: 2nd September 2002, 04:16 PM

Social Networking Bookmarks

Posting Permissions

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