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
really simple script needed to take values from url
Old 01-06-2006, 03:44 PM really simple script needed to take values from url
Ultra Talker

Posts: 358
Location: Devon, UK
Trades: 4
I need a really, really simple php script made...

I want it to take some values from the url and place them into the file (which will be read as plain text)

The php script will be accessed with something like http://site.com/properties.php?param...&param2=value2

Then I want the values to be taken from the url and entered into the file (which will be shown as plain text when opened in a browser - ie so if I load http://site.com/properties.php?param...param2=value2).

For example

Code:
# If you want to impose a limit on the total size of the file upload
# enter a value in kilobytes for the max_upload parameter. A value
# of 0, the default means unlimited. Please make sure that the server
# side configuration does not impose a lower limit than what you choose
# for max_upload
#
# Example: 
#     max_upload=10240
#     will impose a limit of 10 Mega Bytes
#

max_upload=value1
and so on.

To explain a little better, the file is a plain text config file for a java ftp upload applet. I want different values in the config depending on the account that it is used from.

Hope someone can help me with this (I'm sure it's very, very simple but I'm no programmer!)
Simon
recedo is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-06-2006, 05:05 PM
0beron's Avatar
Defies a Status

Posts: 1,832
Location: Somewhere else entirely
Trades: 0
How many people are going to use this system? What happens if someone starts an upload, but another user's connection changes the config file to something else? Do all users share the same config file, and are there going to be enough users that collisions like this will be a problem, or will only one person be likely to use it at once?
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';

Please login or register to view this content. Registration is FREE
(aka MSN handwriting for forums)
0beron is offline
Reply With Quote
View Public Profile Visit 0beron's homepage!
 
Old 01-06-2006, 05:20 PM
Ultra Talker

Posts: 358
Location: Devon, UK
Trades: 4
Hmm, thats a very good point! I hadn't thought that over to be honest.

It's likely that more than one user will be using it, so yes it could cause problems.

As it is the config file will be called from within the user area meaning that I'll have some variables, for example $username or something along those lines.

What I am sending to the config file is the username which will define which folder to upload to.

Perhaps I could use the $username variable to create a unique config file? and have it deleted when the session ends or something like that?

Any ideas/hints?

or - am I likely to be getting in too deep here (without resorting to getting someone in to do this), considering I don't know too much about php!

PS. I have figured out an easy way to get the variables from the url;

PHP Code:
<?php echo($param1);  ?>
and so on

To grab the username in the original page I use

PHP Code:
<?php echo ($_SESSION['valid_user']) ?>
and add it to the url as a variable.
recedo is offline
Reply With Quote
View Public Profile
 
Old 01-08-2006, 09:56 PM
Ultra Talker

Posts: 358
Location: Devon, UK
Trades: 4
Right, no need to worry about the issues raised here. I have spoken to the producer of the applet and there is an undocumented feature where the url can be passed in the 'calling' page instead of in an external file.

I have added some code to the registration page so when a new account is created it makes a new directory with the username, now I can make sure their files only get uploaded to their directory with no problems.

Thanks for your help
Simon
recedo is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to really simple script needed to take values from url
 

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