taith
Members-
Posts
1,514 -
Joined
-
Last visited
Everything posted by taith
-
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?
-
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 :-)
-
[SOLVED] xml to array format i want..how to proceed.please help
taith replied to smilesmita's topic in PHP Coding Help
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]); } } ?> -
sweet deal... wasnt sure if it would or not :-D THANKS
-
anyone know how to do a search... say for '%$search%' that would not be case specific?
-
make sure thats str_ireplace()... so its not case sensitive...
-
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; } ?>
-
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... :-)
-
..? your not requesting that function anywhere...?
-
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...?
-
[SOLVED] incrementing numbers within select tags
taith replied to webguync's topic in PHP Coding Help
just to keep it current... switch 2007... with date(Y)... so you never have to go back and change it ;-) -
[SOLVED] Extremely Simple and Noobie News Script
taith replied to MasterACE14's topic in PHP Coding Help
thats cuz you have the same errors there too... -
you misunderstand me... cross browser... not cross page... as in close browser, open browser, settings stay. sessions are extreamly useful! just... not for this...
-
yes... but thats not the point... i want to use cookies for stuffs... cross browser session stuffs...
-
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...
-
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...
-
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 :-)
-
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...?
-
Detecting if a string has a certain character?
taith replied to rottenpixies's topic in PHP Coding Help
YAY ME! -
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...?
-
Detecting if a string has a certain character?
taith replied to rottenpixies's topic in PHP Coding Help
if(ereg(' ',$string)) echo 'you have spaces'; else echo 'no spaces!'; -
no... i acutally want to make the image which takes the "screenshot"... not access someone elses...
-
google maps use ajax... so it only loads the images when and where it needs em...
-
yes? $string='I like cheese'; $string=str_replace(' ','+',trim($string)); echo $string; #I+like+cheese
-
<table width=100%> <tr> <td>Hello <?=$user?></td> <td style="text-align:right;"><?=date("Y")?></td> </tr> </table>