Hello everyone.
I am filling in for a php programmer while we get another guy in here. I am not that proficient in php, but need to fix an issue.
We have a script that imports an xml file, and then creates html pages based on the info. The script is a template file with php in it that processes the xml info.
Right now, the first entry in the xml file is the index.html page. For each entry thereafter the script takes the info and creates an html page based on the name of the entry in the xml. I need to change the way the script works a little.
On the first entry of each xml page, I still need it to be the index.html page, but I also need it to create an additional html page with the name of the entry.
In other words I need 2 pages for the first entry in each xml page. One is index.html and the second is - the name of the entry.html
For example in the first xml page, the first entry is Bagdad Theater and Pub.
The php script names this the index.html page.
The second xml entry is Bagdad Theater Lobby.
The php script would name this page bagdad_theater_lobby.html
What I need, is for the script to call the first page
index.html and bagdad_theater_and_pub.html.
I believe this should resolved by changing that script to just loop twice if its the first entry in the xml file, I just don't know how to do this.
Here is the code in the php script that creates the html pages based on the entry in the xml page:
<a href="<?= ($j=="0" && $m=="0") ? "index.html" : str_replace($url_search, $url_replace, strtolower($xml->viewer_window[$j]->tab[$m]->capture[0]->title)).".html"; ?>"><?= $xml->viewer_window[$j]->tab[$m]->title ?></a>
Does anyone know how to do this?
Thanks.