How do you pass in a variable via URL without a pre-built static array? I know this has to be possible somehow because it's used in all sorts of scripts, especially forums, like with topic IDs and what not. The script I'm working on right now passes the name of a script in to a download.php file, then it uses that to find the right row in a MySQL database marked with the same name, to add one to the download count and fetch the filename to download. $GET and $REQUEST don't work without the array, so far as I can tell, so please help...

    What do you mean with a pre-build static array?

    Most script basically pass either variables used in a searchstring, or record ID values.

    so if you see a link to:

    ..page.pgp?id=1

    in page.php this happens:

    $id  = $_GET['id'];
    
    $result = mysql_query("select * from TABLE where id = $id") or die(mysql_error());
    

    J.

      Ah, thanks. I figured out what I was doing wrong ... it was the link to the page, not the page itself. I accidentally placed a '?' where a '&' should go...

        Write a Reply...