Forum Moderators: coopster

Message Too Old, No Replies

hosted php help

         

Zenden

1:05 am on Apr 25, 2005 (gmt 0)

10+ Year Member



well, i used to use apache server for hosting a php script, it created a xml file, but i want to stop hosting it on my pc and pass it to a hoster, but the file have to be created in my computer, is there any way i can do such a thing?

mcibor

10:02 pm on Apr 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Could you clarify what you really want to do, because what you wrote doesn't make any sense to me.

If I guess... you want to generate a xml file with php, and not to write it on the server and then download it, but create it on the client's machine.

That can be done. Just echo it, not write it into the file:

file.xml (xml will have to be parsed by php as well)

<?php
$xml = "<?xml... ";//your whole xml file you want to generate
echo $xml;
?>

It is now generated on client's computer.
you can add some headers before outputting the file, if you wish:

header("text of the header");
Hope this helps somehow. If it's not what you desired then write
Best regards
Michal Cibor

Zenden

11:00 pm on Apr 26, 2005 (gmt 0)

10+ Year Member



ill try to explain better,

i have i script that creates the file. i am hosting it on my pc using apache,

but i want to transfer it to the hoster, but the xml file have to be created in my pc not in the hoster pc.

better explained?

mcibor

8:18 pm on Apr 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



the above code will work. To save the file as stream add some headers that are not recognized by a browser (e.g. as .my extension). If you echo ""; the code it is being "generated" on the hoster server, but not saved there as a file.

There isn't a way in php (which is server side language) to generate code on the client's side.

I hope that we understood each other.
Michal Cibor

ergophobe

8:41 pm on Apr 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm reading this differently than Michal, but I don't understand either


but the xml file have to be created in my pc not in the hoster pc.

But your PC is the server currently, not the client, and the file gets processed server-side and then you send the results to the client?

Why must the file be created on your PC? Sorry, just not following this.

Zenden

12:02 am on Apr 28, 2005 (gmt 0)

10+ Year Member



i plan to have my php scripts hosted on a hoster.

this script will create a file, this file is a part of a game server in my computer, like the character on the game. and i want people to create it on the script on the hoster, but the file have to be transmited to my computer automaticaly.