post data to page

hello there..
I would like to post data to a page in php and then show the information of the posted data in the page..
so if this data if posted (Username=joe&Password=joe) then show it on the page..
it doesnt have to be username or password.. but anything that gets posted!
how can I do this?
LVL 1
XK8ERAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
gamebitsConnect With a Mentor Commented:
Assuming the data is being posted via a form

You would get the post data like this

$username = $_POST['username'];
$password = $_POST['password'];

And to display it on the page just echo the variable.

echo "USERNAME: $username";
echo "PASSWORD: $password";
0
 
XK8ERAuthor Commented:
like I said, its not username and password but anything that gets posted in the page!
0
 
gamebitsCommented:
Yes, what you need to do is use the name given to the posted data and assign it to a variable.

From where do you get the posted data?
0
 
XK8ERAuthor Commented:
from different pages from different forms.. that why I cannot use echo "USERNAME: $username";
because all of them are different.. so I want something to output the posted data!
0
All Courses

From novice to tech pro — start learning today.