Hello,
I've just begun exploring php and have a question about the $_SERVER[SERVER_ADDR] variable.
My dilemma is as follows. Recently i created a webpage that use an embedded php script to stream audio from my site.
The trouble i have is that i'm on dynamic IP connection.
Whenever my IP changes the absolute adresses on my index.html page to the php components break and the site don't work properly until i've manually corrected this.
Since this requires constant monitoring of the site i've been trying to find a solution to fix this.
My thought then went to using the $_SERVER[SERVER_ADDR] variable in these url' to update them automatically. However, it only worked partially.
In the following lines it was possible to change the IP number part in the url with a variable containing the $_SERVER[SERVER_ADDR] string.
<param name="movie" value="http://213.113.162.66/%7esilvergleam/wimpy_mp3_php/wimpy.swf?wimpyApp=http://213.113.162.66/~silvergleam/wimpy_mp3_php/wimpy.php&wimpyskin=http://213.113.162.66/~silvergleam/wimpy_mp3_php/skins/skin_tube.xml&serveMP3=yes"/>
but... in the embed part of the code i couldn't get it to work
<embed src="http://213.113.162.66/%7esilvergleam/wimpy_mp3_php/wimpy.swf?wimpyApp=http://213.113.162.66/~silvergleam/wimpy_mp3_php/wimpy.php&wimpyskin=http://213.113.162.66/~silvergleam/wimpy_mp3_php/skins/skin_tube.xml&serveMP3=yes" />
Now to my question;
Is it at all possible to use a variable containing $_SERVER[SERVER_ADDR] in the SRC url and if so what would the correct syntax be?
If not, is there another way of automatically updating these urls when the IP adress change?
Many thx in advance.
/Tony 🙂
p.s I'm on Mac OSX 10.3.9 and use Apache/1.3.33 (Darwin) & PHP/4.4.1