![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
taith
Members-
Posts
1,514 -
Joined
-
Last visited
Everything posted by taith
-
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); ?>
-
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 } } ?>
-
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
-
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; } ?>
-
i know theres a global for HTTP_VIA... that holds proxy info usually...
-
that would be because in the variable your echoing the information... you need to return; it
-
you need to escape it... like so... $pageTitle = "Spider-man Comics ".comicTitle($ComicTable['title'], $Vol)." Issue $IssueNum";
-
wow... thanks! so... much... junk...
-
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....
-
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?
-
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 :-)...
-
[SOLVED] what OS is good to host a php and mysql data driven website
taith replied to cluce's topic in Miscellaneous
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... -
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?
-
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; } ?>
-
no... php is serverside... if you want php to work onclick(), you need ajax.
-
onchange=javascript changing content without reloading=javascript/ajax
-
not exactly... the cookie is just an access point to the file which contains all of your defined languaged text...
-
oops... sorry... that was my bad... by the time i noticed it was wrong, it wouldnt let me modify it :'(
-
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 :-)
-
How to submit a form without a submit button
taith replied to madhukar_garg's topic in PHP Coding Help
<a href="javascript:void(0);" onclick="javascript:document.formname.submit();">submit</a> -
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...
-
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; }
-
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.
-
$query="SELECT * FROM members WHERE RED='$_POST[RED]'";
-
lol cheers!