On Fri, Jun 4, 2010 at 09:54, Michael Calkins <michaelcalk...@live.com> wrote:
> I would google this but I have no idea what this method is or how it works.
> app.php?ph=cus&id=4
> Can some tell me what this either called or how it works?Can I get a tutorial 
> for it please?

    Split up, it is:

        app.php             The filename and extension
        ?ph=cus&id=4     An HTTP query string

            ?                   Start of HTTP query string
            ph                 A parameter name 'ph' which is
accessible in this case via the $_GET superglobal array
            =                   The equals operator assigns a value to
a variable
            cus                The value of the parameter 'ph'
assigned in the HTTP query string given
            &                  The ampersand indicates that another
parameter (variable) will be concatenated with the HTTP query string
            id                  A second parameter name 'id'
            =                   Again, for variable assignment
            4                   The value of the 'id' variable
assigned in the HTTP query string given

    To read this information, the app.php script could be accessed in
a regular web browser with the query string given appended as you
provided.  If it's accessed via an HTTP request to a web server or
other PHP-enabled application, the code to parse the information could
be as follows:


  * To see if a specific parameter was passed within
  * the HTTP query string, we can simple check the
  * $_GET superglobal like any other array, like so:
if (isset($_GET['foo'])) {
    echo "The 'foo' parameter was passed to me, and equals '".$foo."'";

// Simple check to see if a variable equals a static value or not
if ($_GET['ph'] == 'cus') {
    echo "Yes, 'ph' equals 'cus'.";
} else {
    echo "No, 'ph' does not equal 'cus'.";

// Dump the array to the screen without basic details

// Dump the array without details, but with simple text formatting
echo "<pre>".PHP_EOL;
echo "</pre>".PHP_EOL;

// Print it all out with basic formatting
foreach ($_GET as $k => $v) {
    echo "<b>".$k." = ".$v."<br />".PHP_EOL;

    For more information, check the PHP manual and Google for
superglobals and the fundamentals of using PHP in a web-based

</Daniel P. Brown>
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
We now offer SAME-DAY SETUP on a new line of servers!

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to