tutor1 Posted June 14, 2012 Share Posted June 14, 2012 i recently started to write my own blog engine, but i have problems. Problem is that when i make file page.php, how i can make single article URL as in this example: page.php?name=i_want_to_know or page.php?id=32 ? Please answer because I need it. Link to comment https://forums.phpfreaks.com/topic/264174-how-to-make-url-looks-like-pagephpid32-or-something-like-that/ Share on other sites More sharing options...
AMcHarg Posted June 14, 2012 Share Posted June 14, 2012 <a href='page.php?id=$x'>Link</a> Link to comment https://forums.phpfreaks.com/topic/264174-how-to-make-url-looks-like-pagephpid32-or-something-like-that/#findComment-1353773 Share on other sites More sharing options...
tutor1 Posted June 14, 2012 Author Share Posted June 14, 2012 thanks for that but will it work when I wnat to make single article on one page ? something like in wordpress . thanks Link to comment https://forums.phpfreaks.com/topic/264174-how-to-make-url-looks-like-pagephpid32-or-something-like-that/#findComment-1353774 Share on other sites More sharing options...
AMcHarg Posted June 14, 2012 Share Posted June 14, 2012 I'm not following what you mean? :-\ If you want a dynamic php page to output certain content based on a variable in the url, then the code above is part of the solution for doing that. Link to comment https://forums.phpfreaks.com/topic/264174-how-to-make-url-looks-like-pagephpid32-or-something-like-that/#findComment-1353776 Share on other sites More sharing options...
tutor1 Posted June 14, 2012 Author Share Posted June 14, 2012 OK, I'll now give more details. I first crated page.php in my htdocs (xampp) and in this page.php i've made script that uses mySQL to get article content. As you can see this page also has link "http://www.phpfreaks.com/forums/index.php?action=post;topic=360963.0;last_msg=1707183" but for me it's interesting just "index.php?action=post;topic=360963.0;last_msg=1707183". How I can make page that will use mySQL database for any article and print it into page.php?name=article_name site? Do you know what I mean now? thanks again Link to comment https://forums.phpfreaks.com/topic/264174-how-to-make-url-looks-like-pagephpid32-or-something-like-that/#findComment-1353782 Share on other sites More sharing options...
Jessica Posted June 14, 2012 Share Posted June 14, 2012 Do you know how to write an SQL select query? Link to comment https://forums.phpfreaks.com/topic/264174-how-to-make-url-looks-like-pagephpid32-or-something-like-that/#findComment-1353796 Share on other sites More sharing options...
tutor1 Posted June 14, 2012 Author Share Posted June 14, 2012 OK OK... I know... I'll make for every title link like <a href="page.php?name=title_name">title</a> and in page.php I'll read from mySQL with Title name... then I'll print title,content,autor name and so on. Thanks !!!! Link to comment https://forums.phpfreaks.com/topic/264174-how-to-make-url-looks-like-pagephpid32-or-something-like-that/#findComment-1353832 Share on other sites More sharing options...
Jessica Posted June 14, 2012 Share Posted June 14, 2012 Exactly Link to comment https://forums.phpfreaks.com/topic/264174-how-to-make-url-looks-like-pagephpid32-or-something-like-that/#findComment-1353839 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.