FireDrake Posted November 8, 2007 Share Posted November 8, 2007 Hi, I've got a few forms with a href in it all on one page. When you click this href, you will go to the page with method='GET' . Later in the script, I use the if (isset ($_GET['name'])). and the user will get the page he asked for. I want to ask how to get these href's to work without using forms. The form I have at this time is: <html> <head> <link rel="stylesheet" type="text/css" href="/css.css"/> <style type="text/css"> form { margin-top: -1em; margin: 0px; padding: 0px; } input { margin: 0px; padding: 0px; } input.hidden { display: none; } </style> </head> <body> <div class="c" style="position:absolute"> <form name="home" method="GET"> <input type=hidden name=link value=home class=hidden> <A href="javascript: document.home.submit()">Home</A> | </form> <form name="wedstrijden" method="GET"> <input type=hidden name=link value=wedstrijden class=hidden> <A href="javascript: document.wedstrijden.submit()">Wedstrijden</A> | </form> <form name="stemmen" method="GET"> <input type=hidden name=link value=stemmen class=hidden> <A href="javascript: document.stemmen.submit()">Stemmen</A> </form> </div> <?php if (isset ($_GET['home'])) { echo "<br /><br />the Page here"; } if (isset ($_GET['wedstrijden'])) { echo "<br /><br /> another page here"; } if (isset ($_GET['stemmen'])) { echo "<br /><br /> another page here"; } else { echo "no page"; } ?> </body> </html> I want the url linking to the right page in first place, and I don't want the forms with a break between each form. Because now all of my hrefs are horizontal instead of vertical next to each other. Can anyone please help me? Im stuck with this script for hours now. Quote Link to comment Share on other sites More sharing options...
trq Posted November 8, 2007 Share Posted November 8, 2007 <html> <head> <link rel="stylesheet" type="text/css" href="/css.css"/> <style type="text/css"> form { margin-top: -1em; margin: 0px; padding: 0px; } input { margin: 0px; padding: 0px; } input.hidden { display: none; } </style> </head> <body> <div class="c" style="position:absolute"> <a href="?link=home">Home</a> <a href="?link=wedstrijden">Wedstrijden</a> <a href="?link=stemmen">Stemmen</a> </div> <?php if (isset($_GET['link'])) { switch ($_GET['link']) { case "home": echo "<br /><br />the Page here"; break; case "wedstrijden": echo "<br /><br /> another page here"; break; case "stemmen": echo "<br /><br /> another page here"; break; default: echo "no page"; } } else { echo "no page"; } ?> </body> </html> Quote Link to comment Share on other sites More sharing options...
FireDrake Posted November 8, 2007 Author Share Posted November 8, 2007 Thank you thank you, I've just learned a few more things I can finaly continue with my site thanks to our genius I'll mark this as solved. Quote Link to comment 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.