javascript - Include file.php + id. Is this possible with php? -
i've built site php include , index follows:
menu.php (menu system)
main.php (index site)
footer.php (footer obv.)
anyway, when main.php (index) opens, i've added news script uses $_get fetch news-data our mysql database. generates id each news, , shows few characters of full news.
so, i've added link in each news says "read more" expand news, looks this:
<a href="news.php?id=<?=$row['id']?>">read more</a></p> so, there way me include site (replace news.php?id=x main.php)?
it gives me syntax error when i'm trying use <?php include in link since it's using <?=$row['id']?>.
the got far people telling me change menu system javascript (ajax, jquery) i'm not familiar this. there can more simple changing menu javascript?
thanks , understanding,
have great day!
yeah, include adds code of file execution of code using. if have variable in index file can use in menu file.
if menu file has loaded on own can conditional existence of get, existence of variable in index file, , if none of them exit, set default value.
Comments
Post a Comment