russe11 Posted December 14, 2006 Share Posted December 14, 2006 I am trying to make some url friendly at my site. I want to point the query to the "title" column to sort out show the content. For example:[b]My current url: [/b][color=navy]www.example.com/articles?id=13[/color][b]What i want:[/b][color=navy]www.example.com/articles?title=i can do this work[/color]; //and then go to the full article...so when i use the modrewrite, will be something like: www.example.com/articles/i-can-do-this-work.html Is any of that makes sensse?Heeeellllllppppp...!!The code for this: // create the article list $newstext = '<ol>'; while($row = mysql_fetch_array($result, MYSQL_NUM)) { list($title, $id) = $row; $newstext .= "<li><a href=\"$self?id=$id\">$title</a></li>\r\n"; } $newstext .= '</ol>'; $title = 'My Articles';} else { // get the article info from database $query = "SELECT title, newstext FROM news WHERE id=".$_GET['id']; $result = mysql_query($query) or die('Error : ' . mysql_error()); $row = mysql_fetch_array($result, MYSQL_ASSOC); $title = $row['title']; $newstext = $row['newstext'];}mysql_close(); Link to comment https://forums.phpfreaks.com/topic/30685-call-articles-referring-to-the-title-column-instead-of-id-column/ Share on other sites More sharing options...
chiprivers Posted December 14, 2006 Share Posted December 14, 2006 Are you saying you want to write:www.example.com/articles?title=documenttitlehereor:www.example.com/articles/documenttitlehere.html Link to comment https://forums.phpfreaks.com/topic/30685-call-articles-referring-to-the-title-column-instead-of-id-column/#findComment-141426 Share on other sites More sharing options...
russe11 Posted December 14, 2006 Author Share Posted December 14, 2006 Well, as a final product, this is what i am looking for:[color=orange]www.example.com/articles/documenttitlehere.html [/color]All my efforts has been NOT successful :( pls help.....I know requires a bit of both mod_rewrite and php, but it is just beyond me to figure out how to put all together.Thank you in advance for the response Link to comment https://forums.phpfreaks.com/topic/30685-call-articles-referring-to-the-title-column-instead-of-id-column/#findComment-141434 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.