Search the Community
Showing results for tags 'external'.
-
Hi all, So im trying to improve on my PHP as my knowledge isn't that great. lets say for argument sake my ip is: 192.168.0.1 im trying to set a external variable to set this as the url. so on each page i use, for each link instead of typing out the ip address i can simply type: <a href="{url}/index.php">Home</a> and then if it is possible, to do something like this: <link rel="stylesheet" href="{url}/main.css" type="text/css"> all in one file so in my php pages i can simple include 1 php file and it will have all of the relevant stylesheets ect linked to it.
-
I am having issue on my PHP photo gallery. The album name is generate by the folder name as below: '. $_GET['album' So what I am trying to do is to show some external xml date in the gallery base on different albums name, I now tested with 3 different albums with the folder name Adriana, Alicia and Eva. Once again the album name is generate by the folder name. $folder_name = $_GET['album']; echo $folder_name; The above code is working to get the title on specific folder name of that album. Next I have a external xml file with different info for each album. Which I would like to show different info for each album. my xml file as below: <?xml version="1.0" encoding="UTF-8"?> <library> <models> <Adriana>This is the model info of Adriana</Adriana> <Alicia>This is the model info of Alicia</Alicia> <Eva>This is the model info of Eva</Eva> </models> </library> I first tested with this code to make sure it can read the "info": <?php $url = 'albums/Adriana/info.xml'; $xml = simplexml_load_file($url); $info=$xml->models->Adriana; echo $info; ?> Above code works fine, but what I really need to do is something like this, and this is the part that I got an error. $info=$xml->models->$folder_name; Please let me know what am i missing on the above line.