[PHP] Print Get variables

CGI, Perl, PHP, CSS, HTML, JavaScript

[PHP] Print Get variables

Postby funvill » Tue Jan 17, 2006

This is an interesting little script useful for debugging PHP scripts.
What it does is prints all the Get variables and there values
Code: Select all
<?php
    $j = "";
    print("Lets retrieve all the variables submitted to this ");
    print("script via a GET request:<br>");
    foreach($_GET as $key => $i){
        print("$key=$j<br>");
    }
    if($_GET['Submit'] == "Send GET Request")
        $j = "done!<br>";
    ?>

<form method="GET">
    Name: <input name="name"><br>
    Email: <input name="email" size="25"><br>
    <input name="Submit" type="submit" value="Send GET Request">
</form>
funvill
Site Admin
 
Posts: 79
Joined: Tue Jan 17, 2006
Location: Vancouver

Re: [PHP] Print Get variables

Postby Shendemiar » Wed Sep 30, 2009

Code: Select all
<?php echo "<pre>".var_export($_POST,1)."</pre>"; ?>
Shendemiar
 
Posts: 1
Joined: Wed Sep 30, 2009


Return to Tips and tricks

Who is online

Users browsing this forum: No registered users and 1 guest

cron