Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

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

Posts: 60
Name: Michael
Location: Warsaw
Trades: 0
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
 
 
Register now for full access!
Old 04-18-2008, 03:24 PM Re: php directories
addonchat's Avatar
Super Talker

Posts: 115
Name: Chris Duerr
Trades: 0
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

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
addonchat is offline
Reply With Quote
View Public Profile
 
Old 04-22-2008, 03:40 PM Re: php directories
Korzonek's Avatar
Skilled Talker

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.89622 seconds with 12 queries