Jump to content


Photo

Capture Form Field Names


  • Please log in to reply
2 replies to this topic

#1 gavn8r

gavn8r
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 06 September 2006 - 09:30 PM

I want to do this ASP code in PHP.  Can anybody help?  It captures all data from the form that passes to it and writes out the field names.

<%
Set FormFields = request.form
For each Field in FormFields
response.write Field & " = " & Request.Form(Field) & "<br>"
Next
%>

#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,016 posts

Posted 06 September 2006 - 11:28 PM

<?php
foreach ($_POST as $fld => $val) echo "$fld  = $val<br />";
?>

If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#3 gavn8r

gavn8r
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 06 September 2006 - 11:31 PM

Thank you so much... it worked perfectly!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users