Results 1 to 4 of 4

Thread: Need some help

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2003
    Posts
    148

    Post Need some help

    I want to make something like this

    http://domain.com/downloads.php?id=p...&serial=123456

    in one php page

    PHP Code:
    <?php
    if ($id === 'productname'){
        
    $link mysql_pconnect("localhost""root""password"); 
        
    mysql_select_db("dbname") or die("Database Error."); 
        
    $query ="SELECT name, email, serial FROM info WHERE serial = '" $_GET["serial"]. "'"
        
    $result mysql_query($query) or die ("Database Error." mysql_error( )); 

        if ( 
    mysql_num_rows($result) == ) {
            echo 
    "Not Found Serial Match";
            or die(
    mysql_error()); 
            
    mysql_close($link); 
            exit;
        }

        while (
    $row mysql_fetch_row($result)) { 
            echo 
    "Found Serial";
        } 

        
    mysql_free_result($result); 
        
    mysql_close($link); 
    }
        
    ?>
    Thank you for your help

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Need some help

    You'll have to be a bit more specific.
    What is your exact question?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Apr 2003
    Posts
    148

    Post Re: Need some help

    OK! sorry

    i'm trying to make a page call: downloads.php
    when pople insert serial number in the textbox and click on download with link
    123456 is the serial number poeple insert in textbox and softwarename is kind of software they try to download.

    if softwarename match and search for database serial match then download.

    PHP Code:
    Link should look kinda like this: http://domain.com/downlaods.php?id=softwarename&serial=123456
    <?php
    $id 
    $_GET['id'];
                    
    //here is the match downloads.php?id=softwarename
    if ($id === 'softwarename'){
        
    $link mysql_pconnect("localhost""root""password");
        
    mysql_select_db("dbname") or die("Database Error.");
        
    $query ="SELECT name, email, serial FROM info WHERE serial = '" $_GET["serial"]. "'";
        
    $result mysql_query($query) or die ("Database Error." mysql_error( ));

        if ( 
    mysql_num_rows($result) == ) {
            echo 
    "Not Found Serial Match";
            or die(
    mysql_error());
            
    mysql_close($link);
            exit;
        }

        while (
    $row mysql_fetch_row($result)) {
              
    //serial=123456 match but didn't work
            
    echo "Found Serial";
        }

        
    mysql_free_result($result);
        
    mysql_close($link);
    }
        
    ?>
    Last edited by lmf; Jul 1st, 2007 at 10:20 AM.

  4. #4
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Need some help

    to tell you the truth, i dont know what your code is doing... Are you trying to make it so that the file will download off your server?

    try this:
    PHP Code:
    <?php
    $id 
    $_GET['id'];
                    
    //here is the match downloads.php?id=softwarename
    if ($id === 'softwarename'){
        
    $link mysql_pconnect("localhost""root""password");
        
    mysql_select_db("dbname") or die("Database Error.");
        
    $query ="SELECT name, email, serial FROM info WHERE serial = '" $_GET["serial"]. "'";
        
    $result mysql_query($query) or die ("Database Error." mysql_error( ));

        if ( 
    mysql_num_rows($result) == ) {
            echo 
    "Not Found Serial Match";
            or die(
    mysql_error());
            
    mysql_close($link);
            exit;
        } else {

            while (
    $row mysql_fetch_row($result)) {
                
    //serial=123456 match but didn't work
                
    echo "Found Serial!";
            }
        }

        
    mysql_free_result($result);
        
    mysql_close($link);
    }
        
    ?>
    My usual boring signature: Something

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width