Old 08-09-2006, 10:03   #1 (permalink)
MattW
Registered User
 
Join Date: Jan 2005
Posts: 11
File Upload path in PHP

Hi,

Hope someone can help - this is probably a no brainer but here goes -

I am learning php and I am currently working through an exercise to upload an image.
I have example code but they have used a local machine so the line I need to change is :-

$ImageDir = "C:/Program Files/Apache Group/Apache2/test/images/";

I am testing my stuff on lycos/tripod free hosting. My question is what do I need to change the line to to make it correct to my lycos server path.

my domain is http://www.members.lycos.co.uk/wyvertest/
and I have just called my image directory "Images"

but I am not at all sure what format the path should be in.

Any help gratefully received
Many thanks
  Reply With Quote
Old 08-09-2006, 10:32   #2 (permalink)
mx
fucksocks™
 
mx's Avatar
 
Join Date: Jun 2005
Location: in the boosh
Posts: 1,615
first create a php file containing

PHP Code:
<? phpinfo(); ?>

name it phpinfo.php and upload it to your root directory.

surf to that page in your web browser and scroll to the table at the bottom of the page.

In that last table your find "_SERVER["DOCUMENT_ROOT"]" which shows the true server root of your website.

Voila!
__________________
  Reply With Quote
Old 08-09-2006, 10:45   #3 (permalink)
MattW
Registered User
 
Join Date: Jan 2005
Posts: 11
Hi,

Thanks - I've tried that but can't see the "_SERVER["DOCUMENT_ROOT"]" anywhere in the table - I did a search on "root" on the page and all I can find are the following entries:-

doc_root no value no value
docref_root no value no value

I also found :-

include_path .:/data/apache/php/mmp_lib .:/data/apache/php/mmp_lib

and theres also entries for sendmail etc but I cant find a server root - any other ideas?

Thanks again
  Reply With Quote
Old 08-09-2006, 11:50   #4 (permalink)
mx
fucksocks™
 
mx's Avatar
 
Join Date: Jun 2005
Location: in the boosh
Posts: 1,615
I just had a quick look in info.php in your root and it looks like your running a very limited version of php.
You'll probably need to get some 'proper' paid hosting. I personally use mediatemple and xtreme-host but there's loads of others which people recommend.
__________________
  Reply With Quote
Old 08-09-2006, 12:28   #5 (permalink)
MattW
Registered User
 
Join Date: Jan 2005
Posts: 11
Ok
Thanks for your help anyways- I guess you get what you pay for. Id originally considered buying some cheap hosting and then thought for learning a free one would do. At least it got me started on php.

Thanks again
  Reply With Quote
Old 10-09-2006, 23:28   #6 (permalink)
riat_sila
Design on ice
 
riat_sila's Avatar
 
Join Date: Jun 2005
Location: Bracknell, UK
Posts: 167
Send a message via AIM to riat_sila Send a message via MSN to riat_sila Send a message via Yahoo to riat_sila
You can always install a version of PHP on your desktop, which is free and convenient...
  Reply With Quote
Old 12-09-2006, 23:05   #7 (permalink)
dwalls32
Registered User
 
Join Date: Sep 2006
Location: Florida
Posts: 18
Send a message via AIM to dwalls32
You don't need to specify the whole path, you can just specify the folder it is going to. Such as...
$target_path = "upload/";
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8