simple way of using on existing site – is this OK?
-
Hi all
I’m not sure though whether what I’m doing is good practice though as I kind of mixed a few tutorials and made some bits up myself.
Basically, I already have a site so I thought I’d avoid going down the template route for now.
I have one of my pages that goes through the basic loop and pulls in all the post titles.
The titles are surrounded by a href that links to another one of my pages but with the post id as the last bit of the URL – e.g.
“/blog/mysinglepage.php?p=3”I then use PHP to get the id from the query string and store it as a variable.
Then the loop uses this to query the posts and only displays the post with the relevant post id.
Does that sound OK to everyone or is this a bit of a “no no”? It does seem a little slow to load (although it could be the server) and I was a little concerned that people might be able to use the URL to hack into posts.
Any pointers would be very much appreciated as I’m really new to this.
If you’d like to see this in action:
https://www.kellymckain.co.uk/blog/test.php
Cheers
Matt
- The topic ‘simple way of using on existing site – is this OK?’ is closed to new replies.