Log in

View Full Version : PHP prompt email



Drewsterritz
03-18-2008, 05:11 PM
I am looking for a code that will prompt the viewer for their email when they click to open a file or click to download a file and then save that email some where. I posted in html about this same thing but i posted that because I wanted to know if you could do it with out php. Thanks

boogyman
03-18-2008, 05:47 PM
you can do it with javascript, using a cookie, but that would save it to the local machine of the user... I am going to assume that you want to track whom has downloaded what file? to do that you need a server side language like php, and a place to store the information... either in a database table or in a text file.

Drewsterritz
03-18-2008, 05:51 PM
yes i would like to track who downloads the file. so if i use php how do i put it to use in my website.

Drewsterritz
03-18-2008, 07:33 PM
could some body push me in the right direction that would be great, cause right now i dont know where to start

Medyman
03-18-2008, 07:55 PM
could some body push me in the right direction that would be great, cause right now i dont know where to start

Could you provide more info on how the form that you're using is structured? In your other post you said something about checkboxes and the user being emailed. I'm getting another story form this post.

From this post, this is what I'm getting.

1. User enters email.
2. User clicks submit.
3. User's email is saved in a txt file or database.

Is that right? If so, do you want to use a text file or database.

Drewsterritz
03-19-2008, 05:26 AM
that is right and i am not sure if i should use a txt file or db because i am new to the whole thing of db and php

Drewsterritz
03-19-2008, 05:49 AM
What this is for is when I user comes to my site and clicks a link that says "Click here for more information". The user will then be prompted for their name and email and when submitted they information will be sent to a specific email or file or db. I am just so new to php that I am not sure where to start. If any one could help that would be great. Thanks again!

kuau
03-21-2008, 02:26 AM
I'm no expert but this is how I do it...

1. When they click for more information, present them with a little form that captures their name and email address.
2. Send them an email with whatever info you are sending.
3. Connect to the database.
4. Load the name & email address into a database table like in this example:

$query = "INSERT INTO customers
( name, email, requestdate )
VALUES
( '$name', '$email', '$requestdate' ) ";

5. Take them to a result page eg. "Thank you for your request."

Hope that helps a bit. erin :)