ali_2kool2002 Posted March 18, 2007 Share Posted March 18, 2007 hi how do i make 2 buttons ,, one to go to a different page say if button 1 is pressed it goes to x page,, and button to for goin to y page IN PHP? Quote Link to comment https://forums.phpfreaks.com/topic/43265-making-buttons/ Share on other sites More sharing options...
TheFilmGod Posted March 19, 2007 Share Posted March 19, 2007 it depends on what you mean "buttons." You can go to another page by <a href="http://www.yoursite.com>Click here to go to my website</a> But if you want to use images to link to a page its a different story. And if you want to make a button, well good luck to you! That is going to take sometime. Because you need to use rollover pictures with javascript or use flash. I used javascript for rollover images but it took me over an year to actually do it. So for now stick to normal text or image links. As you get more experience in html and javascript you can go to "button" links. Hope that helps! Quote Link to comment https://forums.phpfreaks.com/topic/43265-making-buttons/#findComment-210303 Share on other sites More sharing options...
RichardRotterdam Posted March 19, 2007 Share Posted March 19, 2007 Hi, You could use the button tag for buttons but you will need javascript to redirect when you click the button: <script> function jsGotoPage(url){ window.location=url; } </script> <button onclick=jsGotoPage('http://www.google.com')>goto google</button> <button onclick=jsGotoPage('http://www.youtube.com')>goto youtube</button> another option is to use an image for a link this will not require javascript <a href="http://www.google.com"><img scr="button.jpg" alt="button" /></a> <a href="http://www.youtube.com"><img scr="button.jpg" alt="button" /></a> Quote Link to comment https://forums.phpfreaks.com/topic/43265-making-buttons/#findComment-210498 Share on other sites More sharing options...
TheFilmGod Posted April 9, 2007 Share Posted April 9, 2007 don't forget to have <script type="text/javascript"> The previous post wouldn't validate. Quote Link to comment https://forums.phpfreaks.com/topic/43265-making-buttons/#findComment-225227 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.