www.webdeveloper.com
Results 1 to 4 of 4

Thread: Problem in showing images with cpanel

  1. #1
    Join Date
    Mar 2012
    Posts
    11

    Problem in showing images with cpanel

    hi
    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
    Code:
    (
    //display data 
        
         
        // 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 ");
                        $joinsofferrow=mysql_num_rows($joinoffernumbers);
         if($joinsofferrow >=1){
                     $joins="$joinsofferrow";
                     }else{$joins="إشترك ألان";}
        
    $image111 is the name of the image retrieved from database 
        $image111=$row1['image'];
        
        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>";
    
    )

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,245
    "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

    eBookworm.us

  3. #3
    Join Date
    Mar 2012
    Posts
    1,402
    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.

  4. #4
    Join Date
    Mar 2012
    Posts
    11
    Thank you Nogdog
    thank you jedaisoul
    it is working now and i can see images clearly
    Thank you so much

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles