pkirsch Posted February 2, 2007 Share Posted February 2, 2007 Hello everybody! How's it going? I need help with some things! Ok... so here's the deal. I'm a beginner at PHP (hey everybody has to start somewhere.) Please be easy on me I'm an newbie and I'm only 16. I know HTML and some Javascript. I am trying to make a new review website. The questions i have are: 1- I am wondering how i can have a Form, (a simple one...like three fields, and i would like to know how i can save the results to a .txt file.) 2- I would like to make a Registration Form, "a few more details" and when the form is submitted a file will be created in a select folder (either .txt or .html/.php.) For now thats all i need! Thank You very Much!! Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted February 2, 2007 Share Posted February 2, 2007 i can tell you the basics of what you need to no. you will need to no how to handle files with the fopen command, then write to files with the fwrite command and basicly, most of those. here is a link to the manual. fopen - http://au2.php.net/fopen fwrite - http://au2.php.net/fwrite fputs - http://au2.php.net/fputs fclose - http://au2.php.net/fclose i suggest you start something basic, like just a 1 field form that writes say a username to a text file. get used to the commands. then search for a tutorial or attempt it yourself. if you need more help after that you can come back and post again. good luck. Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted February 2, 2007 Share Posted February 2, 2007 ProjectFear: fwrite and fputs are the same command. I am trying to make a new review website Tutorial: http://www.phpfreaks.com/tutorials/9/0.php 1- I am wondering how i can have a Form, (a simple one...like three fields, Through the magic of html and i would like to know how i can save the results to a .txt file. Through the magic of php...specifically the file funtions (http://www.php.net/file, http://www.php.net/fopen, http://www.php.net/fwrite, http://www.php.net/fclose), implode (http://www.php.net/implode), explode (http://www.php.net/explode), serialize (http://www.php.net/serialize), unserialize (http://www.php.net/unserialize), and an understanding of arrays. 2- I would like to make a Registration Form, "a few more details" and when the form is submitted a file will be created in a select folder (either .txt or .html/.php.) Tutorial: http://www.phpfreaks.com/tutorials/78/0.php Quote Link to comment Share on other sites More sharing options...
pkirsch Posted February 2, 2007 Author Share Posted February 2, 2007 Thank you very much! you guys are awesome! Quote Link to comment Share on other sites More sharing options...
nloding Posted February 2, 2007 Share Posted February 2, 2007 I'm not going to write out code for you, but Google is your friend: http://www.rawdata.net/developer/php_examples/forms/form-save.php http://www.tizag.com/phpT/filecreate.php http://www.tizag.com/phpT/filewrite.php I'm a noobie enough myself to not really understand the second question, so this'll start you somewhere! Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted February 2, 2007 Share Posted February 2, 2007 @hitman6003: I just listed some commands, i didnt care if two did the same thing. Quote Link to comment Share on other sites More sharing options...
pkirsch Posted February 2, 2007 Author Share Posted February 2, 2007 Ok now for a part three of my question! Can PHP read the contents of a .txt file? Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted February 2, 2007 Share Posted February 2, 2007 http://www.php.net/file http://www.php.net/file_get_contents http://www.php.net/fopen http://www.php.net/fread Quote Link to comment Share on other sites More sharing options...
chronister Posted February 3, 2007 Share Posted February 3, 2007 The manual for all file system functions is here http://us2.php.net/manual/en/function.file.php . The php manual is really well written with explanations and examples. Here's a little trick for ya, if you use Firefox bookmark this link http://php.net/manual-lookup.php?pattern=%s and set a keyword for it. This is a straight from your address bar search string for the php manual. Its really handy. simply type keyword search_term in your address bar and it will take you to the search results page, or directly to the functions page if you type an exact name. I understand your really new at this but I have only been coding php for around a year with nothing else but html/css before that.I found mysql to be easier to understand than PHP. Reason I say this is because mysql is better suited for a forum, and registration system. Once you get a decent feel for PHP, jump right in to MySql because in my opinion it's better than flat file type systems, though I know some would debate I feel it's almost a necessity for SERIOUS web design. This forum is a great help too. I found it a couple months ago, and got hooked. Some smart mo-fo's round here that are extremely helpful Sorry I did not really answer your question, but I hope it helps some anyhow. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.