Physical Path Setting Problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
haseebmaqsood
Forum Newbie
Posts: 15
Joined: Sat Jun 16, 2007 10:55 am

Physical Path Setting Problem

Post by haseebmaqsood »

Hi
I am uploading my site and i am unable to set physical path of my site because i don't know the exact location from which it is viewing to user
Kindly tell me the physical path or some generic help through which i can solve this problem


---------------------------------------------------------Site End Config----------------------------------------------------------------------
Folder Positions
Software/resource_images/

Software is the main folder in which all folder resides one of them is resource_images, from which i want to show the pics of softwares
The Path I am Setting to check that the file exist or not

$Root_Path=sms
$path=$ROOT_PATH."\\resources_images\\".$id;

----------------------------------------------------------------------------------------------------------

--------------------------------------------------------Computer Setting With Code--------------------------------------------------
MY Computer Setting
Physical Path $ROOT_PATH="e:\\xampp\\htdocs\\sms";
$path=$ROOT_PATH."\\resources_images\\".$id;

if(file_exists($path.".jpg"))
{
echo "<a href='index.php?rid=$row[r_id]&value=phpfiles/downloadSoftware'>";
echo "<img src='$URL_PATH"."/resources_images/".$id.".jpg' width='100' height='100' border='0' alt='$row[name]'></a>";
}
else if(file_exists($path.".jpeg"))
{
echo "<a href='index.php?rid=$row[r_id]&value=phpfiles/downloadSoftware'>";
echo "<img src='$URL_PATH"."/resources_images/".$id.".jpeg' width='100' height='100' border='0' alt='$row[name]'></a>";
}
else if(file_exists($path.".gif"))
{
echo "<a href='index.php?rid=$row[r_id]&value=phpfiles/downloadSoftware'>";
echo "<img src='$URL_PATH"."/resources_images/".$id.".gif' width='100' height='100' border='0' alt='$row[name]'></a>";
}
else if(file_exists($path.".png"))
{
echo "<a href='index.php?rid=$row[r_id]&value=phpfiles/downloadSoftware'>";
echo "<img src='$URL_PATH"."/resources_images/".$id.".png' width='100' height='100' border='0' alt='$row[name]'></a>";
}
else
{
echo "<a href='index.php?rid=$row[r_id]&value=phpfiles/downloadSoftware'>";
echo "<img src='$URL_PATH"."/resources_images/0.jpg' width='100' height='100' border='1' alt='$row[name]'></a>";
}
?>
--------------------------------------------------------------------------------------------------------------------------------
Thanks
User avatar
vargadanis
Forum Contributor
Posts: 158
Joined: Sun Jun 01, 2008 3:48 am
Contact:

Re: Physical Path Setting Problem

Post by vargadanis »

Please put your codes in [ PHP ] tags cause it is hard to read it this way.

http://php.net/getcwd()
Post Reply