page post on its self

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!

Moderator: General Moderators

Post Reply
amao
Forum Newbie
Posts: 21
Joined: Sun May 10, 2009 5:13 am

page post on its self

Post 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
User avatar
Gabriel
Forum Commoner
Posts: 41
Joined: Wed May 06, 2009 8:12 pm
Location: Las Vegas

Re: page post on its self

Post 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
}
?>
 
Post Reply