SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Feb 2006
    Location
    California
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Image in PHP. Help!

    Hi, I have the following problem and need help as soon as possible. I'm trying to put images in the administrator panel of one of my script, but the images are not displaying. See the codes below:


    <img src=\"".$host."/siteadministrator/images/home.gif\">


    <img src=\"".$host."/siteadministrator/images/home.gif\"><a href=\"".$host."/siteadministrator/\">".get_lang('named','home')."</a>

    <img src=\"/siteadministrator/images/home.gif\">

    I tried those three different ways, but still not working. Any help?
    Keyword Position Finder for Google, Yahoo! and Live

    http://www.phponly.com/keyword.php

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2005
    Posts
    1,191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <img src="/siteadministrator/images/home.gif">
    <?php
    echo '<img src="/siteadministrator/images/home.gif">';
    echo 
    '<img src="'.$host.'/siteadministrator/images/home.gif">';
    ?>

  3. #3
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok I was mistaken, it was the single quotes around the variable causing you the error.

    I thought you were using the variable $host to path the image.

  4. #4
    SitePoint Member
    Join Date
    Feb 2006
    Location
    California
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by hash View Post
    PHP Code:
    <img src="/siteadministrator/images/home.gif">
    <?php
    echo '<img src="/siteadministrator/images/home.gif">';
    echo 
    '<img src="'.$host.'/siteadministrator/images/home.gif">';
    ?>
    It gives me the following error:

    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in
    Keyword Position Finder for Google, Yahoo! and Live

    http://www.phponly.com/keyword.php

  5. #5
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What are you using the variable $host for?

  6. #6
    SitePoint Member
    Join Date
    Feb 2006
    Location
    California
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by co.ador View Post
    What are you using the variable $host for?
    The host is for menu links. As follow:

    <li><a href=\"".$host."/siteadministrator/\">".get_lang('named','home')."</a></li>

    The above code will display the word "Home" linked to admin panel.
    Keyword Position Finder for Google, Yahoo! and Live

    http://www.phponly.com/keyword.php

  7. #7
    SitePoint Wizard
    Join Date
    Nov 2005
    Posts
    1,191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by IntelFind View Post
    It gives me the following error:

    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in
    Nothing wrong with that code, what you are posting is not complete tho, so I don't know what you are doing.


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
  •