Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Path problem of images in php

  1. #1
    Join Date
    Mar 2005
    Posts
    26

    Default Path problem of images in php

    Hi everyone, im having a problem in php file..i cannot display the image on my site..check this out..http://lanavalmason269.bizhat.com.

    my index.php is in root folder.."/" i have a images folder

    here is my code..

    index.php
    <?php
    include("page_header.php");
    ?>

    page_header.php

    /*this is the tag that should display the image*/

    [img]images/coloredsqcomp.gif[/img]</td>


    But it cannot display the image..

    Help please...Thanks

  2. #2

    Default

    I've had this problem before. What you have to do is upload the image you want to your ftp folder, then get the address for it (it should be the address of your ftp folder with /(picturename).gif or jpg or whatever the format is) and make that the url of the image (or image source). So instead of [img]images/coloredsqcomp.gif[/img] you should have [img]ftp://lanavalmanson269.bizhat.com:(pass)@lanavalmansion2 69.bizhat.com/coloredsqcomp.gif[/img]
    You may want to encrypt it after you do this because then people can hack your site ((pass) stands for your password. People can simply look at the properties and see that). Another option is choosing an image host and changing the url (or image source) to match its location.

  3. #3
    Join Date
    Mar 2005
    Posts
    26

    Default

    hi takinganap3721
    , tnx 4 reply..actually i dont have problem when accessing directly my page_header.php file.but when i included this in my index.php this was the problem..all are fine except it cannot display the image.

  4. #4
    Join Date
    Mar 2005
    Location
    sibiu
    Posts
    44

    Default

    Hello
    Please be aware that on this webserver the file test.gif is different than Test.gif (case-sensitive).
    If this is the line for displaying the picture
    Code:
    [img]images/coloredsqcomp.gif[/img]
    and you want to be accesible from any location from your account then use this instead ...
    Code:
    [img]/images/coloredsqcomp.gif[/img]
    if you have the "images" folder on your root directory.

    Never use
    Code:
    [img]ftp://lanavalmanson269.bizhat.com:(pass)@lanavalmansion269.bizhat.com/coloredsqcomp.gif[/img]
    And in index.php try using ...
    index.php
    Code:
    <?php 
    include('page_header.php'); 
    ?>
    HTH

  5. #5
    Join Date
    Mar 2005
    Location
    sibiu
    Posts
    44

    Default

    Does it solve your problem?

  6. #6
    Join Date
    Mar 2005
    Posts
    26

    Default

    nesheret, wait i will try your solution..i will get you back..thanks

  7. #7
    Join Date
    Mar 2005
    Posts
    26

    Default

    still doenst work...i can't imagine why isnt working...you can visit the site so you have an idea..if you try to access directly the page_header.php it works..it find the images folder and the gif file...when i included this page_header.php on to the index.php..it doesnt work..though they are on the same directory.(root directory)

  8. #8
    Join Date
    Mar 2005
    Posts
    26

    Default

    Hope there is admin in this site who can answer my question. Because i try to upload my files into another freewebshosting and it doesnt have a problem on path of images.

  9. #9
    Join Date
    Mar 2005
    Location
    sibiu
    Posts
    44

    Default

    In the worst case just use the full path ... ex: http://lanavalmansion269.bizhat.com/coloredsqcomp.gif
    When I will get home I will try to see what is your problem.
    HTH

  10. #10
    Join Date
    Mar 2005
    Location
    sibiu
    Posts
    44

    Default

    Your php script should be something like(I have tested it and it works on my account) ....
    Code:
    <?php
      echo "[img]images/coloredsqcomp.gif[/img]";
    php>
    Regards

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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