ajicles Posted August 23, 2010 Share Posted August 23, 2010 I am seen people have dynamic pages that loads the information from a database and then displays that information from the url. EG domain.com/somedirectory/something I have a website that does this but uses domain.com/something.php?id=something . This works great but when I go to try and get the statistics for that page from facebook for number of people that have liked that page. When I go to: http://graph.facebook.com/http://likebook.cz.cc/ It shows me the information: { "id": "**************", "name": "LikeBook", "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/hs178.ash2/41817_130259343675613_3465_s.jpg", "link": "http://www.facebook.com/pages/LikeBook/130259343675613", "category": "Website", "description": "Collect every like at LikeBook.cz.cc", "fan_count": 3 } But when I try and go to: http://graph.facebook.com/http://likebook.cz.cc/like.php?id=31 It shows me: { "id": "http://likebook.cz.cc/like.php" } So what I need to do is. Make a dynamic page within that sub directory. So that http://likebook.cz.cc/like/31 does grabs the information from line 31 of my database, like http://likebook.cz.cc/like.php?id=31 would do. Thank you ~AJ Quote Link to comment https://forums.phpfreaks.com/topic/211467-_get/ Share on other sites More sharing options...
Lamez Posted August 23, 2010 Share Posted August 23, 2010 take a peek into .htaccess, which I think is only for Apache web servers. Quote Link to comment https://forums.phpfreaks.com/topic/211467-_get/#findComment-1102575 Share on other sites More sharing options...
ajicles Posted August 23, 2010 Author Share Posted August 23, 2010 I believe I would have to write a script for apache. Some 404 pages display what you were trying to look for on the page. I just want to know how that works. Also I found a website that says I could use CGI to load dynamic content. I haven't coded CGI and don't know how to script something like this up. I host my website on a free web hosting and to enable CGI I used .htaccess Options +ExecCGI AddHandler cgi-script cgi pl If someone could help me that would be greatly appreciated. ~AJ Quote Link to comment https://forums.phpfreaks.com/topic/211467-_get/#findComment-1102850 Share on other sites More sharing options...
Alex Posted August 23, 2010 Share Posted August 23, 2010 What you want is mod_rewrite and pretty URLs. Just Google it and you'll find plenty of results with examples on how to implement it. Quote Link to comment https://forums.phpfreaks.com/topic/211467-_get/#findComment-1102852 Share on other sites More sharing options...
ajicles Posted August 23, 2010 Author Share Posted August 23, 2010 Don't make a noob over think lol. I have tried this: Redirect 301 / index.php And it doesn't redirect it to index.php Within the index.php I will just get the referrer then get rid of anything I don't want and then do the sql queries etc.. Error trap it so people can't injection attack and wont accept letters. Its not simple I googled it I got this: httpd.apache.org/docs/2.0/mod/mod_rewrite.html and I don't see anything I need. Quote Link to comment https://forums.phpfreaks.com/topic/211467-_get/#findComment-1102894 Share on other sites More sharing options...
Alex Posted August 23, 2010 Share Posted August 23, 2010 http://www.roscripts.com/Pretty_URLs_-_a_guide_to_URL_rewriting-168.html Quote Link to comment https://forums.phpfreaks.com/topic/211467-_get/#findComment-1102896 Share on other sites More sharing options...
ajicles Posted August 24, 2010 Author Share Posted August 24, 2010 Options +FollowSymLinks RewriteEngine On RewriteRule .* index.php Doesn't work.... Can someone please help me? There are there are 11 examples and none are helping me Quote Link to comment https://forums.phpfreaks.com/topic/211467-_get/#findComment-1102938 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.