TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 08-18-2012, 03:20 PM   #1 (permalink)
The Visitor
 
Join Date: Aug 2012
Posts: 2
Thanks: 0
ramtindow is on a distinguished road
Default mod_rewrite how to get title from sql table in url

hello, pleaaase help me!
I have a php file "page.php" witch it gives the variable "id" from the url and shows a record WHERE id=$_GET['id'] .

I want to replace urls like "example.com/books/page.php?id=$id" (where $id can be anything numeric) with sth like "example.com/books/$id/title/"

where title and id are columns of sql table.

I want to know what to write in .htaccess file and how it gets the title from sql and writes it in front of $id in the url.

also I would like to titles Spaces be replaced by Dash sign.


my table is like :

id | title |
1 | an example |

witch then we should be able to use url "example.com/books/1/an-example/" instead of "example.com/books/page.php?id=1" .

Thanks a lot!
ramtindow is offline  
Reply With Quote
Old 08-19-2012, 02:36 PM   #2 (permalink)
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

I see you already posted in another place about this problem. I just answered it. Why don't you delete this one.
tony is offline  
Reply With Quote
Reply



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

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
feedback on my class please frostyboy33 Advanced PHP Programming 7 10-22-2012 09:12 AM
Export table to sql Peuplarchie General 1 05-25-2010 06:23 AM
Databse structure Village Idiot TalkPHP Developer Team 3 01-16-2009 10:31 PM
This project has begun! Village Idiot TalkPHP Developer Team 40 01-01-2009 04:29 AM
multi users uploading an image to a table sarmenhb General 6 06-29-2008 04:10 AM


All times are GMT. The time now is 06:49 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design