Jump to content
xisto Community
electriic ink

How To Read And Write Files Using Php php :: reading and writing files

Recommended Posts

Nice guide.I do have a question thought, could I utilize those commands to write in a HTML file instead of a text file?For example:Every time a user creates a form (could be a registration) a new HTML document is created, written with the Form Contents the user just filled and then closed inside a specific folder.Is this possible with this command, or are there different commands to write in different types of documents?Thanks in advanced!

Share this post


Link to post
Share on other sites

An HTML document is just a text document. As long as you worked out all the HTML code beforehand, you could use PHP to put that into a file. You also have the advantage of being able to use loops, which are excellent for doing tables and lists - you only need to write the HTML code for one line, and PHP puts different data in, then repeats it.

Share this post


Link to post
Share on other sites

Ah, that sounds excellent!So the filename would be "name.html" then, right?Also, if the HTML document is possible to create, that means that I could create PHP scripts also?

Share this post


Link to post
Share on other sites

I read on read & write a bit before; This is a good tutorial, thank you for posting it. also good measure posting the link to the origional, but skipping some info will just leave you with more questions to answer (not for next time you make a tutorial)

Share this post


Link to post
Share on other sites

Great!You see, after I read this I questioned myself if this could be used to create new pages on a website, apparently, it is possible.For example, you have a member register for your site, lets say a Blog site, and when they confirm the account a new page will be written and saved to be used as his "Blog Page".I'm not sure if this is the most efficient way to do this or not, but it might just work. :)

Share this post


Link to post
Share on other sites
how to save data input to a xls or txt fileHow To Read And Write Files Using Php

Hi all,

I am new to php. I just created this html page

<html>

<body>

<form name="input" action="form.Php" method="post">Username:<input type="text" name="user" /><input type="submit" value="Submit" /></form>

</body>

</html>

All I want is whatever the data I enter in that form field, it should get saved in a xls or txt file on my local hard drive.  Is it possible? Please help. 

-reply by Mohan

Share this post


Link to post
Share on other sites

Ey thanks for this tutorials . I'm looking forward to learn PHP but I don't have much time 'cause I must go to school :S, however you tutorial helps me to keep up and when I start intensive training I will read all your posts :P:)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.