Reply
php directories
Old 04-18-2008, 12:47 PM php directories
Korzonek's Avatar
Skilled Talker

Posts: 57
Name: Michael
Location: Warsaw
i have two files:
First:
--------------
<form action="admin_add_drink.php" method="post">

Short Drink:<input type="radio" name="shortd" />
Long Drink:<input type="radio" name="longd" />

<br></br>
Drink Name <input type="text" name="name" />
<br></br>

Ing:
<br></br>
<textarea name="ing"> </textarea>
<br></br>

Opis:
<br></br>
<textarea name="dis"> </textarea>
<br></br>
<input type="submit" />
</form>
--------
second file
$file=fopen("$_POST[name]","w")or exit("no way !");

1.Those two write a file in the root directory with a name you put in "input". The thing is that I dont know how to put it, in a directory chosen ealier (Those two radio buttons). You meant to chose a radio button(long drink directory/short drink directory) that choses a directory and the script should write that new file in there.....
Dose any one know how to do that??
Korzonek is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 04-18-2008, 02:24 PM Re: php directories
addonchat's Avatar
Skilled Talker

Posts: 97
Name: Chris Duerr
First of all, it looks like the drink type can either be "Short" or "Long" If that is the case, the way to setup the HTML radio code would be something like:

<input type="radio" name="drink_type" value="short" />Short <br />
<input type="radio" name="drink_type" value="long" /> Long

Then (completely ignoring security here) your PHP code would be something like:

$file=fopen("$_POST[drink_type]/$_POST[name]","w") or exit("no way !");

If you truly mean to put the file in the root folder, you'd add a forward slash before $_POST[drink_type]
__________________
Chris Duerr
AddonChat Java Chat Software
http://www.addonchat.com/ - Affiliate Program
addonchat is offline
Reply With Quote
View Public Profile
 
Old 04-22-2008, 02:40 PM Re: php directories
Korzonek's Avatar
Skilled Talker

Posts: 57
Name: Michael
Location: Warsaw
thx
Korzonek is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to php directories
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11751 seconds with 13 queries