divinedesigns1 Posted May 27, 2012 Author Share Posted May 27, 2012 No if statements or anything else? All I can say is that if everything is correct then it will work, there is nothing strange or unusual about include files.yeah, i know, thats why i cant figured it out, since the correct information is in there, im even using the same include file for other stuff and it working just fine, i think its somewhere along the line where the script get that post to edit it, but ill keep working at it, thanks again jsg Link to comment Share on other sites More sharing options...
divinedesigns1 Posted May 27, 2012 Author Share Posted May 27, 2012 heeeeeeey so i decided to ignore the edit page for now, and work on the main stuff, which is working fine for me anyway, i would like to know how how i can make each news that is posted to have their own link when you click on the "more" link, yes i created the index page and it works perfect buttt, it shows all the time news that is posted any tip? i know you do something like <a href=news.php?id=$id>..more</a> but im not 100% sure about that, since it did not work lol yeah i had to try it before i ask my questions ya know Link to comment Share on other sites More sharing options...
justsomeguy Posted May 28, 2012 Share Posted May 28, 2012 That's right, you send a variable in the URL that you can use to look up the item in the database. Link to comment Share on other sites More sharing options...
divinedesigns1 Posted May 29, 2012 Author Share Posted May 29, 2012 yeah i tried that but it just give me the url back without the number, or do i need an extra page to get the url by its id then link each news title on the index page to that page according to its id Link to comment Share on other sites More sharing options...
thescientist Posted May 29, 2012 Share Posted May 29, 2012 if the id wasn't there, maybe you did something wrong when you generated the HTML. Passing by an id or something similar is fairly common. It's being used in this forum. Link to comment Share on other sites More sharing options...
divinedesigns1 Posted May 29, 2012 Author Share Posted May 29, 2012 what i did was <a href="news.php?$id=id">..more..</a> but it didnt work, mhmm to think about it, i think i need a query to select all the post by the $id='id' order by desc does that make sense? Link to comment Share on other sites More sharing options...
birbal Posted May 29, 2012 Share Posted May 29, 2012 <a href="news.php?$id=id"> will be <a href="news.php?id=$id"> id is the name and value of $id will be passed as value of "id" you can always dump the $_GET (in news.php) using var_dump() or print_r() to check what is it getting Link to comment Share on other sites More sharing options...
divinedesigns1 Posted May 29, 2012 Author Share Posted May 29, 2012 <a href="news.php?$id=id"> will be <a href="news.php?id=$id"> id is the name and value of $id will be passed as value of "id" you can always dump the $_GET (in news.php) using var_dump() or print_r() to check what is it gettingso with that you will get that post, by the id your looking for instead of getting all the post on the news.php like i have it atm Link to comment Share on other sites More sharing options...
birbal Posted May 29, 2012 Share Posted May 29, 2012 yes. if you want to pull particular content of specific id from the database, you have to catch $_GET['id'] and pass it in query's WHERE clause. Link to comment Share on other sites More sharing options...
divinedesigns1 Posted May 29, 2012 Author Share Posted May 29, 2012 yes. if you want to pull particular content of specific id from the database, you have to catch $_GET['id'] and pass it in query's WHERE clause.thats prolly why its not working, because i have all of them selected on the news.php page with no $_get['id'] function, but i have the $_get['id'] function on the index page and the query doesnt have a where clause either, thanks a lot ill try that soon as i get home Link to comment Share on other sites More sharing options...
birbal Posted May 29, 2012 Share Posted May 29, 2012 and also $_GET superglobal array is case sensitive. as all the variables of PHP are. so $_get is not same as $_GET Link to comment Share on other sites More sharing options...
divinedesigns1 Posted May 29, 2012 Author Share Posted May 29, 2012 yeah i know, but thanks for the reminder Link to comment Share on other sites More sharing options...
justsomeguy Posted May 29, 2012 Share Posted May 29, 2012 yeah i tried that but it just give me the url back without the numberA lot of modern browsers will hide the querystring, you'll need to click in the address bar to see it. Link to comment Share on other sites More sharing options...
divinedesigns1 Posted May 29, 2012 Author Share Posted May 29, 2012 A lot of modern browsers will hide the querystring, you'll need to click in the address bar to see it.yeah, i did click in it and i ended up with the same link i wrote, but it did took me to the news.php page which is good Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now