![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
taith
Members-
Posts
1,514 -
Joined
-
Last visited
Everything posted by taith
-
your thinkin bout it a little backwards... dont limit the while()... limit the query... $result=db_query("SELECT * FROM updater_photos WHERE `category`='1'"); $num=mysql_num_rows($result); if(!is_numeric($_GET )) $page=1; else $page=$_GET ; $limit=12; $start = $page * $limit - ($limit); $result = db_query("SELECT * FROM updater_photos WHERE ORDER BY id LIMIT $start, $limit"); then you just ?page=2
-
yes... it works perfectly fine... but it is also completly unnecessary...
-
much easier as @session_start(); therefore, always works, no complaints :-)
-
personally... i'd run it like this... $array[1][question]='question'; $array[1][answer][]='answer1'; $array[1][answer][]='answer2'; then when you take em out... just foreach($array[1][answer] as $val)
-
i assume your trying to make them integers... if you just put "(INT)" infront of the value, it forces that change...
-
a) this is a coding help forum b) try sourceforge c) those pages (myspace) are custom made... not a generic
-
$rand=rand(1000000,9999999999);
-
http://www.tizag.com/mysqlTutorial/mysqlmax.php
-
well... on login... just unset($_SESSION[userinfo][password]);... but if you use your own encrypter, even having the password would be completly useless to anyone...
-
yes, in the long run... userid's are by FAR more useful then usernames... then you can access user info wherever you want... however.... what i do, is on login, i put all the user info into a session ex... $_SESSION[userinfo]=$row;... that way if you want the username... you just $_SESSION[userinfo][username]; or the id $_SESSION[userinfo][id];
-
assuming this is what you mean... $profiles="<br /><table border=\"1\" bordercolor=\"black\" cellpadding=\"4\" cellspacing=\"0\" width=\"300\" height=\"80\">"; $profiles.=" <tr>"; $profiles.=" <td background=\"images/background.jpg\" align=\"center\">"; if($photo == 0){ $profiles.="<img src='uploads/no_pic.jpg' />"; }else{ $profiles.="<img src='uploads/$photo1' border='0' />"; } $profiles.=" </td>"; $profiles.=" <tr>"; $profiles.=" <td bgcolor=\"#E2E2E2\" align=\"center\"><a href=\"profile.php?id=$id\"><p>$username</a> From <b><font color=\"red\">$country</font></b></td>"; $profiles.=" </tr>"; $profiles.="</table><br />";
-
<?php $Year =31536000 + time(); setcookie ('style', $_GET[choice], $Year); header("Location: $HTTP_REFERER"); ?>
-
$_GET[choice]
-
<link rel="stylesheet" type="text/css" href="<?php echo (!$_COOKIE[style])?'default':$_COOKIE[style];?>.css" />
-
if($_POST["password"]!==$_POST["confirmpassword"]){ $_SESSION[error]="passwords must be identical"; header(Location: login.php); } then on your login page, just echo that wherever...
-
Ripping my hair out!! Know your PHP??? Please help!
taith replied to fri3ndly's topic in PHP Coding Help
tinymce automatically configures its output for "most" programming languages... meaning that ' and " and ` are \ed... echo(htmlspecialchars(stripslashes($text))); -
really depends on a)who they're working for b) what they're doing... personally... i charge bout $12~ an hour(part time) but i know programmers(fulltime) that can go $20+ an hour
-
bin2hex(md5('adsf',TRUE)); #takes 1-2 times faster then md5 alone
-
$result=mysql_query("SELECT id, lastname, firstname FROM patient ORDER BY lastname") or die(mysql_error()); $display_block="<select name=\"patientnr\">"; while($nt=mysql_fetch_assoc($result)){ $display_block.="<option value=\"$nt[id]\">$nt[lastname] $nt[firstname]</option>"; } $display_block.="</select>";
-
$time=microtime(); #use function echo 'that took '.microtime()-$time.' seconds';
-
you cant... php runs WAY before the browser see's it... you'd need to use something like ajax to load php pages after the page has loaded.
-
if ($pages < $page - 3 || $pages > $page + 3) return;
taith replied to jirimail's topic in PHP Coding Help
basically... continue; tells the for() to stop what its doing, and start the loop over again... which, in this case, should cut off either end of the numbers... function page($url) { global $page; $pages=1; for($starter=0; $this->total>$starter; $starter+=$this->limit) { if ($pages < $page-3 && $pages > $page+3) continue; if ($pages != $page) echo "<a href=\"".$url.$pages."\" class=\"page\">$pages</a> \n"; else echo "<b>[ $pages ]</b> \n"; $pages++; } }