SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Member
    Join Date
    Nov 2008
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How and where do i place favicon.ico in an index.php page?

    Hi, im trying to add my favicon.ico to my index.php site

    can some tell me what and where i need to type??

    Most tutorials give me it in html but my index looks different to theres??

    Thanks

  2. #2
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Location
    England
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just place it in your site root no need to change any files
    e.g. http://www.sitepoint.com/favicon.ico

  3. #3
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    ...or, use a meta tag if you want to do it 'properly'. I think it was IE that started automatically looking for a favicon.ico in the root, and other browsers just copied this behaviour.

    An example:

    HTML Code:
    <link rel="icon" href="favicon.png" type="image/png" />
    Put this in the <head> section of your site. Just make sure you use the right type for the image you are using.

  4. #4
    SitePoint Member
    Join Date
    Nov 2008
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stormrider View Post
    ...or, use a meta tag if you want to do it 'properly'. I think it was IE that started automatically looking for a favicon.ico in the root, and other browsers just copied this behaviour.

    An example:

    HTML Code:
    <link rel="icon" href="favicon.png" type="image/png" />
    Put this in the <head> section of your site. Just make sure you use the right type for the image you are using.
    i dont see this kind of coding in my index.php

    will it look different as its in php?

  5. #5
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It isn't PHP, it's HTML. You probably don't see it there because it isn't there... you need to add it!

  6. #6
    SitePoint Member
    Join Date
    Nov 2008
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok so where abouts should i put it in

    heres what my page looks like

    $smarty->assign('pageCharset', $pageCharset );
    $smarty->assign('phpCharset', $phpCharset );
    $smarty->assign('pageMimeType', $pageMimeType );
    $smarty->assign('pageName', 'index');
    $smarty->assign('pageTitle', '*********"');
    $smarty->assign('pageKeywords', '*********e');
    $smarty->assign('pageDescription', '*********.');
    $smarty->assign('pageAuthor', '*********');
    $smarty->assign('copyright', '*********');
    $smarty->assign('pageJavascriptSrc', array('/shared/mootools/v1.2.0/mootools.js', '/shared/js/v1/site.js', 'index/js/v1/perlajax.js','index/js/v1/index.js'));
    $smarty->assign('pageCssStylesheets', array(

  7. #7
    SitePoint Wizard lorenw's Avatar
    Join Date
    Feb 2005
    Location
    was rainy Oregon now sunny Florida
    Posts
    1,098
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    In index.php (or an included file from a templates file) you should see a doctype, this begins with <!DOCTYPE

    look further down and you will see <head> tag

    below it is where you add the favicon.ico, make sure it is before </head>

    hth
    What I lack in acuracy I make up for in misteaks

  8. #8
    SitePoint Member
    Join Date
    Nov 2008
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    had a look through the coding and i cant find

    <!DOCTYPE

    nor

    <head> tag



    i didnt a search and find and doctype isnt even in the code

    head search results only come up with header

  9. #9
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You have a PHP page, which references a template page.

    You need to know which file the template is before you can continue. Find it, it contains HTML not PHP, and can end in any extention but least likely PHP (usually .html or .tpl). That will contain a head tag etc.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  10. #10
    SitePoint Enthusiast webmister's Avatar
    Join Date
    Dec 2007
    Location
    paris
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi BeatPlexity:

    May be I have a solution:
    If you are using php script and don't find anything on the index file then you might probably have a directory called "templates" or "includes" or anything. Check all the files in all the directories and find out a file called "header.php". Open and edit, there you'll probably see those things such as:
    <!DOCTYPE
    <head> and so on.
    just put this code:
    <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
    between <head> and </head>
    make sure to upload your small image 16x16 or 32x32 transferred into favicon.ico by using icon creator software. The small image must be saved as favicon.ico in your desktop before uploading.
    once this job is done, upload this image to your /images directory. If you upload this to your main directory then you may have tochange the above code.
    as:
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">

    If you can not figure out what I'm and these guys are saying then send me your image no matter how big. I'll help you make it smaller and turn this into your favourite favicon.ico.

    Happy!


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
  •