Discussion » Cal! Heeeeeeeeeeeeeeeeelp!

This is a read-only copy. The forum ran on iamcal.com from 2000 until its database was lost in 2016, and this topic was rebuilt from copies saved by the Internet Archive's Wayback Machine. Some replies may be missing.
Posted by Grim..., 23:09, 15th January 2003:
 
Okay.
I have a php / MySQL site that wants to create a new folder, then copy all the stuff from another folder into it.

I've done the code, and it works fine on my local machine.

However, my online provider has got Safe_Mode set to 1 in my php.ini, and they say they won't change it.
From what I can tell, that means it can only create one file per page.

Is there a way around it?
Posted by Emperor, 00:02, 16th January 2003:
 
Can't you just do it via FTP?
Posted by Grim..., 00:04, 16th January 2003:
 
Nah - the user does it.
Basically, you sign up for a blog, and it makes you one.
Posted by Grim..., 00:06, 16th January 2003:
 
I could create loads via FTP but I wouldn't know what the user wanted the subfolder to be called...
Posted by cal, 00:21, 16th January 2003:
 
i don't have enough experience with safe_mode to help - i only really develop on dedicated boxes so always have it turned off :/
Posted by Grim..., 00:28, 16th January 2003:
 
<eyes wide>
Eh?
You mean you... *gulps*
You don't know?
</eyes wide>
Ah, crap, in the past you've know everything I've asked =]

This is what happens if you come running to Cal for help and don't bother looking it up yourself...
Posted by Grim..., 00:29, 16th January 2003:
 
YOU LEARN NOTHING!
Posted by Grim..., 00:30, 16th January 2003:
 
I've got a blog that I'll never update, though...
Does anyone want to be co-owner with me?

IAmMattAndHeIs*.com?
Posted by Grim..., 00:30, 16th January 2003:
 
Oh, and http://www.hsmx.com/grimblog/grim
Posted by Emperor, 00:50, 16th January 2003:
 
I'm not sure there is an easy way around it - change hosts, use another script, rewrite the one you currently have (its not clear to me why another folder is required).
Posted by Emperor, 00:57, 16th January 2003:
 
OK you might want to explain what you are trying but if I'm guessing right then I would sign up at your site and would be assigned my own folder like:

http://www.hsmx.com/grimblog/emperor/

from which the blog runs. There might be many reasons why you'd want to do this that I'm not ware of but one solution would be to use mod_rewrite to control everything from a single script so:

http://www.hsmx.com/grimblog/emperor/

would map to:

http://www.hsmx.com/grimblog/index.php?u...

with something like:

RewriteEngine on
RewriteRule grimblog/([a-zA-Z0-9_]+) /grimblog/index.php?user=$1 [L]

and run as much as possible from the database.
Posted by Grim..., 01:02, 16th January 2003:
 
He - the main reason for not doing that is because I've already done it this way =]

But cheers!
Posted by Grim..., 01:04, 16th January 2003:
 
Of course, if I'd had known about silly safe mode I'd have done it your way...

(Except I probably wouldn't know how at the moment...).
Posted by Emperor, 01:36, 16th January 2003:
 
Thats [edit: using mod_rewrite] probably the way I'd do it if I was aiming for something like this. I would like the flexibility of being able to create folders so everyone could have something to store images and files in but at a push you could store these in your DB too.

Why do you need to create a folder?
Posted by Grim..., 01:41, 16th January 2003:
 
Basically so the user has somewhere to store images and files =]
I'll get it to work, I'll just create the files manually (via ftp) and rather than creating it, I'll get PHP to rename the folder.
Posted by cal, 07:56, 16th January 2003:
 
the way i'd do it is to use mod_rewrite for everything, bung all files in a single folder and use mod rewrite to map these too:

RewriteRule grimblog/([^/]+)/images/(.+) /grimblog/images/$2 [L]
Posted by Grim..., 09:15, 16th January 2003:
 
I'll have a go tonight.
Posted by earthworm, 09:48, 16th January 2003:
 
Did you find a co-owner GRIM?
Posted by Grim..., 10:00, 16th January 2003:
 
Not yet...
I'm thinking I should have about five...