Solved

post data to page

Posted on 2008-11-01
4
250 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
[X]
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
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
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…

738 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