ok here is my problem, I am kind of new to Php but have done programming before. I am recently learning php so am not sure what php can or cant do.
What i am trying to do here is i have a multiple submit buttons which i input some data and press submit, it works finr but when i enter more data and press another submit button the previous data is lost. What is the solution to that?
The following code is just written as an example.
<html>
<head>
<title>New Tip Calculator</title>
</head>
<body>
<center>
<?php
echo "<form name='mailinglist' method='post'>
<input type='text' name='email' />
<input type='submit' name='mailing-submit' value='Join Our Mailing List' />
</form>
<form name='contactus' method='post'>
<input type='text' name='email' />
<input type='text' name='subject' />
<input type='submit' name='contact-submit' value='Send Email' />
</form>";
if (!empty($_POST['mailing-submit'])) {
$var = $_REQUEST['email'];
echo"$var";
}
if (!empty($_POST['contact-submit'])) {
$email = $_REQUEST['email'];
$subject = $_REQUEST['subject'];
echo"$email $subject";
echo"$var";
}
?>
</center>
</body>
</html>