Jump to content

taith

Members
  • Posts

    1,514
  • Joined

  • Last visited

Everything posted by taith

  1. sorta... <?php while($all = mysql_fetch_array( $allResults )){ $countNew++; } if($_SESSION[count] < $countNew){ $_SESSION[count]= $countNew; echo 'encode sound'; } ?>
  2. nope... str_replace does allow arrays... <?php $str = "string's"; $invalied_chars = array(" ", "'"); $writein= array("\ ", "\'"); $result = str_replace($invalied_chars, "$writein", $str); echo $result; ?>
  3. nope! you gotta check your quotes... he echo '';ed not "" your talking pagination... http://www.phpfreaks.com/tutorials/43/0.php
  4. for those of use without a huge vocabulary... session_regsiter()/session_is_regsitered() are not necessary anymore... session_start(); if($_SESSION[user_logged_in]!==true){ $_SESSION[user_logged_in]=true;l $_SESSION['user_id'] = $row['user_id']; $_SESSION['profile'] = "Bigs"; $_SESSION['acc_lvl'] = "-1"; $_SESSION['login'] = FALSE; $_SESSION['user'] = "Guest"; }else{ }
  5. agreed... best spot to ask would be clarion's help forum... although... if its not letting you login... its prolly a username/password issue...
  6. sure... do your loop info from the database, add a $count++; if($_SESSION[count]<$count){ $_SESSION[count]=$count; echo 'encode your sound here'; } just as an fyi... if you count by sessions... when you first login... it'll beep wether it finds anything more there or not... lol
  7. http://www.kirupa.com/developer/actionscript/flash_php_mysql.htm enjoy
  8. yes... however... flash can connect to mysql justa letcha know... lol
  9. sorry... forgot... after it grabs the account... $time=time(); mysql_query("UPDATE `users` SET `timestamp`='$time' WHERE `id`='$_SESSION[id]'"); sure... firstly it says... any user that is online... but hasnt changed pages within 5 minutes, automatically gets logged out... then... you just grab the accounts that have a loggedin=1 and put them into a nice shiney list :-)
  10. consider it javascript, running php files
  11. or just use my function instead of header()... saves ALOT of troubles! :-) <?php function redirect($filename="?", $delay="0", $die="0"){ if((!headers_sent())&&($delay=="0")) header('Location: '.$filename); elseif($delay=="0"){ echo '<script type="text/javascript">'; echo 'window.location.href="'.$filename.'";'; echo '</script>'; echo '<noscript>'; echo '<meta http-equiv="refresh" content="0;url='.$filename.'" />'; echo '<noscript>'; }else echo '<meta http-equiv="refresh" content="'.$delay.';url='.$filename.'" />'; if($die=="0"){ db_disconnect(); exit; } } ?>
  12. the settings in your php.ini... and you prolly need to restart your server after changing that :-)
  13. a) you dont have any DESC in there... b) you dont need to connect to the same database twice...
  14. personally... i'd do it more like so... <?php $timeout=time()-300; $query=mysql_query("SELECT `id` FROM `users` WHERE `timestamp`>'$timeout' AND `loggedin`='1'"); while($row=mysql_fetch_assoc($query)){ mysql_query("UPDATE `users` SET `loggedin`='0' WHERE `id`='$row[id]' LIMIT 1"); } $query=mysql_query("SELECT * FROM `users` WHERE `id`='$_SESSION[id]' LIMIT 1"); $user=mysql_fetch_assoc($query); if($user[loggedin]==0){ $_SESSION[error][]='Your session has expired, log in again'; redirect('index.php?op=logout'); } ?> then when you want to find who's online... $query=mysql_query("SELECT `username` FROM `users` WHERE `loggedin`='1'"); while($row=mysql_fetch_assoc($query)){ $online[]=ucwords($row[username]); } $online=implode(', ',$online);
  15. ya... if you md5 somin... you got bout 80% chance of finding its value on a google search lol.... however... sha1 is almost as bad... so you never want to encrypt one on its own... say... echo sha1(md5($s).strrev(sha1($s)));
  16. i disagree... that is VERY insecure... <form method="GET" action="?"> <input type=textbox name=text> <input type=submit> </form> <?echo $_GET[text];?> thats one way of using get... could also just manually type it into your urls
  17. echo md5($_POST[password]); she works
  18. for example... store md5('password'); into the database.. then for your login... $user=$_POST[username]; #secure that $pass=md5($_POST[password]); $query=mysql_query("SELECT * FROM `users` WHERE `login`='$user' AND `pass`='$pass' LIMIT 1"); if $query pulls the row, your in, if not, redirect to login page
  19. after you set the cookie... header("Location: index.php"); or redirect back to the referrer :-)
  20. both are equally as fast... and both are quite safe... but personally... i only use === when its type specific... more or less... bool... if($var!==false)... php will automatically translate int/string to see if theres a common ground if you use ==... both are just as secure :-) === will save you alot of troubles with bool tho :-)
  21. if you do want to set a date(z)-30 exipery date... remember about january... if($date<0) $date+=364; as it counts 0-364(non leap year withstanding, but if its leap year, feburary wouldnt get caught by it...)
  22. many people do make it harder... lol... i like not to over complicate my code ;-) lol
×
×
  • 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.