Jump to content

mga_ka_php

Members
  • Posts

    134
  • Joined

Posts posted by mga_ka_php

  1. i have this url

    http://www.mydomain.com/dvds/search/page/2/?Keywords=holiday&Radius=0&Zip=&StartDate=2009-11-17&EndDate=2010-07-15

     

    this is my rewrite rule

     

    RewriteRule ^dvds/search/page/([0-9+])/$ /index2.php

     

    i could fetch the values of keywords, radius, zip, startdate and enddate

     

    but i can't get the page number

     

    if i do this RewriteRule ^dvds/search/page/([0-9+])/$ /index2.php?page=$1

     

    i could get the page number but i can't get the values of keywords, radius, zip, startdate and enddate

     

    and if i do this RewriteRule ^dvds/search/page/([0-9+])/(.+)$ /index2.php?page=$1&Keywords=$2

     

    i get ERROR 404 File not Found

     

    any suggestions?

     

     

  2. from

     

    $q = "SELECT CONCAT('horse_name, 'user_name') AS info FROM horses WHERE horse_name = $hn";

     

    to

     

    $q = "SELECT CONCAT('horse_name, 'user_name') AS info FROM horses WHERE horse_name = '$hn'";

     

    see the ' at $hn

     

  3. are you sure the meta didn't work, i use it a lot without a problem.

     

    if the meta didn't work. move

     

    <?php
    // Connects to your Database
    mysql_connect("localhost", "0607197", "12345") or die(mysql_error());
    mysql_select_db("db0607197") or die(mysql_error());
    
    //Checks if there is a login cookie
    if(isset($_COOKIE['ID_my_site']))
    //if there is, it logs you in and directes you to the members page
    {
    $username = $_COOKIE['ID_my_site'];
    $pass = $_COOKIE['Key_my_site'];
    $check = mysql_query("SELECT * FROM Users WHERE username = '$username'")or die(mysql_error());
    while($info = mysql_fetch_array( $check )){
    	if ($pass != $info['password']){
    	}else{
    		header("Location: book1.php");
    
    	}
    }
    }
    
    //if the login form is submitted
    if (isset($_POST['submit'])) { // if form has been submitted
    
    // makes sure they filled it in
    if(!$_POST['username'] | !$_POST['pass'] | !$_POST['pass'] ) {
    die('<h2><b>You did not fill in a required field.</b><a href="login.php"><font color="#b9c059">Back</a></font></h2>');
    }
    // checks it against the database
    
    if (!get_magic_quotes_gpc()) {
    $_POST['email'] = addslashes($_POST['email']);
    }
    $check = mysql_query("SELECT * FROM Users WHERE username = '".$_POST['username']."'")or die(mysql_error());
    
    //Gives error if user dosen't exist
    $check2 = mysql_num_rows($check);
    if ($check2 == 0) {
    die('<h2>No Such Account. <a href=register.php><font color="#b9c059">Click Here to Register</a></font></h2>');
    }
    while($info = mysql_fetch_array( $check ))
    {
    $_POST['pass'] = stripslashes($_POST['pass']);
    $info['password'] = stripslashes($info['password']);
    $_POST['pass'] = md5($_POST['pass']);
    
    //gives error if the password is wrong
    if ($_POST['pass'] != $info['password']) {
    die('<h2> Incorrect password, please <a href=login.php><font color="#b9c059">Try again.</a></font>');
    }
    
    else
    {
    
    // if login is ok then we add a cookie
    $_POST['username'] = stripslashes($_POST['username']);
    $hour = time() + 3600;
    setcookie(ID_my_site, $_POST['username'], $hour);
    setcookie(Key_my_site, $_POST['pass'], $hour);
    
    //then redirect them to the members area
    header("Location: book1.php");
    }
    }
    }
    
    // if they are not logged in
    ?>
    

     

    before <html>

     

    if your going to use header(), always put that before <html>

  4. Wahey, that works! Only problem is with a trailing slash, /contact/ it gets confused with where the images/css files are - probably because it thinks its a folder.

     

    Anyway around this?

     

    Thanks alot! :)

     

    got the same problem which i'm looking for a solution.

  5. I have a table which contain an ID and Description

     

    ID  |  Description

    ------------------------------------------------------------------

    1  |  Number:1033837|#|Date:2009-03-29|#|Canceled:YES....

     

    Note: the date is within the Description

     

    Now, what i am trying to achieve is to get all the records less than the current timestamp

     

    But I don't know how to pullout the date within the description.

     

    example: SELECT * FROM table1 WHERE  $current_timestamp > UNIX_TIMESTAMP( Date in the description column )

  6. what im trying to accomplish is that i have a website which some parts are restricted but users can view that restricted page 5 times.if more than 5, they need to register to access the restricted page.

     

    But how do i track the returning visitors?

     

    Currently, i used the ip address, but its not a solution because ip changes.

     

    how do i accomplish this type of setup?

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.