Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

post data to page

Posted on 2008-11-01
4
248 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

856 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