How can i do? "?click=text"

Discussion in 'PHP' started by johonwayni, Nov 4, 2011.

  1. #1

    Attached Files:

    johonwayni, Nov 4, 2011 IP
  2. kristenmorey111

    kristenmorey111 Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can make link using HTML code :
    <a href="http://www.download.com/download/1212312?click=text">text</a>

    If this is not your answer then please let me know some detail....
     
    kristenmorey111, Nov 4, 2011 IP
  3. johonwayni

    johonwayni Member

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    ??
    ----
    Please check; http://img802.imageshack.us/img802/460/downloadclick2.png
     
    johonwayni, Nov 4, 2011 IP
  4. AsHinE

    AsHinE Well-Known Member

    Messages:
    240
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    138
    #4
    I guess there are al least two ways to do it.
    1. Analyze server logs and fetch these values from them.
    2. Serve files with PHP, so you can write these values into database and then output necessary file.
     
    AsHinE, Nov 5, 2011 IP
  5. Anveto

    Anveto Well-Known Member

    Messages:
    697
    Likes Received:
    40
    Best Answers:
    19
    Trophy Points:
    195
    #5
    I would do this ^^ or generate the code with php and then in your php file you can check what ?click= like this

    $click = $_GET['click'];
    //This will get the value text from the url and put it into a variable.
    //You could use this to generate the download link on the page
    $finddownload = mysql_query("SELECT downloadurl FROM downloads WHERE title=$click");
    echo 'Download link: ';
    echo mysql_result($finddownload,0);
    PHP:
     
    Anveto, Nov 6, 2011 IP
  6. johonwayni

    johonwayni Member

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #6
    Thank you for interested.
    SQL query would be how?
     
    johonwayni, Nov 6, 2011 IP
  7. Anveto

    Anveto Well-Known Member

    Messages:
    697
    Likes Received:
    40
    Best Answers:
    19
    Trophy Points:
    195
    #7
    I was using this in the example

    $finddownload = mysql_query("SELECT downloadurl FROM downloads WHERE title=$click");
    PHP:
    This would select a value from a column called downloadurl in a table called downloads where the title is the same as what click is equal to in your url.

    I am not sure what you are trying to get from your database or what you are trying to do so its hard for me to explain it much further.
     
    Anveto, Nov 6, 2011 IP
  8. ChefGaby

    ChefGaby Active Member

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    96
    #8
    Great, not she can get hacked because you didn't sanitize the value :)
     
    ChefGaby, Nov 6, 2011 IP
  9. Anveto

    Anveto Well-Known Member

    Messages:
    697
    Likes Received:
    40
    Best Answers:
    19
    Trophy Points:
    195
    #9
    It was just a basic example, im not going to write all the code ;) but its good that you pointed it out
     
    Anveto, Nov 6, 2011 IP
  10. johonwayni

    johonwayni Member

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #10
    Thank you!
     
    johonwayni, Nov 14, 2011 IP