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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help, searching properties.

    I am trying to edit some coding so that I can make searching on a website gender specific, women can only see and search for men, and men can only see and search for women, however I have no clue where to start....



    I would assume. it would be something of the sort of

    If $sex =male

    some way to find female? I'm lost lol any help would be great.

  • #2
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,530
    Thanks
    45
    Thanked 259 Times in 256 Posts
    You need to have a column in your database to specify gender, and when its male search for female and vice versa. But if you're having trouble with this, and I don't mean the following offensively, you should go back and learn database basics. I struggled to think of an answer that was more complicated then "search for what you want", but this is a very basic application of databases, and it seems a bit like you're jumping ahead to writing code without the knowledge to write it.

    Are you currently using a database?

  • #3
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am yes, I'm not familiar with how dolphin 7 has its databases setup honestly. everything is predefined and drag and drop sort of building.


    on a side note no I do not find it offensive, however I'm a hands on type of person. just looking for a starting point. thanks.

  • #4
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    709
    Thanks
    20
    Thanked 84 Times in 84 Posts
    you could set a session variable in your login script to set the gender of the current user from the database

    i dont know how your site logs in but

    PHP Code:
    //login function
    $_SESSION['Gender'] = $row['Gender'];

    //page search query
    $result Q("SELECT * FROM `people` WHERE `Gender` != "$_SESSION['Gender']); 

  • #5
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    thanks Arctic.

    Quote Originally Posted by Arcticwarrio View Post
    you could set a session variable in your login script to set the gender of the current user from the database

    i dont know how your site logs in but

    PHP Code:
    //login function
    $_SESSION['Gender'] = $row['Gender'];

    //page search query
    $result Q("SELECT * FROM `people` WHERE `Gender` != "$_SESSION['Gender']); 



    thanks for that, since I have posted this I purchased a program called Dolphin 7.0.9 so I'm trying to weed my way through all the portal software crap.


    anyone happen to be familiar with this at all? if so some pointers would be great, as far as locations to edit "etc" and so on. thanks again.


  •  

    Posting Permissions

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