Need a little help with some code problems..

Discussion in 'PHP' started by JeffurryB, Dec 26, 2010.

  1. #1
    So i'm looking for some help with a little coding. I'm not that new to php, but its been years and I haven't messed with it. Me and a friend decided to start our own traffic exchange site (currently not live).

    I'm trying to figure out how to credit a user a number of random credits for clicking a text based link (random credits range between 17 and 527).
    also when they click I don't want the real URL to show up, but am trying to get something like this below:
    http://mysite.com/view.php?id=67280&id2=test&id3=015429130812445
    But had not figured it out, also trying to figure out how to randomly give 500 credits to any user when they find a special image in any of the links.

    I've looked all over the place, and just couldn't find anything on what I was searching for. I've got no money to spend, so I'm looking for a bit of free help. I've tried looking for free traffic exchange scripts, but none of them seem to be that good.

    Any help is better than None.

    Thank You.
     
    JeffurryB, Dec 26, 2010 IP
  2. Alastair Gilfillan

    Alastair Gilfillan Active Member

    Messages:
    120
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #2
    That's a loaded request but it'll need to be server-side to hide it from the user, otherwise - as you say - they'll find the format and abuse it. How about using a form instead of an anchor link?
    
    if($_POST['click']){
    [INDENT]$user_credits = $user_credits + rand(17, 527);
    header("Location: http://www.affiliatesite.com");[/INDENT]
    }
    Code (markup):
     
    Alastair Gilfillan, Dec 26, 2010 IP
  3. _:codefan:_

    _:codefan:_ Active Member

    Messages:
    18
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    58
    #3
    encrypt those variables in the link with cipher + base64 and no one will be able to manipulate it
     
    _:codefan:_, Dec 26, 2010 IP
  4. Alastair Gilfillan

    Alastair Gilfillan Active Member

    Messages:
    120
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #4
    Even with encrypted variables, The Big G will still be indexing those addresses and it might populate their results with those ugly strings instead of cleaner URLs. I reckon keeping it out of the address bar's better.
     
    Alastair Gilfillan, Dec 26, 2010 IP
  5. _:codefan:_

    _:codefan:_ Active Member

    Messages:
    18
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    58
    #5
    @Alastair Gilfillan: How secure would you give a random number of credits for a user with a specified id after a specified link was clicked? If you do this with sessions or cookies there still must be one variable in the link becouse the script must recognize wich link was clicked and if you put one variable with the "link id" you also heve to put another variable with a link key and then encrypt both in the script you will decrypt this check if the specified key was used and if not give some credits for the user that is currently logged in
     
    _:codefan:_, Dec 26, 2010 IP
  6. JeffurryB

    JeffurryB Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    so you are saying i need to do this server side. I can't code this in the view.php page?
     
    JeffurryB, Dec 26, 2010 IP
  7. Alastair Gilfillan

    Alastair Gilfillan Active Member

    Messages:
    120
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #7
    Server-side meaning in PHP (which the user does not see), compared to JaavaScript which they can see/abuse. Instead of having an <a>, you can have a <form> and when they click this <input type='submit'>, you can do your credit-giving and URI-forwarding on the server, not their browser.

    In short: Yes, code it in view.php; when you're using PHP, the person browsing does not see what's going on as PHP is never* sent to their browser.

    I don't entirely understand your goal but as far as I think I follow, that's my advice for:
    1) Hiding the URL they click on
    2) Not allowing them to see your credit-giving function

    Edit: If you use <input type='image' name='submit' src='button.png'>, you can have a fancy image button like "Visit Link Now ->" which will still be governed by PHP if($_POST['submit']){
     
    Alastair Gilfillan, Dec 28, 2010 IP
  8. JeffurryB

    JeffurryB Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    @Alastair Gilfillan, what I mean is, they click a text based link like: "MORE PEOPLE TO YOUR SITE". Once they click on the text link, they are directed to the view.php page, which will load the website, but still show mine as: [nobbcode]http://mysite.com/view.php?id=67280&id2=test&id3=015429130812445[/nobbcode] (of course without the test word in there, thats where the user name will go).

    this is what view.php looks like:
    <html>
    <head>
    <title>My Traffic Site</title>
    <frameset rows="15%,85%">
    
      <frame src="view2.php?id=">
      <frame src=" ">
    
    </frameset>
    </head>
    <body>
    
    </body>
    </html>
    PHP:
    I've not touched this coding stuff in years, I really don't know why I can't remember it. LOL! anyways, maybe I might have to admit defeat on this. :/
     
    JeffurryB, Dec 29, 2010 IP
  9. JeffurryB

    JeffurryB Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Never mind ;) I have decided to set this idea on the back burner for awhile. Thanks for atleast trying to help me ;)
     
    JeffurryB, Jan 20, 2011 IP
  10. FriendSwapMeet.com

    FriendSwapMeet.com Peon

    Messages:
    67
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    i have that code somewhere if you still need it
     
    FriendSwapMeet.com, Jan 23, 2011 IP
  11. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #11
    just post it here....
     
    G3n3s!s, Jan 23, 2011 IP
  12. Alastair Gilfillan

    Alastair Gilfillan Active Member

    Messages:
    120
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #12
    I think I know what you mean now. If I do, two options:
    <iframe id='externalpage' src="http://www.example.com/page.html"></iframe>
    Code (markup):
    <article id='externalpage'>
    <?php
    $pageurl = 'http://www.example.com/page.html';
    include("$pageurl");
    ?>
    </article>
    Code (markup):
     
    Alastair Gilfillan, Jan 23, 2011 IP