Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    May 2005
    Posts
    224
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Lots of coding....shoutcast, php, assign something to IP..

    Could someone tell me if this is possible? Thanks.

    If someone could code this that'd be great....if not I can go and look it all up and figure it out. :-D
    Or, if someone could tell me if this is possible.

    I want to set up a "rewards" program for my shoutcast server...
    What it is, is every hour they listen, they get half a point, and when they want to they can cash in their points.

    What I would want it like:

    Let's say they click the "rewards" link. They would see this.

    (If first time viewing the page)
    ********
    *welcome message*
    Your IP is (javascript displaying IP)
    Please assign a username to this IP address so we can track your points.
    (Form)
    Username:

    [Submit]
    ********
    It would then assign that username to that IP address. Then:
    ********
    (2nd visit on)
    Welcome *username assigned*!
    You have XX Points!

    [Cash Out]
    ********
    What that would do, somehow, is read their IP and match it up with the username assigned earlier. Now, for the "XX Points" that would be somehow decided with shoutcast.

    In the shoutcast log, it shows

    [dest: 70.181.76.14] connection closed (24 seconds) (UID: 90)[L: 0]{Bytes: 635439}(P: 1)
    Which shows i can track IPs and Time...what I would want is somehow to get it to add "0.5" every hour. Then when they go to the rewards page it shows the total points they have.

    For the cash out button, I can code most of this, but I also want it to reset the number of points they have to 0.

    So if this could be coded/told if possible I'd really appriciate that.

    Thanks.

    -crazydog
    Last edited by Crazydog; 06-20-2005 at 09:22 PM.

  • #2
    Regular Coder
    Join Date
    May 2005
    Posts
    224
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Bump....could someone just tell me if this is possible?

  • #3
    Senior Coder
    Join Date
    Aug 2003
    Location
    One step ahead of you.
    Posts
    2,815
    Thanks
    0
    Thanked 3 Times in 3 Posts
    First of all IP's are unreliable if you want to track something for a long amount of time. Some (actually a lot) have dynamic IP's so you should assign points to a user whohas a session with that IP. I'd say it's doable but the "how" is a mystery for me.
    I'm not sure if this was any help, but I hope it didn't make you stupider.

    Experience is something you get just after you really need it.
    PHP Installation Guide Feedback welcome.

  • #4
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you can't use IP's. You can't use sessions either (since the sesion can be destroyed by the garbage collection if the user waits to long or if there are a lott os sessions).

    the most simple sollution is to just work with useraccounts and either
    - require a login from the user on each visit
    - automatically log the users in based on a cookie

    you know, like the rest of the net does...
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html


  •  

    Posting Permissions

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