Sunday, August 7, 2022

DATA FORM PHP

<?php
$name=$_GET['n1']
?>
<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body style="background-color: <?php echo $name;?>">
<h1>Fill your Registration form of IICS</h1>
<form action="ger.php" method="post">
<label for="firstname">First name</label>
<input type="text" name="firstname"><br><br>   
<label for="lastname">Last name</label>
<input type="text" name="lastname"><br><br>
<label for="password1">Choose a password</label>
<input type="password" name="password1"><br><br>
<label for="password2">Retype password</label>
<input type="password" name="password2"><br><br>
<label for="gender">Your Gender?</label>
<input type="radio" value="Male" name="gender">Male
<label for="gender"></label>
<input type="radio" value="Female" name="gender">Female<br><br>
<label for="cr">Which Course you select</label>
<select name="cr">
    <option value="ADCE">ADCE</option>
    <option value="WD+ECO">WD+ECO</option>
    <option value="DCA">DCA</option>
</select><br><br>
<label for="class">Attend trial classes?</label>
<input type="checkbox" name="class" value="yes"><br><br>
<label for="comment">Comment</label>
<textarea name="comment" rows="4" cols="50" placeholder="optional"></textarea><br><br>
<input type="Submit">
</form><br><br><br>
<form action="Eform.php">
<input type="color" name="n1">
<input type="submit" value="submit" name="">
</form>
</body>
</html>  


php coding here
<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
<h1>Submitted Form Data</h1>
<p>Thankyou for registering. There is the information you submitted:</p>
<dl>
<dt>First name:</dt><dd><?php echo $_POST["firstname"]?></dd>    
<dt>Last name:</dt><dd><?php echo $_POST["lastname"]?></dd>
<dt>Password:</dt><dd><?php echo $_POST["password1"]?></dd>
<dt>Retype Password:</dt><dd><?php echo $_POST["password2"]?></dd>
<dt>Gender:</dt><dd><?php echo $_POST["gender"]?></dd>
<dt>Which Course you select:</dt><dd><?php echo $_POST["cr"]?></dd>
<dt>Attend trial classes?:</dt><dd><?php echo $_POST["class"]?></dd>
<dt>Comment:</dt><dd><?php echo $_POST["comment"]?></dd>
</dl>
</body>
</html>

No comments:

Post a Comment