Jump to content

paparanch

Members
  • Posts

    56
  • Joined

  • Last visited

    Never

Everything posted by paparanch

  1. wew! it works mr.russel! i just added this code below as the links: for ($i = 1; $i <= $numOfPages; $i++) { echo "<a href='view_pix.php?page=$i'>"; echo " ".$i." "; echo "</a>"; } i know you spend some time in helping me....thank you very much mr.russel! Godbless
  2. good morning mister russel! here's what i got so far...the problem is when i declare value "3" in the $rpp variable or row per page...it will display 4 images instead of 3...and i also noticed that the last image in every page is still present on the second page(and it was placed first)...i'm sure i got some mistake with my code but i just can't figure it out....would you please help... im getting frustrated with this...T_T <?php $page = $_GET['page']; $rpp = 3; $c = 0; $handle = opendir('comments/'); $d = opendir("comments/"); $count = 0; while(($f = readdir($d)) !== false) if(ereg('.gif$', $f)) ++$count; closedir($d); print "$count"; $numOfPages = ceil( $count / $rpp ); if($handle) { while(false !== ($file = readdir($handle))) { if(preg_match("/\w+(.gif)/",$file)) { $c++; if ($c > (($page * $rpp) + $rpp)) break; if ($c >= ($page * $rpp)) { echo "<div class='update_pics_frame'>"; echo "<div class='update_pics'>"; echo "<a href='comments/$file'><img src='comments/$file' width='200'border='0'></a>"; echo "</div>"; echo "</div>"; } } } closedir($handle); } for ($i = 1; $i <= $numOfPages; $i++) { echo "<a href='view_pix.php?page=$i'>"; echo " ".$i." "; echo "</a>"; } ?>
  3. mr.russel....im really messing around here...i really don't know what to do....
  4. oww..i see...so the problem now is how to get the total number of images in a folder....
  5. Warning: Division by zero in D:\Personal Files\Paparanch\xampp\htdocs\emo\view_pix.php on line 24 this is what i got from that code mr...i don't know why
  6. elow mr.russel...i tried to put a link <a href='view_pix.php?page=2'>next</a> below the page...but only two comments were shown in the next page....instead of another 4 images and last image in the last page...
  7. yes of corz! i still need help more help which is better way for this. tnx
  8. would you please explain more? T_T
  9. wow! it works! but now, how am i going to configure the link to next page and previous? or prev 1 2 3 4 next something like this...
  10. thnx mister but its not working for me...i dont know where i get wrong...but it just display blank page...
  11. hello gurus! i have this code which display all images from a folder, but i wanted to have pagination for this like 4 images per page... so how am i going to do this? please help... <?php $handle = opendir('comments/'); if($handle) { while(false !== ($file = readdir($handle))) { if(preg_match("/\w+(.gif)/",$file)) { echo "<div class='update_pics_frame'>"; echo "<div class='update_pics'>"; echo "<a href='comments/$file'><img src='comments/$file' width='200'border='0'></a>"; echo "</div>"; echo "</div>"; } } closedir($handle); } ?> thnx in advanced..
  12. wow! solved! thnx mr.thorpe!
  13. hi mr.phpdragon! i really dont get what you mean (im just noob in php). this code works very fine: for ($i = 0; $i < 8; $i++) { $code = $pool[rand(0, $pool_size)]; echo $code; <<<(output "65KbldxB") } but when i echo outside the for statement i only get the last digit: for ($i = 0; $i < 8; $i++) { $code = $pool[rand(0, $pool_size)]; } echo $code; <<<(output "B")
  14. good day gurus! i have this code which generate 8 random alphanumeric: srand(time()); $pool = array_merge( range('a', 'z'), range('A', 'Z'), range(0, 9) ); $pool_size = count($pool) - 1; for ($i = 0; $i < 8; $i++) { $code = $pool[rand(0, $pool_size)]; <<<<< i want to get its value outside the for statement } how could i get the value of the variable $code outside the for statement? because when i tried to echo the varibale after the for statement only the last digit of 8 alphanumeric will appear... plss help..
  15. in photo gallery...the same, i used photoshop and css to style the page and i used php/mysql for the photos...its actually database driven....^^
  16. really? ^^ actually i did not use any cms with that site... i just designed it with photoshop and code it with css. ^^
  17. ok! everything is working very well now master! thank you so much for the time!
  18. ok the url is fine... but page not found master.... i guess there something wrong with my link... $title = "ako"; $author = "ikaw"; <a href="/arcke/title/<? echo $title; ?>/author/<? echo $author; ?>"> Rates </a> what i should i put in my link now that i pass another variable?
  19. ok... say i pass two variables... title and author..... what changes should i make in my php file and .htaccess file....?
  20. ow i almost forgot this master.. what if i will pass another varible, and another ....so fort? let say author and address....$author and $address what should i do now? how am i going to add this in my .htaccess file?
  21. OMG! it works like a charm! thank you very very much master! ur such a life saver. i been messing around with this since yesterday...now i can proceed to study session...i'll just return if i have some question master! hope to see u around again here. btw, heres what im doing right now www.norsupageant.com...i hope i can make its url search engine friendly... thank you again master! more power!
  22. wow! the css is fine now.... but the problem is the link....T_T when i clicked the rates link...the url looks fine and the css is doing good...but the link of the home changed...when i mouseover the home button the link is localhost/arcke/page/2....and when i click again the rates button...page not found coz the link changed to localhost/arcke/page/page/2...the "page/" became two.... whats wrong master?
  23. this is the index.php file <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>ARCKE</title> <link href="css/index.css" rel="stylesheet" type="text/css" /> <body> <?php $disp_page = $_GET['page']; $pagenum = 2; ?> *******the navigation****** <div class="nav"> <div class="nav_btn"> <a href="index.php"> Home </a> </div> <div class="nav_btn"> <a href="page/<? echo $pagenum; ?>"> Rates </a> </div> </div> ******end of navigation**** *****start of body content**** <?php if($disp_page==2){ include 'rates.php'; } else{ ?> <div class='content_body'> Dynamic Content Here </div> <? } ?> ******start of body content**** </body> </html> This is my rates.php <?php echo"This is Rates page"; ?> This is my .htaccess file RewriteEngine on RewriteRule ^page/([^/\.]+)/?$ index.php?page=$1 [L] I really dont know if i'm doing this right...so please help me with this... thnx
  24. this is the index.php file <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>ARCKE</title> <link href="css/index.css" rel="stylesheet" type="text/css" /> <body> *******the navigation****** <div class="nav"> <div class="nav_btn"> <a href="index.php"> Home </a> </div> <div class="nav_btn"> <a href="page/<? echo $rates; ?>"> <div> <? echo $nav; ?> </div> </a> </div> ******end of navigation**** </body> </html>
×
×
  • 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.