| | Please HElp. Can you teach me : a) How to use smilies with php so that if i want to create a post office or forum , a person who posts with ~Thanks! |
|
|
Here is an example of how you would do this: CODE $string=str_replace(array(":)",":P",":D",":("),array("<img src='/emoticons/happy.gif","<img src='/emoticons/toungue.gif","<img src='/emoticons/grin.gif","<img src='/emoticons/sad.gif"),$string); echo $string; or if you find it easier to write it out you could write it like this: CODE $search=array(":)",":P",":D",":("); $replace=array("<img src='/emoticons/happy.gif","<img src='/emoticons/toungue.gif","<img src='/emoticons/grin.gif","<img src='/emoticons/sad.gif"); $string=str_replace($search,$replace,$string); echo $string; I found the best way to divide sql results into pages is by using limit. Take in a variable lets say "page" through the url via get, and use this code: CODE $rowsperpage=5; mysql_query("SELECT * FROM whatever your sql query is goes here LIMIT ".($_GET['page']*$rowsperpage-$rowsperpage).",".($_GET['page']*$rowsperpage-1)); You should also add checks to make sure that $_GET['page'] is greater than 0
Well to start off I would check out this tutorial how up to set up a smilie system for your website, and since the posts is only a few months old it "should" work. Now to get the smilies to work besides using php would be images, what I suggestion is google emoticons, then click on images, then click small images and then download away which ones that work best for you.
Now for your second problem I would check out these tutorials and see which one works the most effectively. http://www.phpfreaks.com/tutorials/73/0.php http://www.phpfreaks.com/tutorials/73/0.php http://www.interviewmyass.co.uk/tutorials/php/6 I would start with the second tutorial first as it seems less confusing as the others, and the fact its all on one page.
Recent Queries:-
Keywords : parts Looking for 2, parts
|
|
![]() Help In 2 Parts |
| ADD REPLY / Got an Opinion! | a humble request :-) | RAPID SEARCH! | Free Hosting | [X] |
|
Express your Opinions, Thoughts or Contribute more info. to help others. Ask your Doubts & Queries to get answers, So that "Together We can help others!" |
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP. | 500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE |
|