Page 1 of 1

page post on its self

Posted: Sun May 17, 2009 3:33 pm
by amao
hi all
I have page with hyperlink the page URL is http://www.mysite.com
I need when the user click the hyperlink show page with the same URL
but it contain button this button lead to other URL

Re: page post on its self

Posted: Sun May 17, 2009 7:35 pm
by Gabriel
I didn't quite understand your post. To clarify, you want a page that shows a button when the link is clicked? But you want the button to be on the same page/file. So you have your page (mypage.php) and on it is the link which would be mypage.php?showbutton. In the code you would say:

Code: Select all

<?php
if ($_GET['showbutton']) {
?>
<form action="nextpage.php"><input type="submit" value="The Button" /></form>
<?php
} else {
?>
<a href="mypage.php?showbutton">Show the Button!</a>
<?php
}
?>