Solved

post data to page

Posted on 2008-11-01
4
246 Views
Last Modified: 2008-12-15
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?
0
Comment
Question by:XK8ER
  • 2
  • 2
4 Comments
 
LVL 28

Accepted Solution

by:
gamebits earned 500 total points
ID: 22859416
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
 
LVL 1

Author Comment

by:XK8ER
ID: 22859428
like I said, its not username and password but anything that gets posted in the page!
0
 
LVL 28

Expert Comment

by:gamebits
ID: 22859438
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
 
LVL 1

Author Comment

by:XK8ER
ID: 22859448
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

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now