- <?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 10 hours ago All in One: YouTube, TED, X, Facebook and Instagram Reels, Videos, Images and Text Posts View the latest post Replies 328 Views 37779
- by Eli 10 hours ago Re: What is in Your Mind? View the latest post Replies 705 Views 303514
- by Eli 4 days ago Russia Invades Ukraine View the latest post Replies 663 Views 238509
- by Eli 6 days ago PySpark for Large Data Processing View the latest post Replies 1 Views 7934
- by Eli 1 week ago President Museveni's Speech During International Development Association (IDA) Summit View the latest post Replies 1 Views 325
- by Eli 1 week ago From Simple Linear Regression Analysis to Covariance & Correlation to Independent Determinant, and R-Squared View the latest post Replies 11 Views 24934
- by Eli 2 weeks ago Collection of Greatest Christian Hymns of all Times View the latest post Replies 34 Views 70486
- by Eli 2 weeks ago Pondering Big Cosmology Questions Through Lectures and Dialogues View the latest post Replies 34 Views 58503
- by Eli 2 weeks ago Programmatically Manipulate Files: Renaming, Reading, Writing, Deleting, and Moving Files Between Folders View the latest post Replies 7 Views 18595
- by Eli 3 weeks ago Iran Launches Retaliatory Attack Against Israel, and Israel Retaliates by Attacking Iranian Isfahan Millitary Base View the latest post Replies 28 Views 20911
-
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 0 guests