NemoZ
asked on
Make This Page Your Homepage Script
Hey guys,
I'm looking for a small scrip, that works in most common (or all) browsers, that when clicked can make my site index as the users homepage. I know that there are tons of Java script ones but I was wondering if anyone here could help me with one in PHP?
Thank you.
Cheers Nemo
I'm looking for a small scrip, that works in most common (or all) browsers, that when clicked can make my site index as the users homepage. I know that there are tons of Java script ones but I was wondering if anyone here could help me with one in PHP?
Thank you.
Cheers Nemo
As said by madwax this is not possible in PHP.
PHP is server side, all of the script is processed on the server before it is outputted as plain html ready to be sent to the browser, JavaScript operates client side (in the browser) which is why it is possible with that, bookmarking a site with a script requires a clinet side action in the browser.
That said im pretty sure JS boomarking code will only work in IE and given that many people are starting to use alternative browsers such as Firefox its something that i would avoid adding to your page at all.
PHP is server side, all of the script is processed on the server before it is outputted as plain html ready to be sent to the browser, JavaScript operates client side (in the browser) which is why it is possible with that, bookmarking a site with a script requires a clinet side action in the browser.
That said im pretty sure JS boomarking code will only work in IE and given that many people are starting to use alternative browsers such as Firefox its something that i would avoid adding to your page at all.
Just done a quick check to confirm my suspicion and it seems i was right, all homepage scripts (of which every example is pretty much identical to the one posted by madwax so its a pretty inflexible implementation) are functional in IE only, and as said before are native to the JS language.
So as far as your wish goes for a cross browser script working from PHP im afraid its not going to happen.
So as far as your wish goes for a cross browser script working from PHP im afraid its not going to happen.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you might want to make the check a bit tighter by replacing
if (strstr($browser,"ie"))
with
if (strstr($browser,"msie"))
but im working with IE6 and Firefox 0.9 both of which work fine with the original
if (strstr($browser,"ie"))
with
if (strstr($browser,"msie"))
but im working with IE6 and Firefox 0.9 both of which work fine with the original
ASKER
Thank you both for your help.
Cheers Nemo
Cheers Nemo
no problem :)
|)iablo
|)iablo
This cannot be done solely by php you must use it through the javascript interface, but what you can do is:
<?echo '<A HREF="#" onClick="this.style.behavi
Cheers!
//madwax