Forum Moderators: coopster

Message Too Old, No Replies

how can i send form data to mysql using cgi

input mysql data from cgi

         

jbilansky

4:23 am on Sep 27, 2003 (gmt 0)

10+ Year Member



Greetings all!
I'm pretty new / rusty to server side scripting.
a complete newbie to mysql. (hated programmming in college now wish i had taken more)
i have got a pretty good [i think] cgi script i created that takes the form data shows it to the user, sends the user a specific email with a message from the club & their data it also sends myself a diffrent email to let me know it's added and also has their info.
that was step1 (whew!).
i don't have a deadline hanging over me. the site is for an off-road racing club i'm trying to keep it as simple as possible in the event i relinquish site admin duties the site is all html no scripts except 1 (i'm working for free)

all i really need to do is: pass the data from the form to a database using a cgi script {can this be done?}. i kind of fumbled my way around and created the database with the (8 total) fields i'll need. the hosting co has php myadmin no asp supported. (apache server i think)

I'm reading about php, sql etc & getting lost (i'm more of a networking kind of guy).

ANY insight or help would be greatly appreciated.

jatar_k

4:39 am on Sep 27, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



{can this be done?}

well of course it can

Welcome to WebmasterWorld jbilansky,

so a little MySQL, have you looked through these pages?
PHP MySQL Functions [ca.php.net]

here are the actions we need the script to perform

1. connect to mysql
2. select the database we are using (not always necessary)
3. make the data safe fro mysql insert
4. build the insert query to send
5. send the insert query
6. tell the user thank you very much

I know it can be a little overwhelming to start but look at these functions on the page linked to above

1. mysql_connect
2. mysql_select_db
3. mysql_escape_string
4. this can be done in a string, concatenate the values together and use them in the fllowing function
5. mysql_query (used for nay queries you send - insert, update, select, delete etc)
6. header [ca.php.net]

simple?

no asp supported

probably better that way ;)