Jump to content

taith

Members
  • Posts

    1,514
  • Joined

  • Last visited

Everything posted by taith

  1. ya... as soon as that line goes true... it stops the function entirely... you cannot use return; for that... you'd need to scrap that, and use continue;
  2. it would be something with the private $var;... try changing them to private $var="";?
  3. only way around that... would be to increase the timeout... 1/2 hour or however long you need... you could try setting a cookie... but you'd run into the same problems... another option... would be to put a javascript clock, after a certain time, it gives a warning, if ok pushed, it triggers an ajax to up the row's timestamp, if not, it redirects...
  4. not sure if it'd let you do this... but i think it'd work... function test($text){ $offset=0; while($pos=strpos($text, '@', $offset)!==false){ $out[]=$pos; $offset=$pos+1; } return $out; } print_r(test($text));
  5. if you put a timestamp onto the rows, you can simply stop someone from updating data to it for a set amount of time... not so much a lock, as a block... such as if(time()-$row[timestamp]>900||$_SESSION[id]==$row[editor]){ #do queries } so only one person can do the queries, unless the timestamp has become too old...
  6. then theres no way of knowing wether the 1st section is 2 or 3 characters long...
  7. $a='http://news.google.com/news/url?sa=T&ct=us/0-0-0&fd=R&url=http://www.signonsandiego.com/news/politics/20070504-9999-1n4debate.html&cid=1115939682&ei=2gc7Rsr_IZ3C0gHeiOGyAw'; $a=explode('&url=',$a); $a=$a[1]; $a=explode('&cid=',$a); $a=$a[0];
  8. $a='http://news.google.com/news/url?sa=T&ct=us/0-0-0&fd=R&url=http://www.signonsandiego.com/news/politics/20070504-9999-1n4debate.html&cid=1115939682&ei=2gc7Rsr_IZ3C0gHeiOGyAw'; $a=explode('&url=',$a); $a=$a[1];
  9. require_once('disclaimer.php');
  10. not tested... but it should grab the first space, and cut all after it... $key='m1 4bu '; $shrunk=substr($key,0,strpos($key,' '));
  11. when i set up my basket... i find that the best, least tempermental way of doing it... is to use $_SESSION[cart][]=array(productid=>"",quantity=>"",...);
  12. that would be a javascript issue... not a php one... but this should work... simple php function to do just that :-) <? function popup($text, $link, $name="", $height="300", $width="300", $resizable="0", $status="0", $class=""){ return '<a href="javascript:void(0);" onclick=\'javascript: window.open("'.$link.'", "'.$name.'", "status='.$status.', height='.$height.', width='.$width.', resizable='.$resizable.'")\' class='.$class.'>'.$text.'</a>'; } ?>
  13. try this... if($cart){ $items=explode(',',$cart); foreach($items as $item){ if($_GET['id'] != $item){ $newcart[]=$item; } } $cart=implode(','$newcart); }
  14. YAY! thanks guys... heres what i came up with function datez($day,$month,$year){ return date(z,mktime(0,0,0,$month,$day,$year)); }
  15. yes... but that would return todays... i need to be able to return any day's date(z)...
  16. i'm pretty sure this is mktime that does this... anybody know how to translate... say day/month into a date(z) type format?
  17. taith

    strstr

    you can use my function if you want... its a little more... big... <? function get_mybrowser(){ if(strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko')){ if(strpos($_SERVER['HTTP_USER_AGENT'], 'Netscape')) return 'netscape'; elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox')) return 'firefox'; else return 'mozilla'; }elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')){ if(strpos($_SERVER['HTTP_USER_AGENT'], 'Opera')) return 'opera'; else return 'ie'; }else return 'other'; } ?>
  18. taith

    strstr

    ?ignore? can we se some code?
  19. <? function filter_charlimit($string, $length="50"){ if(strlen($string)<$length) return $string; else return trim(substr($string, 0, $length)).'...'; } echo filter_charlimit('purple monkey dishwasher',10); ?>
  20. just change all of your session_start(); --> @session_start(); it'll supress all the errors that may give... then, sessions still active, and everybody's happy
  21. as for the calendar... sure :-) function get_daysinmonth($month, $year){ if(checkdate($month, 31, $year)) return 31; elseif(checkdate($month, 30, $year)) return 30; elseif(checkdate($month, 29, $year)) return 29; elseif(checkdate($month, 28, $year)) return 28; return false; } $month=date(m); $year=date(Y); for($i=0; $i<=$k; $k=get_daysinmonth($month,$year); $i++){ echo $i; } tha'd give you a list of all the days in the month, then you just have to arrange em... i got more if you want... i'd have to go home to get my full calendar tho... lol i know i do it the long way... but owell... lol
  22. most email clients have something called "vacation messages"... just use that... basically it just responds whenever it recieves a message...
  23. um... you dont have any $_SESSION's in there...
  24. theres a nice tutorial in the ajax forum on this page
×
×
  • 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.