close
Question by ElQuestionaire: How to include elements from different webpages using PHP or JavaScript to my home page?
tags from Post.php into a
I have a homepage (MyHome.php). On the homepage, I'd like to display the latest 3 posts from another page (Post.php). For example. I want to include the first 3
tags from Post.php into a tag on MyHome.php. Is it possible to do this?
Best answer:
Answer by George H
It really depends on how you are accessing your database....doesn't matter if it is SQL or flat files, but why not send a url variable to your post.php file like:
include ('post.php?amount=3'); That way when you hit your post.php script you can check if there is an amount variable via the GET method and just do a quick for loop to display that many posts. Hope this helps.
Give your answer to this question below!
Related sites: Link , Link , Link , Link , Link
Best answer:
Answer by George H
It really depends on how you are accessing your database....doesn't matter if it is SQL or flat files, but why not send a url variable to your post.php file like:
include ('post.php?amount=3'); That way when you hit your post.php script you can check if there is an amount variable via the GET method and just do a quick for loop to display that many posts. Hope this helps.
Give your answer to this question below!
Related sites: Link , Link , Link , Link , Link
全站熱搜