Jump to content

taith

Members
  • Posts

    1,514
  • Joined

  • Last visited

Everything posted by taith

  1. i got a page here http://www.happyathome.ca/temp, everything works properly in ie, but in firefox, the services page goes all wacko, anybody got an idea why thats happening?
  2. cant say i'm a fan of graphic designing... my designer draws all my stuffs... i just program it all together :-) and as far as templates go... all of our stuff is custom made :-)
  3. there ya goes... that'll turn any string/file from xml, to a multidimentsional array :-) <?php function xmltoarray(&$string){ $parser = xml_parser_create(); xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); xml_parse_into_struct($parser, $string, $vals, $index); xml_parser_free($parser); $mnary=array(); $ary=&$mnary; foreach($vals as $r){ $t=$r['tag']; if($r['type']=='open'){ if(isset($ary[$t])){ if (isset($ary[$t][0])) $ary[$t][]=array(); else $ary[$t]=array($ary[$t], array()); $cv=&$ary[$t][count($ary[$t])-1]; }else $cv=&$ary[$t]; if(isset($r['attributes'])){ foreach ($r['attributes'] as $k=>$v) $cv['_a'][$k]=$v; } $cv['_c']=array(); $cv['_c']['_p']=&$ary; $ary=&$cv['_c']; }elseif($r['type']=='complete'){ if(isset($ary[$t])){ if (isset($ary[$t][0])) $ary[$t][]=array(); else $ary[$t]=array($ary[$t], array()); $cv=&$ary[$t][count($ary[$t])-1]; }else $cv=&$ary[$t]; if (isset($r['attributes'])){ foreach ($r['attributes'] as $k=>$v) $cv['_a'][$k]=$v; } $cv['_v']=(isset($r['value']) ? $r['value'] : ''); }elseif($r['type']=='close'){ $ary=&$ary['_p']; } } _del_p($mnary); return $mnary; } function _del_p(&$ary){ foreach($ary as $k=>$v){ if($k==='_p') unset($ary[$k]); elseif(is_array($ary[$k])) _del_p($ary[$k]); } } ?>
  4. sweet deal... wasnt sure if it would or not :-D THANKS
  5. anyone know how to do a search... say for '%$search%' that would not be case specific?
  6. make sure thats str_ireplace()... so its not case sensitive...
  7. heres the one i use... <?php $badwords=array(); function filter_censor($string){ global $badwords; if(empty($badwords)){ $result=@mysql_query("SELECT `words` FROM `badwords`"); while($row=mysql_fetch_array($result)) $badwords[]=$row[words]; } foreach($badwords as $badword) $string=str_ireplace($badword, str_pad("",strlen($badword),"*"), $string); return $string; } ?>
  8. query string is the $_GET information so "www.google.ca/?op=alsjdf&div=asflj" the query string would contain "?op=alsjdf&div=asflj" that function takes all the $_POST information, and turns it into a string that can be transfered via $_GET... :-)
  9. ..? your not requesting that function anywhere...?
  10. i want to be able to seed a rand()... so say rand(1,5) and it would take a % modifyer and give that lower values, more often... say echo rand2(1,5,'30%'); #so you can get 5... but you have a higher chance of getting a lower value... any ideas...?
  11. just to keep it current... switch 2007... with date(Y)... so you never have to go back and change it ;-)
  12. thats cuz you have the same errors there too...
  13. you misunderstand me... cross browser... not cross page... as in close browser, open browser, settings stay. sessions are extreamly useful! just... not for this...
  14. yes... but thats not the point... i want to use cookies for stuffs... cross browser session stuffs...
  15. sessions require cookies not to hold the data... but to hold the string that relates to the servers' session file... and their helpful for insignifigant things... like templates... languages... or settings of that source...
  16. but if cookies are disabled in the browser... they'd get sent to the splash page every time they tried to enter the site ... now... if you require cookies... i can see that workin then... you'd need some sort of error on your splash page about cookies then...
  17. its much faster/easier this way... $friendname=$_get["user"]; $explode=explode('*',$friendname); //then you have part one in $explode[0] and part 2 in $explode[1]... and so on :-)
  18. i assume the best way to check if cookies are enabled then... is on the splash page to a site, set cookie, when enters, if cookie not there... error...?
  19. anyone know a way of getting cookie information right away... like so... <?php setcookie ("testcookie","test value",time()+86400,"/"); echo "Here is our cookie value: <b>".$_COOKIE[testcookie]."</b>"; ?> from what i've seen... php doesnt keep the information, untill the next reload of the page...?
  20. if(ereg(' ',$string)) echo 'you have spaces'; else echo 'no spaces!';
  21. no... i acutally want to make the image which takes the "screenshot"... not access someone elses...
  22. google maps use ajax... so it only loads the images when and where it needs em...
  23. yes? $string='I like cheese'; $string=str_replace(' ','+',trim($string)); echo $string; #I+like+cheese
  24. <table width=100%> <tr> <td>Hello <?=$user?></td> <td style="text-align:right;"><?=date("Y")?></td> </tr> </table>
×
×
  • 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.