0

I am having one button1, when click on it another button2 comes. when click on button2 i am showing an image on the right side. But the button2 is disappearing. I want all the buttons to be present in the page. Please help whats going wrong in this.

<form method="post" action="">
<input type="submit" name="submit_base" value="Style">
</form>

<?php
if(isset($_POST['submit_base']))
{ ?>

<form method="post" action="">
<input type="submit" name="submit1" value="Style1">
</form>

<?php
}
?>

<?php

if(isset($_POST['submit1']))
{
$imagepath = "shirt7.jpg";
echo "<img style='float:right;' src='$imagepath' />";
?>

}
?>

The image is coming but style1 button is going off (disappearing). How can I retain the buttons.

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by diafol
0
if(isset($_POST['submit_base']) || isset($_POST['submit1'])){

instead of

if(isset($_POST['submit_base'])){

However, do you need all the different forms? COuld you not place all the buttons in the one form, like this?

<form method="post" action="">
<input type="submit" name="submit_base" value="Style">
<?php
if(isset($_POST['submit_base']) || isset($_POST['submit1'])){
?>
<input type="submit" name="submit1" value="Style1">
<?php
}
?>
</form>

You could even use javascript for this.

Edited by diafol: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.