Jump to content

psychohagis

Members
  • Posts

    80
  • Joined

  • Last visited

    Never

Posts posted by psychohagis

  1. Unfortunately for me my web host uses an unusual format for its logfiles which means I have to tell analog how to intrepret them.

    I have tried this but it didnt work so I was hoping someone on here could help me.

     

    Here is one line from a logfile:

    buckschildminding.org.uk: [09/Jun/2007:00:53:24 +0100] 66.249.72.41 - - "GET /robots.txt HTTP/1.1" 404 216 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"

     

    This is what I tried (this didnt work):

    LOGFORMAT (%S; [%d/%M/%Y:%h:%n:%j %j] %s - - %c %b - %B)

     

    This is the relevant page from the read me:

    http://www.analog.cx/docs/logfmt.html

     

     

    I hope someone has a better knowledge of this sort of thing than me

  2. Ok Ive changed that but now when I run the following:

     

    $check = @mysql_query("SELECT id, username FROM users WHERE rank=$rank");
    if (!$check)  {
    $mysql_error = mysql_error();
       exit('<p>~ Error performing query: ' . $mysql_error . '</p>');
    }

     

    it says "Error performing query: Unknown column 'chairman' in 'where clause'"

     

    which makes no sense cos i dont ask for column 'chairman'

     

    This query is asking it to find $rank (which happens to be 'chairman' here) in column rank

  3. I have the following query/code thing.

     

    $check = @mysql_query("SELECT id, username FROM users WHERE rank='$rank'");
    if (!$result)  {
    $mysql_error = mysql_error();
       exit('<p>Error performing query: ' . $mysql_error . '</p>');

     

    When i run it it tells me theres an "error performing query:" but then does print out the mysql_error

     

    I dont understans this cos I use this sam bit of code on other pages (except with different querys)  and if theres a problem with me query it tells me what it is.

  4. Does anyone have anymore knowledge on this because I have explored the function mentioned above but I have on problem.

     

    According to the manual it will convert any english date into a time() type format. but thats not quite true.

    In england dd/mm/yyyy is standard but if you put in a date that is formatted like that it assumes it is mm/dd/yyyy which is the american format.

    Is their anyway I can tell strtotime() that its dd/mm/yyyy instead of mm/dd/yyyy ??

     

    thanks in advance

  5. Im sure this is something obvious but I can't see it.

     

    I have used the folowing bit of code before but I just changed the message and it doesnt work and gives me a "parse error: unexpected T_STRING" error.

     

    While ($row = mysql_fetch_array($result)) 
    {
    
    $email = $row['email'];
    
    $emto = $email;
    $emsubject = 'BCMA - A new event has been posted;
    $emmessage = 'Details of the event - "' . $event . '" on ' . $sdate . ' have just been posted.  Please click on the adress below to view this, and other events: <br> http://www.MYSITE.org.uk/events.php';
    $emfrom = 'noreply@MYSITE.org.uk';
    $emheader= 'From:' . $emfrom;
    mail($emto, $emsubject, $emmessage, $emheader);
    
    }

  6. yh ive got session_start() on every page.

     

    events.php is for both authorised and unauthorised users depending on what part of it youre in. 

     

    I just dont see the logic behind using AND when i only need one of the statements to evaluate to true

  7. Well i tried that and it works but i dont understand why.

     

    Surely AND would require all of them to evaluate to true where as OR only needs one of them to evaluate to true - which makes more sense to me because $_SESSION['rank'] can't have multiple values.

  8. I have the following if statement:

     

    if ($_SESSION['rank']!='webmaster' OR $_SESSION['rank']!='chairman' OR $_SESSION['rank']!='secretary' OR $_SESSION['rank']!='treasurer')
    {
    exit('<meta http-equiv=refresh content=0;URL=http://www.MYSITE.org.uk/events.php>');
    }

     

    I dumped the variable $_SESSION['rank'] and it came out as "webmaster" but I still get redirected away?

     

    Can anyone help?

  9. I have a system which uses three session variables;  'rank', 'username' and 'userid'.

    I was doing the following on 'sign-out' to get rid of these variables:

     

    $_SESSION = array();
    session_destroy();

     

    Which seemed to work as when I checked against uderid:

     

    if (!isset($_SESSION['userid']) or $_SESSION['userid'] =='')
    {
    exit('You are not signed in!');
    }

     

    It told me I wasnt signed in.  I then wanted to do the following:

     

    <?php
    
    
    if ($_SESSION['rank']=='webmaster' OR $_SESSION['rank']=='chairman' OR $_SESSION['rank']=='secretary' OR $_SESSION['rank']=='treasurer')
    {
    ?>
    
    <br />
    <div class="shinydiv">
    <div class="title"> Admin</div>
    <p>
    <?php echo $_SESSION['rank'] ?>
    </p>
    </div>
    
    <?php
    
    }
    
    ?>

     

    And for some reason it still appeared If I signed out.

     

    I tried dumping all the session variables and the rank variable was the only one that showed up.

     

    What's going wrong?

  10. I am trying to convert a "time()" timestamp into date format ""DDth MMMM YYYY"

    I know how to do this and so far ive got the following:

     

    <?php
    
    $timestamp = '1168803135';
    
    function date_convert($value){
    
    $date = date("d-m/Y", $value)
    
    $day = eregi_replace('([1-9])(-)([1-9])(/)([1-9])', '\\1', $date);   [color=red]LINE 9[/color]
    
    return $day;
    }
    
    echo date_convert($timestamp);
    
    
    ?>

     

    But when I run this it throws back the following error:

     

    Parse error: parse error, unexpected T_VARIABLE in /home/fhlinux178/b/MYSITE.org.uk/user/htdocs/includes/date_convert.inc.php on line 9

     

    Anyone got and ideas?

  11. I have the following code:[code]$timeout = time() - 1200;

    $setoffline = "UPDATE users SET online=0
    WHERE online=1 AND lasttime='$timeout'";
    if (!@mysql_query($setoffline)) {
    echo 'Error: ' . mysql_error();
    }[/code]

    and i get the following problem:

    [quote]Error (set status): You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '<='1168466894', lastpage='his/her homepage' WHERE id='1'' a [/quote]
×
×
  • 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.