| | |
creating Contact form to email and txt file
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Mar 2005
Posts: 2
Reputation:
Solved Threads: 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/techtalkforum...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.
Please, please help. Thanks.
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:
[php]// $_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;
[/php]
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:
[php]// $_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;
[/php]
![]() |
Similar Threads
- Need Web Based Contact Us Form (PHP)
- How to open txt file (Visual Basic 4 / 5 / 6)
- how to load TXT file in RTF Control from VFP6 (IT Professionals' Lounge)
- Need a contact form (HTML and CSS)
- Need a contact form for my web site (Site Layout and Usability)
- Password Protection from a txt.file (HTML and CSS)
- uploading .txt file via phpmyadmin to Mysql (MySQL)
Other Threads in the PHP Forum
- Previous Thread: PHP April's Fool
- Next Thread: Defining a PHP INI variable for entire directory
| Thread Tools | Search this Thread |
apache api array beginner binary body broken cakephp checkbox class cms code computing cron curl database date date/time delete display dynamic echo email error file files filter folder form forms function functions gc_maxlifetime global google host href htaccess html image include insert ip javascript joomla limit link list login mail memmory memory menu mlm msqli_multi_query multiple mycodeisbad mysql navigation oop parameter parsing paypal pdf php problem query radio random recourse recursion regex remote script search seo server sessions sms snippet source space sql static syntax system table thesishelp tutorial update upload url validator variable video web webdesign wordpress xml youtube





