<?php
$dbHost = "localhost";
$dbUser = "root";
$dbPass = "";
$dbName = "test";
$conn = mysql_connect($dbHost, $dbUser, $dbPass);
if(!$conn){
die(mysql_error());
}
mysql_select_db($dbName, $conn) or die(mysql_error());
if(isset($_POST['submit'])){
$field = $_POST['field'];
}
if(isset($_POST['submit2'])){
$field2 = $_POST['field2'];
}
if(isset($_POST['submit3'])){
$field3 = $_POST['field3'];
}
?>
<?php
if(!isset($_POST['submit']) || isset($_POST['submit']) != "true"){
?>
<form id="create" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data">
<label>field :</label>
<input type="text" name="field" />
<input type="submit" name="submit" value="submit">
</form>
<?php
}
elseif(!isset($_POST['submit2']) || isset($_POST['submit2']) != "true"){
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data">
<label>field 2 :</label>
<input type="text" name="field2" />
<input type="submit" name="submit2" value="submit">
</form>
<?php
}
elseif(!isset($_POST['submit3']) || isset($_POST['submit3']) != "true"){
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data">
<label>field 3 :</label>
<input type="text" name="field3" />
<input type="submit" name="submit3" value="submit">
</form>
<?php } ?>
adeeb.keyaam -2 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.