Jump to content

taith

Members
  • Posts

    1,514
  • Joined

  • Last visited

Everything posted by taith

  1. you'd be suprised how many times i've put my charlimiting function in here <?php function filter_charlimit($string, $length="50"){ return (strlen($string)<$length) ? $string : trim(substr($string,0,$length)).'...'; } echo filter_charlimit($row_news['article01_para1'],150); ?>
  2. how bout this? also... why you got the td's in there... its not in a table... <?php if(is_array($arrData)){ foreach($arrData as $key=>$salesListData) { if( $salesID==$salesListData['salesID'][0]){ unset($salesListData['RowID'][0]); //i think you meant to unset, not echo continue; } ?> <form id="SalesDetail" action="SalesDetail.php" method="post"> <input type="hidden" name="salesID" value="<?php echo $salesID ?>"> <input type="submit" value="<?php echo $salesListData['Name'][0]; ?>" > <td><input type="image" name="submit" src="<?php echo $img;?>"></td> </form> <?php } } ?>
  3. yupyup! functions as they "should" be... with a few exceptions... should always return the data, never echo... you'll save yourself ALOT of problems in the long run... also then you can use functions within functions
  4. also... if you use static ip's... i created this shiney function a while ago :-) <?php function allow_ip_range($ip,$range=array()){ $ip=explode(".",$ip); foreach($range as $k=>$v){ $range1=explode(".",$v[0]); $range2=explode(".",$v[1]); if(($ip[0]>=$range1[0]&&$ip[0]<=$range2[0])&&($ip[1]>=$range1[1]&&$ip[1]<=$range2[1])&&($ip[2]>=$range1[2]&&$ip[2]<=$range2[2])&&($ip[3]>=$range1[3]&&$ip[3]<=$range2[3])) return true; } return false; } ?>
  5. i know theres a global for HTTP_VIA... that holds proxy info usually...
  6. that would be because in the variable your echoing the information... you need to return; it
  7. you need to escape it... like so... $pageTitle = "Spider-man Comics ".comicTitle($ComicTable['title'], $Vol)." Issue $IssueNum";
  8. wow... thanks! so... much... junk...
  9. anybody know a way of getting all variables? the php parser engine must remember what each variable is... i just want to be able to make a debug type function which retrieves all of them....
  10. a) whats it telling you? b) $_SERVER['DOCUMENT_ROOT'].'/../cgi-bin/myexe' cannot exist... your combining a static url, with a relative... the ../ is whats causing that issue c) "myexe"... whats the extension?
  11. personally... i'd do it this way... hardest thing to remake, thats really easy for you... database... on you installer program, have the licence, you type "i agree" in, or whatnot, takes the encrypted(md5()/sha1()/etc...) value of that, have it go to your server, grab the file with that encrypted name... which then creates the database, and everyones happy :-)...
  12. 95% of the servers in the world are linux... that much said... its really down to preference, but linux has been known to parse faster and be a "little" less tempermental...
  13. Array ( [mon] => '1', [tues] => '1', [weds] => '1', [thurs] => '1', [fri] => '1', ); $sqlup = "UPDATE staff SET mon = '" . $sday['mon'] . "', tues = '" . $sday['tues'] . "', weds = '" . $sday['weds'] . "', thurs = '" . $sday['thurs'] . "', fri = '" . $sday['fri'] . "', `desc` = '" . $desc . "' WHERE firstname = '" . $name['0'] . "' && surname = '" . $name['1'] . "'"; my only question is... if your just having it come from the array every time... why not put the #s in manually?
  14. for example... <a href="?page=test">test</a><a href="?page=1">1</a> <? switch($_GET ){ case "test": echo 'test content'; break; case "1": echo 'page 1 content'; break; default: echo 'default content'; break; } ?>
  15. no... php is serverside... if you want php to work onclick(), you need ajax.
  16. onchange=javascript changing content without reloading=javascript/ajax
  17. not exactly... the cookie is just an access point to the file which contains all of your defined languaged text...
  18. oops... sorry... that was my bad... by the time i noticed it was wrong, it wouldnt let me modify it :'(
  19. basically, you click the flag, it redirect to a page where it sets a cookie for the lanugage... then, you have a default language file selected, and if theres a cookie found, it uses that language file instead... $_COOKIE[lang].'.php'; in that file, you either $variable all your text, or define() them :-)
  20. <a href="javascript:void(0);" onclick="javascript:document.formname.submit();">submit</a>
  21. no... length of the query doesnt cause the speed issue... but the amount of information that that query unloads... if its too long of a loading time you'd either need to a) suck it up and wait... or b) find another way of further sorting your table...
  22. function deep_array_search($value, $array, $case_insensitive = false){ foreach($array as $item){ if(is_array($item)) $ret=deep_array_search($value, $item, $case_insensitive); else $ret = ($case_insensitive) ? strtolower($item)==$value : $item==$value; if($ret===true) return $ret; } return false; }
  23. because regardless of wether $item is an array or not, it is beign given a value... therefore, regardless of anything... $ret is always being return;ed therefore, function is over.
  24. $query="SELECT * FROM members WHERE RED='$_POST[RED]'";
×
×
  • 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.