Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP 

Capture user inputs on a website

Please I need a Php file to Capture user inputs on a website

Thanks
Google php post
Php file put contents
(Sep 9, 2017 04:02 AM)Charger Wrote:  Google php post
Php file put contents

Please I can't get it, could you explain a little bit?
(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

<?php 
//Evrything in the <form> code will be sent
<form method="post" action="page.php">
//Textbox to put value in
<input type="text" name="value1" />
//Button to send post request
<input type="submit" value="Send" />
</
form> 

In page.php you will have this code:
PHP Code

<?php
$value1 
= $_POST['value1'];//This will get the value of the textbox and put it in $value1

echo $value1;//This will echo out the value
?>
(Sep 9, 2017 04:24 AM)randomUsername25214 Wrote:  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

<?php 
//Evrything in the <form> code will be sent
<form method="post" action="page.php">
//Textbox to put value in
<input type="text" name="value1" />
//Button to send post request
<input type="submit" value="Send" />
</
form> 

In page.php you will have this code:
PHP Code

<?php
$value1 
= $_POST['value1'];//This will get the value of the textbox and put it in $value1

echo $value1;//This will echo out the value
?>

thanks Mate


(Sep 9, 2017 04:32 AM)Yani Wrote:  People like you make me fucking mad.

Google it

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



I couldnt find it from google thats why I post it here, and nobody force you to reply me.

Then you should consider learning how to properly do google searches
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!
index.html
Code
<form method="POST" action="login.php">
          <input type="text" name="username" />
          <input type="password" name="password" />
</form>

login.php
Code
<?php
$username = $_POST['username'];
$password = $_POST['password'];
echo 'Your password is ' . $password . ', Mr. ' . $username;
?>

Just 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.
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.
(Feb 3, 2018 03:19 PM)kickball34 Wrote:  i'm gonna get your ip address and rat your pc.
(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.
[Image: boostdroid-signature.gif]


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