| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: Jul 2005 Location: lebanon
Posts: 2,458
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | need some Simple php tips to solve my problem hey guys i got a script similar to a guest book that displays posts title under it description please guys i need some help in enhancing it i need to open each post in a new page containing more details which are fetched from the database (such as name age email bla bla bla bla ) the prob is that i dont know how to make the connection from the first page where the list of posts is and the other page which contain the details in a search engine friendly way please guys i need some tips to fix that Thanks in advance
__________________ Download free MP3 _____________ Get unique visitors 4 NPs (over 800 satisfied) << Check the Holidays offer _____ Email me for fast response ryan [at] ryansdistrict.com ________ My 9000NPs R 4 SALE cheap- Contact me! |
| |
| | #2 (permalink) |
| Senior Member Join Date: Mar 2005
Posts: 4,948
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | An example.... In the display page, have each post ID link to something like: Code: <a href="./post-details.php?post=1">1</a> And on post-details.php, just have code that will pull the entry from the db by it's ID. |
| |
| | THREAD STARTER #3 (permalink) |
| Senior Member Join Date: Jul 2005 Location: lebanon
Posts: 2,458
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | umm though and tried that but is it Google friendly ? i was thinking of makin something special with site name in url using post/name-of-site.html btw if i want just to get from the database from a specific field a certain number of characters i want to show like i just want to show 200 characters of the description field how can i do this limit also how can i add Social Bookmark script that will dig a certain url (if possible)
__________________ Download free MP3 _____________ Get unique visitors 4 NPs (over 800 satisfied) << Check the Holidays offer _____ Email me for fast response ryan [at] ryansdistrict.com ________ My 9000NPs R 4 SALE cheap- Contact me! |
| |
| | #4 (permalink) |
| NamePros Member Join Date: Nov 2003
Posts: 107
![]() | Alright, this is off the top of my head so try it out and let me know To limit the characters of an entry you can do Code: $sql = "SELECT title, LEFT(description,200) AS pre_desc FROM table"; Now you'd call your description as pre_desc ex. echo $row['pre_desc']; Code: substr($row['description'],0,200); ????: NamePros.com http://www.namepros.com/programming/401611-need-some-simple-php-tips-solve.html Both codes above will limit the text shown to 200 characters or any number of your choosing. To make the URLs Search Engine Friendly or Google Friendly as you say you need to modify an .htaccess file with something similar to Code: RewriteEngine On RewriteRule ^news/(.+).php post-details.php?post=$1 Any problems or any more questions feel free. -Justin
__________________ Complete Resource Management Script - Myspace / Social Network Layout and Graphic Script Online business lens - My personal experiences in internet business. |
| |