when testing a php form can i submit a form to a php scripts that will show all posted fields without me having to echo each single form field?
Many Thanks
Mark
I could be wrong on this but someone will rectify me.
foreach ($_POST as $v) { echo $v . '<br />'; }
cheers, that works great for one part, but I also need the field names if possible!!!
this way i can check for wrong field names etc!!!
I use this:
?> <table border=1> <tr><th colspan="2">Post</th></tr> <tr><th>Key</th><th>Value</th></tr> <?php foreach ($_POST as $k => $v) { echo '<tr><td>' . $k . '</td><td>' . $v . '</td></tr>'; $post = 1; } if(!$post) echo '<tr><td colspan="2" style="color:red;">No post vars.</td></tr>'; ?> <tr><th colspan="2">Get</th></tr> <tr><th>Key</th><th>Value</th></tr> <?php foreach ($_GET as $k => $v) { echo '<tr><td>' . $k . '</td><td>' . $v . '</td></tr>'; $get = 1; } if(!$get) echo '<tr><td colspan="2" style="color:red;">No get vars.</td></tr>'; ?> </table>
madwormer2 you are a bloody star!
cheers mate.