Pass var on include_once
Posted: Tue Sep 30, 2008 6:13 am
Hi,
I have a script on my site that displays by default 5 latest songs added. I include this script using include_once and I was thinking if I could get it more dynamic by setting how many songs I want to display in the include url.
I tried:
But resulted in an error.
I want to define $song_nr in my url if possible.
Easy fix is to write:
But wanted to see if there was another way.
cheers
I have a script on my site that displays by default 5 latest songs added. I include this script using include_once and I was thinking if I could get it more dynamic by setting how many songs I want to display in the include url.
I tried:
Code: Select all
<?php include_once("latest_music.php?song_nr=10"); ?>I want to define $song_nr in my url if possible.
Easy fix is to write:
Code: Select all
$song_nr = 10; include_once(...)cheers