Jump to content

ferrins

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Posts posted by ferrins

  1. Hi everbody!

     

    I developed a web portal totally in PHP 5, and I had it running on my college server flawlessly. Now, I just hired a hosting (Dreamhost) and I have serious problems to make the code work, it seems like anything that is variable session related it just doesn't work, like the login system, calendar, captcha, etc...

     

    So, I upload one phpinfo() at every server, one in my college at the other one at Dreamhost, but I suck so bad that I don't even know where to start looking :S

     

    If anyone wanna give it a look and save my ass:

     

    College server is at: http://citmalumnes.upc.es/pfc/fcases/info.php

    At Dreamhost: http://www.soroll.cat/info.php

     

    Is the register_globals thing, maybe the session table? gee I'm totally lost, any tip on this I'll apreciate.

     

    Thanks for reading.

     

  2. Hi everybody! A friend of mine gave me a hand to finish the script that follows, it works ok so, of course, feel free to use it in your sites. Now the problem is that I can't log out!!! I've tried to unset the $_SERVER['PHP_AUTH_USER'])) and the $_SERVER['PHP_AUTH_PW'])) but I can't figure out why it doesn't log out. So here you have the script to log in, any idea to log put will be much appreciated!!!

    <?php
    session_start();
    if (!isset($_SERVER['PHP_AUTH_USER'])) {
    header('WWW-Authenticate: Basic realm="admin"');
    header('HTTP/1_0 401 Unauthorized');
        echo 'Text to send if user hits Cancel button';
        exit;
    } else {
    $nick = $_SERVER['PHP_AUTH_USER'];
    $passwd = $_SERVER['PHP_AUTH_PW'];

    $sql = "SELECT nick,passwd,id_admin FROM admin WHERE nick='$nick' AND passwd='$passwd'";
    $res = mysql_query($sql) or die(mysql_error());
    $row = mysql_fetch_array($res);
    if( $row['nick']==$nick && $row['passwd']==$passwd ){
    $_SESSION['id_admin']=$row['id_admin'];
    /* redirect id the username or pass are correct */
    $redirect = "admin/index.php";
    header("Location: {$redirect}");
    die("If the page doesn't redirect click <a href='{$redirect}'>here</a>");
    }else{
        echo 'Text to send if user entered incorect username or password!';
        exit;
    }
    }
    ?>
    ***************
  3. Hi everybody!
    I'm trying to send some form data to a different page where I have all my site's functions.
    My form page it's like this:

    <form  method="post" action="functions.php?action=checkgroup"> /* is this action right? */
    Group Name: <input type="text" name="group">
    <input  type="submit" name="submit" value="check">
    </form>

    Then, in my functions.php page:

    function checkgroup(whattheheckshouldIputinhere?){

    sql stuff...

    return something..

    }

    Well , so what am I missing? is it something related to GET action and stuff?
    If anybody can give me a hand I'd appreciate it!
    Thnkx!
    (and my register_globas is on)
×
×
  • 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.