It's good to know it, thanks 🙂 Although I achieved what I wanted in a different way.
This script is getting even more complex u.u I got a lot of doubts atm so I'm going to ask a few of them;
How my script works at the moment:
1. You fill out a form, with the movie info and the FTP info (since I've been switching between a lot of webhosts lately, it was better this way).
2. When you click submit, the following happens:
- The SWF file is uploaded via FTP to my host.
- An XML file is created on my computer [note: inside the htdocs folder (I'm using xampp)]
- An existing XML file in my computer is modified, there are three lists, for three authors, each list with the author's respective movies (name and link of every movie). Each time I upload a movie, it gets the author's name and puts the XML tag on the respective list.
- That XML list is retrieved by the corresponding author's page, showing his movies and the link to them.
Kinda complex hu u.u at least for me I guess, don't know that much about PHP yet.
Anyway, the problem is, since I have the SWF files in the internet, and the XML files locally, I retrieve the information with a local page (remember, all this was because I cant use the simpleXML extension on any of my website hosts), but obviously, I see it with [url]http://localhost:port/-pathtomovie/[/url] and other people through my IP.
Is there anyway to make it available on the same address? So I don't have to keep changing the address bar from my IP to 'localhost'.
I know it sounds 'lazy' but it's not because I am, it's because I want to learn how to do it.
EDIT: Decided to run my website from my computer, using only my host to store the SWF files, since those take a long time to load if I do it locally (to other people).
If you know of any other way to do what I want to, or know of any reasons to not do what I did, please tell me.
EDIT2: More questions u.u
-If I have;
<?xml version="1.0"?>
<movies>
<movie name="-name1-" serie="-serie1-" link="-path-/view.php?movie=-name-"/>
<movie name="-name2-" serie="-serie2-" link="-path-/view.php?movie=-name-"/>
<movie name="-name3-" serie="-serie1-" link="-path-/view.php?movie=-name-"/>
</movies>
How can I print them like this?:
-Serie 1-
-Serie 2-
So far I got this:
$file = "-path-/list.xml";
$xml = simplexml_load_file($file) or die ("No se pudo cargar el archivo XML");
foreach ($xml->movie as $movie) {
if ($movie['serie'] == "-serie1-") {
echo '<span class="style1">'.$movie['-serie1-'].'</span><br />';;
}
echo '<a href=javascript:popup("'.$movie['link'].'");>» '.$movie['name'].'</a><br>';
}
It obviously doesn't work, so far I've only uploaded from one serie, so that works if I type -serie1- in the first movie and leave the rest movies' "serie" spaces blank.
Thanks again u.u any help appreciated.