Jump to content

paparanch

Members
  • Posts

    56
  • Joined

  • Last visited

    Never

Everything posted by paparanch

  1. hellow world! i tried hard not to come here and ask for help to prove something to myself, but i just can't do this. here is the situation: actually i saw a lot of tutorials regarding resizing and croping photos using php, but most of them were done during uploading process...in my case i wanted to display images from a certain directory that are cropped and resized ON THE FLY...so meaning there is no thumbnail image that correspond to its large image...something like that... to make things more clear, i have big images from "myphotos" folder and i wanted to display it in the browser already cropped and resized proportionally...so here is my code so far...it only display images from my folder.... <? $p_cat = $row['project_name']; $handle = opendir('portfolio/'.$p_cat.'/'); if($handle) { while(false !== ($file = readdir($handle))) { if(preg_match("/\w+(.jpg)/",$file)) { echo "<div class='update_pics_frame'>"; echo "<div class='update_pics'>"; echo "<a class='mb' id='mb1' title='$event_name_formatted' href='/arcke/portfolio/".$row['project_name']."/$file'>"; echo "<img src='/arcke/portfolio/".$row['project_name']."/$file'>"; echo "</a>"; echo "</div>"; echo "</div>"; } } closedir($handle); } ?> tnx in advanced gurus!
  2. ahmnnnn....too much graphics i guess? and the font color is too strong...gudluck!
  3. ahmnnn....i think its better if you will make the edge of your title header smoother...that's all. ^^
  4. wow! it works like a charm! tnx for this mr.guru! now its all validated!
  5. hellow everyone! i validated my site emorocks.com, and i found out that there are some errors regarding my textarea tag...it says that <a> and <br> tag are not allowed inside the textarea tag...but these are really needed in my code so that the user will just copy it and paste it to their friendster profile...and the image will display in their profile...any help please? is their any solutions to fix this one to be validated in xhtml? echo "<textarea onclick='this.select();' rows='2' cols='10' style='overflow:hidden; width:448px; height:30px;' ><a href='http://www.emorocks.com/".$cat."/' ><img src='http://www.emorocks.com/comments/".$cat."/".$comment."' alt='Emorocks - the coolest place for free EMO comments' border='0' /></a><br />EmoRocks.com</textarea>";
  6. is there any negative impact in using htaccess in rewriting the url?
  7. thnx for all the resources....the problem is my html code still has errors...and i can't change it because its a code from other website..like free chatbox... mr.redarrow? will you please tell me more about this .htaccess? actually, i already done rewriting my urls using htaccess but i'm not pretty sure about it...
  8. ok! tnx for that! i guess your right, i really have to fix some errors in my html and css code...tnx again!
  9. hellow everyone! i'm sory if i post this thread in the wrong place. i just don't know where to post this one. anyway, i just want to ask from you guyz if using .htaccess to rewrite url on the fly can really make your website highly indexed by search engines? coz i have a website www.emorocks.com which i used .htaccess for rewriting its URL to be more highly indexed...but until now when i type emorocks.com in google, it did not appear on the result page...so i guess goole did not recognize my site...i don't know if its because i used .htaccess or what...i have no idea...any opinion? by the way i just uploaded my site last 3 days ago....is this the reason why its not yet recognize by search engines? i don't think so...any opinion pls? tnx in advanced!
  10. wow! it works mr.kickstart! i just added "desc" after the "ORDER BY"...thx a lot! problem solved!
  11. tnx for this mister but its not working for me....yah, it display three record with different category but it did not display the latest ones...
  12. yah mr.phpdragon! i have more than three categories... thnx mr.kickstart i will try that query...
  13. ahmnnn....its not really selecting the last added record on every category. what i wanted is to get the 3 latest added record but if in case the second record is the same category with the first or third, it will go to the next latest record and see if its different category...etc...until it will display 3 records with different category...
  14. i already tried that one mr.phprdagon but stillnot working... let me explain again.. i have record, let say: 1 - David - teacher 2 - MIke - student 3 - John - worker 4 - James - student 5 - Jake - student 6 - Don - worker it this table..Don is the latest added record..so the output should: 6 - Don - worker 5 - Jake - student 1 - David - teacher notice that they have different category... and here is the output of my code based on that table(which is wrong): 6 - Don - worker 5 - Jake - student 4 - James - student notice that it display two record with the same category, it should not display record with the same category...how am i going to do this?
  15. tnx for that guru! but its not working for me i don't why... because when i add new record which is: 8 - Don - Principal it didn't display, which is supposed the first to display as the latest record...??
  16. good day everyone! here's my table: id | name | category | 1 | randy | student | 2 | james | student | 3 | Karl | student | 4 | John | worker | 5 | Joew | worker | 6 | David | worker | 7 | Mike | teacher | Now, what i wanted to do is SELECT 3 unique records with different category(desc). SAMPLE OUTPUT: Mike - teacher David- worker Karl - student here is my code so far: <? $query = "SELECT * FROM members ORDER BY member_id desc LIMIT 3"; $result = mysql_query($query); while($info = mysql_fetch_array($result)){ $membername = $info['member_name']; $member_cat = $info['member_cat']; echo "$member_name-$member_cat<br>"; } ?> THE OUTPUT(which is wrong) 7 | Mike | teacher | 6 | David | worker | 5 | Joew | worker |
  17. wow! problem solved masters! tnx for the help! more power phpfreaks!
  18. wew! but i only have to get 1 image from that folder...its either gif or jpg...
  19. hello gurus! i have here a code which i display images from a folder. but the problem is only gif files were displayed..so how am i going to display both jpg and gif files from this code? please help...tnx <?php //This will get an array of all the .gif images in a folder $img_array = glob("/path/to/images/*.gif"); //Pick a random image from the array $img = array_rand($img_array); //Display the image on the page echo '<img alt="'.$img_array[$img].'" src="'.$img_array[$img].'" />'; ?>
  20. elow mr.ratcateme! i am done with my site now. and i already uploaded it in my hosting but the problem is the .htaccess file i guess the mod_wrerite is not enabled...do u know how to enable it? im using hostmonster...tnx
  21. ahhmmm...tnx for this...but where am i going to insert this code or should i replace something?
  22. hi gurus! i am back for another question regarding filectime function... here's what i got so far...this code displays images from a folder with pagination(by mr.russel) now, what i wanted is to display the latest added image at the top or the first image among the four images to be displayed. <?php $page = $_GET['page']; $rpp = 2; if($page==""){ $page = 1; } $dirArr = scandir('comments/Birthday/'); function rem_invalid($arr) { foreach ($arr as $k => $v) { if (stristr($v,'.gif') === false) unset($arr[$k]); } } $dirArr = preg_grep("/^.*\.gif$/i",$dirArr); if ($c = count($dirArr)) { $dirArr = array_combine(range(0,count($dirArr) - 1),$dirArr); $numOfPages = ceil($c / $rpp); for ($i = (($page - 1) * $rpp); $i < min($c,($page * $rpp)); $i++) { $filenames = $dirArr[$i]; //$filename = filectime($path/$filenames); <<< this is wrong...what is right way for this? echo "<img src='comments/Birthday/$filenames' width='200'><br>"; echo "<input type='text' value='$filename'><br><br>"; } } echo "<br /><br />"; for ($i = 1; $i <= $numOfPages; $i++) { echo "<a href='view_pix.php?page=$i'>"; echo " ".$i." "; echo "</a>"; } ?> tnx in advanced!
  23. hehe...actually i already solved this one with database, but i want to try it without database so that i can just copy bunch of images to my folder at one time....which i can't do with database...T_T
  24. ahhmnnn...speaking of other questions....yah i have! hehe...i just figure this out... what if i want to display the latest added image first? i mean in my code i declare 4 images per page...how am i going to do to make the latest added image to display at the top? i heard about filectime function but i don't know how to integrate it in my code... would you please help mr.russel? tnx
×
×
  • 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.