need help finding this script

Discussion in 'PHP' started by djguppy, Nov 7, 2008.

  1. #1
    hi, well i was wondering if any of you could help me.

    I am looking for a script i can use to let users on my website add a page (from my site) to a favourites section on my website, so that when they next visit they can quickly find their favourites, i dont really want to use cookies for this for numerous reasons

    please let me know if you know of one

    Thanks
     
    djguppy, Nov 7, 2008 IP
  2. dev_SeeInside

    dev_SeeInside Peon

    Messages:
    45
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Why not use cookies? Without cookies, you only have a couple of options:

    1) create a user system where a person has to register on your site and associate their favorite pages with their account in your database

    2) track favorites based on IP address (this is not a good approach as there are a lot of reasons why this could turn out badly - proxies, network users, dynamic IPs, etc)

    3) hope the users bookmark their favorites in their browser or create a link on each page that uses javascript to help users bookmark (but this wouldn't be a part of your site, it would be stored in their browser bookmarks)

    4) Categorize all your pages using a database or blogging system and let the users subscribe to an RSS feed or email alert list that notifies them whenever a page is updated or added in that category.

    Personally, I'd go with the cookies ;)
     
    dev_SeeInside, Nov 7, 2008 IP
  3. djguppy

    djguppy Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3

    The reason i would prefer not to use cookies is because people often use different computers or reset their cookies, and i am trying to generate sales of music.
    I want to do what you said in number one, i already have a user system, but I just don't know how to implement a favourites section :confused:, Thanks for your input though. :)
     
    djguppy, Nov 7, 2008 IP
  4. nrodes

    nrodes Peon

    Messages:
    77
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    heres one way to do it

    im not very experienced with MySQL, but couldnt you just add a column called "favourites" and have it display that on the favourites page?

    thats wat i would do
     
    nrodes, Nov 7, 2008 IP
  5. ryandanielt

    ryandanielt Well-Known Member

    Messages:
    1,797
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    185
    #5
    There is a much better way of doing this, you can easily make a members section and then assign every page a unique id to then when your user clicks to add it to there favorites it will save the page in a database where the user can choose to remove it later on.
     
    ryandanielt, Nov 7, 2008 IP
  6. djguppy

    djguppy Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    That would be the perfect way to do it,
    But how would i assign each page a unique id?:confused:
     
    djguppy, Nov 7, 2008 IP
  7. ryandanielt

    ryandanielt Well-Known Member

    Messages:
    1,797
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    185
    #7
    Simple, just open the source to each page and if you are using php you can add the following.

    
    Page 1: <? $pageid = '1'; ?>
    Page 2: <? $pageid = '2'; ?>
    Page 3: <? $pageid = '3'; ?>
    
    PHP:
    and so on.

    Then what you do is you make an add favorites page that will take this id and enter it into the database where the user id equals the current users id.


    This should work.


    If you are not a PHP programmer and you are looking to have this feature integrated into your site, depending on the design and layout it could cost anywhere from $25 - $50 depending on how complex the integration is going to be.
     
    ryandanielt, Nov 7, 2008 IP
    djguppy likes this.
  8. djguppy

    djguppy Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    ryandanielt

    I am not a php programmer but i am not too bad with php, but some of it i completely suck at. i am going to try and give it a go, see what i come up with.
    it doesnt sound like it is as big a job as i first thought it was.
    Thanks for your help,

    Are there any more small tips you could possibly give me?? just to get me going? dont worry if not.


    +rep 4 u
     
    djguppy, Nov 7, 2008 IP
  9. ryandanielt

    ryandanielt Well-Known Member

    Messages:
    1,797
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    185
    #9
    Well there is not much that I can really say, PHP is a language of common sense and it is really easy when you think about is.

    To give you a pointer on PHP, think about it as you are telling the computer what to do. The variables become the commands and how you put them together is the key.

    For example say you wanted to make a login script, what you would do is simply write a script saying " if the username entered equals the username in the database and if the password equals the password in the database then let the person view the page otherwise tell them it was wrong". That is the basic concept for a login script and what you are looking to do is generally the same.

    You need to build your members area and then make a script that says " enter the page id into the database where userid equals userid in the database".

    This is how I learned PHP 5 years ago, by using common sense like this and then learning how to put variables to what I was trying to say.


    Well good luck on your script there, and if you decide to want to hire someone to put this together for you then let me know and I will do it for you for as low as I can.


    Cheers!

     
    ryandanielt, Nov 7, 2008 IP