- <?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 3 hours ago All in One: YouTube, TED, X, Facebook and Instagram Reels, Videos, Images and Text Posts View the latest post Replies 323 Views 23302
- by Eli 1 day ago Re: What is in Your Mind? View the latest post Replies 697 Views 288365
- by Eli 1 day ago Russia Invades Ukraine View the latest post Replies 655 Views 224170
- by Eli 2 days ago Collection of Greatest Christian Hymns of all Times View the latest post Replies 34 Views 57157
- by Eli 3 days ago Pondering Big Cosmology Questions Through Lectures and Dialogues View the latest post Replies 34 Views 57572
- by Eli 4 days ago Programmatically Manipulate Files: Renaming, Reading, Writing, Deleting, and Moving Files Between Folders View the latest post Replies 7 Views 6238
- by Eli 1 week ago Iran Launches Retaliatory Attack Against Israel, and Israel Retaliates by Attacking Iranian Isfahan Millitary Base View the latest post Replies 28 Views 5766
- by Eli 2 weeks ago Python Packages for Scientific Computing View the latest post Replies 8 Views 12441
- by Eli 2 weeks ago Dunia Yetu: Building Tanzania's Digital Future Together View the latest post Replies 5 Views 3242
- by Eli 3 weeks ago What is Retrieval-Augmented Generation (RAG)? View the latest post Replies 2 Views 4970
-
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