Jump to content

psychohagis

Members
  • Posts

    80
  • Joined

  • Last visited

    Never

Everything 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: This is what I tried (this didnt work): 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. oh ok ill try that im only doing it like that because thats the way i learnt to do it
  3. 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
  4. 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.
  5. 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
  6. I want to convert a date in the format (dd/mm/yyyy) into a time() style format so I can compare it against the current time and only use information where its date is ahead of the current time.
  7. oh thanks - i new it had to something obvious, i just couldnt spot it
  8. 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); }
  9. use ereg() or eregi() http://www.php.net/ereg http://www.php.net/eregi
  10. 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
  11. 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.
  12. 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?
  13. This how I set them: session_start(); $_SESSION['userid'] = $userid; $_SESSION['username'] = $_POST['username']; $_SESSION['rank'] = $rank;
  14. 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?
  15. Oh thanks - i didnt know there was a specific way of doing it.
  16. Just use eregi_replace() Heres a function for you: function swear_remover($text) { $text = eregi_replace('swear', '****', $text); $text = eregi_replace('swear', '****', $text); $text = eregi_replace('swear', '****', $text); return $text; }
  17. 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: Anyone got and ideas?
  18. 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]
  19. its in the folder, [b]/members/messages/[/b] and the one that works is in[b]/members/[/b]
×
×
  • 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.