Problem in showing images with cpanel
i,m facing problems in loading my websites images after uploading it to cpanel although it was working on my pc
i established a page to upload topic with images and save the name of the image in a specific field in my sql database and insert the image it self in a specific folder and pics were shown where i want them to be displayed but when uploading the website to cpanel there is something wrong with displaying all images stored into folders and retrieved by SQL query so i need your assistance specially this is my first website
here is the code
// getting data
$getdata=mysql_query("SELECT * from offers WHERE ended='working' && approved='approved' LIMIT $start , $perpage");
echo"<tr><td colspan='2' align='center'><font color='blue'size='5'><b> $record_count العروض المتاحة </b></font></td></tr>";
while ( $row1=mysql_fetch_assoc($getdata))
$joinoffernumbers= mysql_query("SELECT * FROM offerjoins WHERE offer_id='".$row1['id']."'") or die ("No data retrieved ");
$image111 is the name of the image retrieved from database
echo"<tr><td colspan='2' align='center'> <a href='show_this_offer.php?id=".$row1['id']."' title='".$row1['title']."'> <img src='home/mostafa/offerimages/$image111' title='".$row1['title']."' border='0' width='500' height='200' > </a></td> </tr>";
echo"<tr><td align='right' colspan='2'></td></tr>";
echo"<tr><td align='right' colspan='2'><font color='blue'><b><a href='show_this_offer.php?id=".$row1['id']."' title='".$row1['title']."'> ".$row1['title']." </b></font></a></td> </tr>";
"home/mostafa/offerimages/" would be relative to the location of the page that is being displayed. Is that what you really want? My guess (but it is just a guess) is that you really want something like "/offerimages/" (meaning the directory "offerimages" directly under your web root directory) or "offerimages/" (without the leading slash meaning relative to the directory that the current page is in). Remember that directories in URLs are based on the web root directory, not the file system root directory.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Another point to consider: Is your local workstation running Windows? If so, check the capitalization of file names. Windows is not case sensitive, unix based systems are. This can cause images not to load in the live environment that worked fine on your PC.
Thank you Nogdog
thank you jedaisoul
it is working now and i can see images clearly
Thank you so much
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)