Welcome to Dream.In.Code
Become a PHP Expert!

Join 137,390 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 2,136 people online right now. Registration is fast and FREE... Join Now!




Read from textbox and write to a file .

 
Reply to this topicStart new topic

Read from textbox and write to a file ., help me !

hienduchuynh
26 Oct, 2006 - 01:52 AM
Post #1

New D.I.C Head
*

Joined: 26 Oct, 2006
Posts: 4


My Contributions
Excuse me!
I want to have a code about : read from textbox(ex: username) , after that auto make a folder with name : username, and then read from textbox (ex:info) , after that auto make a file(ex: info.txt) and write all from textbox(ex: info) to file.
I trie, but I can't .
Please help me. Thank you very much .

( I am Duc, from VietNam, So I write English very bad, sorry and thanks )
User is offlineProfile CardPM
+Quote Post

Trogdor
RE: Read From Textbox And Write To A File .
26 Oct, 2006 - 03:14 AM
Post #2

D.I.C Addict
Group Icon

Joined: 6 Oct, 2006
Posts: 533



Thanked: 3 times
Dream Kudos: 125
My Contributions
the data typed into the textbox will be present in a POST or GET variable with the element name of the textbox.
So if you have a form along the following lines:
CODE

<form method='POST'>
<input type=text name='username'>
<textarea name='info'></textarea>
<input type=submit>
</form>


then after the submit you will find the values posted in there in the following variables:
$_POST['username']
and $_POST['info']

Those you can then use in the rest of your script.
be VERY carefull though when using filesystem functions (when creating directories)
it is very easy to do very very nasty things if you blindly pass the submited username into filesystem functions. You MUST strip out all unwanted characters and thouroughly check all the input before doing something as dangerous as passing it to filesystem functions!
For more information, use http://www.php.net , that website has everything you might want to know about the PHP functions you need.

This post has been edited by Trogdor: 26 Oct, 2006 - 03:16 AM
User is offlineProfile CardPM
+Quote Post

hienduchuynh
RE: Read From Textbox And Write To A File .
26 Oct, 2006 - 11:33 PM
Post #3

New D.I.C Head
*

Joined: 26 Oct, 2006
Posts: 4


My Contributions
oh, That 's I don't know ! Thank you very much . And...Can Php auto make a folder ? I don't find imformation about it . Please help me !
User is offlineProfile CardPM
+Quote Post

BetaWar
RE: Read From Textbox And Write To A File .
5 Nov, 2006 - 07:44 PM
Post #4

#include <soul.h>
Group Icon

Joined: 7 Sep, 2006
Posts: 2,054



Thanked: 84 times
Dream Kudos: 1175
My Contributions
PHP can manipulate many perspectives of webpages, and memory as well as some client side things (such as sending the client to a different page is they are using a proxy or not).

If you post the code that you have so far I will help out, but the rules state "No freebees", so until I see some code I can't help out.

Sorry
User is offlineProfile CardPM
+Quote Post

snoj
RE: Read From Textbox And Write To A File .
6 Nov, 2006 - 01:05 PM
Post #5

$Null
Group Icon

Joined: 31 Mar, 2003
Posts: 3,304



Thanked: 7 times
Dream Kudos: 700
My Contributions
One of our members wrote a tutorial that answers some of these questions. http://dreamincode.net/forums/showtopic9866.htm
User is offlineProfile CardPM
+Quote Post

hienduchuynh
RE: Read From Textbox And Write To A File .
8 Feb, 2007 - 11:38 PM
Post #6

New D.I.C Head
*

Joined: 26 Oct, 2006
Posts: 4


My Contributions
How to use function mkdir() for create folder ? Help me please. I have a gallery http://www.photosvn.com I want When a people register, my gallery wil create a folder with name is new username , but I don't know how ?

This post has been edited by hienduchuynh: 8 Feb, 2007 - 11:45 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/5/08 02:29AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month