0

Hi, I am kinda new to PHP as I am trying to teach myself with tutorials and it has been a long battle, but I created a signup form using php to send that information to the client successfully using the same idea as this post -->http://www.daniweb.com/techtalkforums/thread16533.html#post81744 but what I want to do is also make a record of that email writing it to a text file database then later the client would be able to pull it up using something made out of PHP. I know this is asking alot and I'm sure if it is even possible. But reading a lot about the idea of a guestbook and using txt files it would similar to that just with the addition of emailing to the client as well.

Please, please help. Thanks.

2
Contributors
1
Reply
3
Views
12 Years
Discussion Span
Last Post by Gary King
0

Why not use a MySQL database? Easier to manage.

But if not, then you can do something like create a directory that contains all the messages, giving each filename an ID, like 1.txt, 2.txt, or something more uncommon so that they are harder to find, like an MD5 hash of the ID number given to the user.

Then to retrieve it, they can type in their ID # into a field and you can grab the file using this:

// $_REQUEST['id'] contains the ID # of the user (he just put it in to find his message

$dir = './messages/';

$message = file_get_contents($dur . md5($_REQUEST['id']));

print $message;
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.