PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
I am trying to display two different favicon.ico in the url.
[syntax="html"]<html
<head> some head
<link rel="stylesheel" .......
link rel="shortcut icon" href="favicon.ico"> - This is how I normally use to display
Now that I am trying to use php inside this html code to display two different favicon.ico
<html
<head> some head
<link rel="shortcut icon"<?php
if(something is true)
echo "href='favicon1.ico' ''; /*some syntax should be wrong here, please correct me*/
else
echo "href='favicon2.ico'?>"; /*and some syntax is wrong here as well*/
</html>
i couldn't execute this as i get some errors. I am totally new to this php code. I would like help on the
syntax
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Look at the HTML it generates. I think you'll quickly spot your problem.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
<html>
<head> some head</head>
<link rel="shortcut icon"<?php
if(isset($test))
echo "href='favicon1.ico' "; /*some syntax should be wrong here, please correct me*/
else
echo "href='favicon2.ico'"; /*and some syntax is wrong here as well*/
?>>
</html>