Jump to content

[SOLVED] Please Help! I have a few questions.


pkirsch

Recommended Posts

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!! :)

Link to comment
Share on other sites

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. :)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.