Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host="localhost";
- $user="root";
- $pwd="";
- $db="mohita";
- $conn=mysqli_connect($host,$user,$pwd,$db) or die("unable to connect");
- ?>
- <html>
- <head>
- <title>Try here</title>
- </head>
- <body>
- <form method="post">
- <input type="text" name="yourname"/>
- <input type="email" name="mailid"/>
- <input type="password" name="mypass"/>
- <input type="number" name="phn"/>
- <textarea rows="5" cols="20" name="address"/></textarea>
- <input type="submit" name="reg"/>
- </form>
- </body>
- </html>
- <?php
- if(isset($_POST['reg'])){
- $yourname=$_POST['yourname'];
- $mailid=$_POST['mailid'];
- $mypass=$_POST['mypass'];
- $phn=$_POST['phn'];
- $address=$_POST['address'];
- $query="insert into login(Name,Email,Pass,Mobile,Address) values('$yourname','$mailid','$mypass','$phn','$address')";
- $run=mysqli_query($conn,$query);
- if($run){
- echo "<h1>Data submitted successfully</h1>";
- }
- else{
- echo "<h1>Failed to submit data</h1>";
- }
- }
- ?>
Add Comment
Please, Sign In to add comment