2 questions.... - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

2 questions....

DanyDany Posts: 26Member
1. how do I make a search page in order for someone to be able to search my site and get results of pages on the site?
2. I want to have a php page that sets a cookie for a user, so when he/she comes back they get redirected to another page (they choose language, and the next time they come they go to the page with the language they chose last time)... I managed to set the cookie but I only know the header() function for redirecting which can't work with setting or checking cookie buz they both need to be first on the page.... please help.... I probably just need another redirecting function within something like "if cookie value ==english go to ... else go to..."
thanks for the help!
Dany

Comments

  • skylarskylar Posts: 82Member
    [b][red]This message was edited by skylar at 2004-7-26 8:24:12[/red][/b][hr]
    : 1. how do I make a search page in order for someone to be able to search my site and get results of pages on the site?
    : 2. I want to have a php page that sets a cookie for a user, so when he/she comes back they get redirected to another page (they choose language, and the next time they come they go to the page with the language they chose last time)... I managed to set the cookie but I only know the header() function for redirecting which can't work with setting or checking cookie buz they both need to be first on the page.... please help.... I probably just need another redirecting function within something like "if cookie value ==english go to ... else go to..."
    : thanks for the help!
    : Dany
    :


    About ur second question:




    $curlang = "en"; // english

    if(isset($HTTP_COOKIE_VARS['mylang'])){
    if($curlang != $HTTP_COOKIE_VARS['mylang']){
    header("location: http://www.mydomain.com/$HTTP_COOKIE_VARS['mylang']/index.php");
    }
    }
    else{
    setcookie("mylang", $curlang);
    }


    if($action == "changelanguage"){
    setcookie("mylang", "$mylang");
    header("location: http://wwww.mydomain.com/$mylang/index.php")
    }






    Im not sure how to create a search feature off hand.. perhaps somebody else here does?


    [b][blue]Snoochie Boochies[/blue][/b]



  • Homerun31Homerun31 Posts: 99Member
    well i no theres a query function called LIKE and it searches ur db for things that are like what your search is. heres a link to the website ----> http://www.1keydata.com/sql/sqllike.html



    : [b][red]This message was edited by skylar at 2004-7-26 8:24:12[/red][/b][hr]
    : : 1. how do I make a search page in order for someone to be able to search my site and get results of pages on the site?
    : : 2. I want to have a php page that sets a cookie for a user, so when he/she comes back they get redirected to another page (they choose language, and the next time they come they go to the page with the language they chose last time)... I managed to set the cookie but I only know the header() function for redirecting which can't work with setting or checking cookie buz they both need to be first on the page.... please help.... I probably just need another redirecting function within something like "if cookie value ==english go to ... else go to..."
    : : thanks for the help!
    : : Dany
    : :
    :
    :
    : About ur second question:
    :
    :
    :
    :
    : $curlang = "en"; // english
    :
    : if(isset($HTTP_COOKIE_VARS['mylang'])){
    : if($curlang != $HTTP_COOKIE_VARS['mylang']){
    : header("location: http://www.mydomain.com/$HTTP_COOKIE_VARS['mylang']/index.php");
    : }
    : }
    : else{
    : setcookie("mylang", $curlang);
    : }
    :
    :
    : if($action == "changelanguage"){
    : setcookie("mylang", "$mylang");
    : header("location: http://wwww.mydomain.com/$mylang/index.php")
    : }
    :
    :
    :
    :
    :
    :
    : Im not sure how to create a search feature off hand.. perhaps somebody else here does?
    :
    :
    : [b][blue]Snoochie Boochies[/blue][/b]
    :
    :
    :
    :

Sign In or Register to comment.