NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page need some Simple php tips to solve my problem

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 11-30-2007, 08:55 AM THREAD STARTER               #1 (permalink)
Senior Member
Join Date: Jul 2005
Location: lebanon
Posts: 2,458
rcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to behold
 




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!
rcep is offline  
Old 11-30-2007, 10:27 AM   #2 (permalink)
Senior Member
 
Eric's Avatar
Join Date: Mar 2005
Posts: 4,948
Eric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatness
 

Member of the Month
MOTM September 2005
Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Animal Rescue Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Baby Health Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse Diabetes Protect Our Planet Multiple Sclerosis Autism Adoption Special Olympics
An example....


In the display page, have each post ID link to something like:
Code:
<a href="./post-details.php?post=1">1</a>
Where 1 would be the current post ID (say from the loop retrieving the entries).


And on post-details.php, just have code that will pull the entry from the db by it's ID.
Eric is offline  
Old 11-30-2007, 11:11 AM THREAD STARTER               #3 (permalink)
Senior Member
Join Date: Jul 2005
Location: lebanon
Posts: 2,458
rcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to beholdrcep is a splendid one to behold
 




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!
rcep is offline  
Old 11-30-2007, 09:03 PM   #4 (permalink)
NamePros Member
 
edit's Avatar
Join Date: Nov 2003
Posts: 107
edit will become famous soon enough
 



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'];
OR

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
The htaccess part can be rewritten twenty different ways but thats probably the most basic, though maybe not the most efficient.

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.
edit is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 06:11 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger