Please I need a Php file to Capture user inputs on a website
Thanks
Thanks
|
PHP
Capture user inputs on a website |
(Sep 9, 2017 04:02 AM)Charger Wrote: Google php post Please I can't get it, could you explain a little bit?
Sep 9, 2017 04:24 AM
(This post was last modified: Sep 9, 2017 04:26 AM by randomUsername25214.)
(Sep 9, 2017 04:06 AM)dark_angel1 Wrote: Please I can't get it, could you explain a little bit? I am bad at explaining but: You can send a post request via html using this code(page.php is the page you want to send the request to.): PHP Code In page.php you will have this code: PHP Code
Sep 9, 2017 04:37 AM
(This post was last modified: Sep 9, 2017 04:39 AM by dark_angel1.)
(Sep 9, 2017 04:24 AM)randomUsername25214 Wrote: I am bad at explaining but: thanks Mate (Sep 9, 2017 04:32 AM)Yani Wrote: People like you make me fucking mad. I couldnt find it from google thats why I post it here, and nobody force you to reply me. (Sep 9, 2017 04:37 AM)dark_angel1 Wrote: thanks Mate Then you should consider learning how to properly do google searches
Sep 12, 2017 09:55 AM
(This post was last modified: Sep 12, 2017 09:57 AM by BenzaHdd.)
You need to use a POST or a GET. POST's are recommended as GET's can easily be forged and adapted.
Do something like this : HTML <form method="POST"> <input type="text" placeholder="Your name here" name="name" /> <input type="number" placeholder="Your age here" name="age" /> <input type="submit" value="Submit" /> </form> PHP <?php $error = 'Your name and age is required'; if(isset($_POST)) { if(isset($_POST['name']) && isset($_POST['age'])) { $name = $_POST['name']; $age = $_POST['age']; echo $name.', your age is '.$age; } else { echo $error; } } else { echo $error; } ?> Hope it helps. Need a Professional Website created? PM me on here for a FREE Quote today!
Sep 12, 2017 04:33 PM
(This post was last modified: Sep 12, 2017 04:34 PM by Nixco.)
index.html
Code <form method="POST" action="login.php">login.php Code <?phpJust to explain the concept. Please do research about MySQL injections if you intend onto storing data into a local database. The code I provided is not intended for public use.
Sep 12, 2017 04:34 PM
(This post was last modified: Sep 12, 2017 04:35 PM by grady.)
https://www.w3schools.com/php/php_forms.asp
If you tried using Google, you should give up on learning to code. There's a point where you need to ask a forum, and this is not one of those. If you can never figure out this by yourself, you will literally never make any progress. DO NOT DEPEND ON OTHERS FOR YOUR OWN PROGRESS. (Sep 12, 2017 04:34 PM)grady Wrote: If you tried using Google, you should give up on learning to code. I reckon he should give up on a lot more then just code if he can't google correctly. |
|
|
| Possibly Related Threads... | |||
| Thread / Author | Replies | Views | Last Post |
| [PHP] by Tɦɛ AlexMay 6, 2016 08:54 AM | 8 | 209 |
May 6, 2016 08:54 AM Last Post: Scy7e |
| [PHP] by Br4v0Dec 2, 2014 10:04 AM | 13 | 328 |
Dec 2, 2014 10:04 AM Last Post: Sakuto |
| [Javascript] by t.proMar 30, 2014 03:10 PM | 0 | 92 |
Mar 30, 2014 03:10 PM Last Post: t.pro |