Php fragment

1- Write php fragment code to print out the data submitted by the user through html form using get or post method? we need to display the field name and value??

Showing Answers 1 - 5 of 5 Answers

Faisal Jamil

  • Dec 27th, 2011
 

Code
  1. span style="color: #0000ff;">"$key : $value <br>"


Same code works equally for $_POST, depending on the method of HTML form. e.g.

Code
  1. <form action="" method="get">

  2.  

  3. <input name="username" type="text" />

  4. <input name="password" type="text" />

  5. <input type="submit"/>

  6.  

  7. </form>

Tim Huff

  • Jan 31st, 2012
 

Just iterate across the POST and GET globals

Code
  1. span style="color: #0000ff;">"Post data:

  2. ""$key:$value

  3. ""Get data:

  4. ""$key:$value";

Karthick

  • Apr 28th, 2012
 

Use $_REQUEST

Code
  1. span style="color: #0000ff;">"$key : $value <br>"

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions