Hi All,

Please help me understand:

  <li><a accesskey="2" href="index.php?id=7" title=" [Alt+2]">Products</a></li>

(1) Is [?id=7] argument passing to index.php?
(2) If so, how does index.php know what passing to him? in $_POST or ...?
(3) After click, it returns:http://www.limehost.net/index.php?id=7
(4) Again, how that '?id=7' come about ?
Be nice if you give me an example.

Thanks.

    to get values from URL

    index.php?id=7&name=Jonny

    in index.php:

    <?php
    
    $hisname = $_GET[ "name" ];
    $idnum = $_GET[ "id" ];
    
    echo $idnum;
    echo '<br>';
    echo $hisname;
    

      I got it. So they are passing args to $_GET. Thanks.

        passing info with $GET is very usefull,
        but I couldn't pass $
        GET info in same moment with $_POST,
        I tried to put url like index.php?id=7&name=Jonny in Action field for FORM
        is that common or I had some problems else?

        I've done it with $_SESSION.

          It should be possible to use $GET and $POST in same form
          if the $_GET is in a link, URL.
          As far as I know.

          But if you use same variable name for GET as for POST
          then the GET will usually be lost.

          But if you put it into
          <form action="index.php?id=7" method="POST">
          I really dont know what is happening.
          Better to put it in a plain normal <a href="....">

            It is possible to use GET parameters (i.e. Query string) with a POST, but not usual.

            Normally if you're going to have a POST form, any get parameters can be duplicated in hidden fields so they end up in $_POST in the final request.

            Mark

              Thanks for tip!
              never thought about hidden fields!!!!

              see you!

                Write a Reply...