Jump to content

taith

Members
  • Posts

    1,514
  • Joined

  • Last visited

Everything posted by taith

  1. 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
  2. yes... it works perfectly fine... but it is also completly unnecessary...
  3. print_r($_SESSION); is the value even getting into session? if no, you prolly havent @session_start();ed yet...
  4. much easier as @session_start(); therefore, always works, no complaints :-)
  5. 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)
  6. i assume your trying to make them integers... if you just put "(INT)" infront of the value, it forces that change...
  7. your first section was completly surrounded... if(!isset($too_small_lead) || !isset($money_lead) || !isset($time_lead) || !isset($not_inter_lead) || !isset($client_lead) || !isset($demo_lead) || !isset($notContacted_lead) || !isset($callBack_lead)){
  8. a) this is a coding help forum b) try sourceforge c) those pages (myspace) are custom made... not a generic
  9. $rand=rand(1000000,9999999999);
  10. http://www.tizag.com/mysqlTutorial/mysqlmax.php
  11. taith

    Sessions

    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...
  12. taith

    Sessions

    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];
  13. 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 />";
  14. <?php $Year =31536000 + time(); setcookie ('style', $_GET[choice], $Year); header("Location: $HTTP_REFERER"); ?>
  15. <link rel="stylesheet" type="text/css" href="<?php echo (!$_COOKIE[style])?'default':$_COOKIE[style];?>.css" />
  16. if($_POST["password"]!==$_POST["confirmpassword"]){ $_SESSION[error]="passwords must be identical"; header(Location: login.php); } then on your login page, just echo that wherever...
  17. tinymce automatically configures its output for "most" programming languages... meaning that ' and " and ` are \ed... echo(htmlspecialchars(stripslashes($text)));
  18. 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
  19. bin2hex(md5('adsf',TRUE)); #takes 1-2 times faster then md5 alone
  20. $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>";
  21. $time=microtime(); #use function echo 'that took '.microtime()-$time.' seconds';
  22. 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.
  23. 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++; } }
×
×
  • 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.