hello, im new to all of this i have php embeded in html and saved as index.php, in html part of it i want to connect to an external PHP script located in my friend's webspace i use the <script> tag both doesnt work. <script src="http://domain.com/filename.php"></script> and <script type="text/javascript" src="http://domain.com/filename.php"></script> i just want to simply output the result of that php script in the certain part of my site. my php scripts are working, but this part im having prob. with am i using the correct method?
your friend's page shoud be something like <script type="text/javascript"> document.write("HTML HERE"); </script> HTML:
A PHP script is processed on the sever, whereas JavaScripts are processed inside the broswer, so they're really not compatible. I think you're going to have to copy your friend's PHP file to your site, then include it via PHP. Your server will need to process that PHP. Alternately, I suppose you could use an iframe on your page, and have the source of the iframe be the PHP file.
Mmm yeah I have done this. visit wwwDOTlankacarsaleDOTcom and view source if you want to use dynamically created javascript using php server side scripting you can use <script type="text/javascript" src="http://domain.com/filename.php"></script> without having any problems but make sure to avoid <script type="text/javascript"></script> tag in the php file if you can not modify your friend script as you want above, you have use your own script.
Madura, Oh, I see. You're using PHP to generate the JavaScript array. I should have thought of that. Javver, does this work out for you?