- <?php
- //include database connection here
- if (isset($_POST['saveData'])) {
- //get entered data from form field below
- //use field names to get data
- //get username
- $name=$_POST['username'];
- //get email
- $email=$_POST['userEmail'];
- //get mobile number
- $number=$_POST['phoneNumber'];
- //save data to the database col1,col2 and col3 are Database columns, change accordingly to reflect your table columns
- $qry="INSERT INTO tableNmae('col1','col2','col3') VALUES('$name','$email','$number')";
- //run query
- $run_qry=mysqli_query($connect_string,$qry);
- //check if successfully or not
- if ($run_qry) {
- echo "Data saved";
- }else{
- echo "Something went wrong";
- }
- //$connect_string is connection string that you declared when you were instantiating connection to database
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>process Data</title>
- </head>
- <body>
- <!--DATA FORM, Make sure you replace process.php with your own data processing PHP script-->
- <form action="process.php" method="post" name="myForm">
- <input type="text" name="username" placeholder="enter username">
- <input type="email" name="userEmail" placeholder="enter email">
- <input type="number" name="phoneNumber" placeholder="enter mobile number">
- <!--Submit Button to be triggered-->
- <input type="submit" name="saveData" value="Save Data">
- </form>
- </body>
- </html>
-
- Active Topics
-
-
- by Eli 1 day ago All in One: YouTube, TED, X, Facebook and Instagram Reels, Videos, Images and Text Posts View the latest post Replies 332 Views 40547
- by Eli 1 day ago Iran's President Ebrahim Raisi Aged 63 Dies in a Helicopter Crash View the latest post Replies 3 Views 63
- by Eli 1 day ago Re: What is in Your Mind? View the latest post Replies 717 Views 307317
- by Eli 3 days ago PySpark for Large Data Processing View the latest post Replies 2 Views 8172
- by Eli 3 days ago Online Bible View the latest post Replies 3 Views 23331
- by Eli 4 days ago Generating SSH Key and Adding it to the ssh-agent for Authentication on GitHub View the latest post Replies 1 Views 489
- by Eli 1 week ago Russia Invades Ukraine View the latest post Replies 663 Views 241151
- by Eli 2 weeks ago President Museveni's Speech During International Development Association (IDA) Summit View the latest post Replies 1 Views 509
- by Eli 2 weeks ago From Simple Linear Regression Analysis to Covariance & Correlation to Independent Determinant, and R-Squared View the latest post Replies 11 Views 25145
- by Eli 2 weeks ago Collection of Greatest Christian Hymns of all Times View the latest post Replies 34 Views 72689
-
How to Process HTML Form Data Using PHP For Beginners
Last edited by cache on Thu Mar 29, 2018 11:12 pm, edited 7 times in total.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 1 guest