Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
PHP script to convert XML to HTML
Old 08-21-2004, 09:08 AM PHP script to convert XML to HTML
Novice Talker

Posts: 11
Trades: 0
Hi folks,
I have two questions.

I'm looking for a PHP script to convet a XML file to a HTML file on the fly. Do you know where I can find this?.

On the other hand, I create a PDF file using PHP. When the PDF is open on a new web browser, and after a delay of 1 minute, the PDF file must be delete from the server directory. I've try with this PHP instructions:

sleep(60);
unlink("$result"); -->where $result has the link to the pdf file.

but something is worng because I can open the file before delete it (of course). Any ideas.

Thank
aufkes is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-22-2004, 05:28 AM
webwoRRks's Avatar
Ultra Talker

Posts: 426
Location: I hope so
Trades: 0
...? Do you mean your PDF is not getting deleted, or is the problem that you can still read it after 1 minute? If the latter, this will be due to your browser caching the information (or you simply not refreshing).
__________________
Theres 10 types of people; those who understand binary, and those who don't.
webmaster and webdeveloper resources,
Please login or register to view this content. Registration is FREE
webwoRRks is offline
Reply With Quote
View Public Profile Visit webwoRRks's homepage!
 
Old 08-22-2004, 08:31 AM
Novice Talker

Posts: 11
Trades: 0
Well, the file is delete after 60 secons. The problem is that when I am testing the script in my own PC, I can't see the delay on the screen. For example, if I do this:

<?
print("Something now . . . [".date("d/m/Y H:i:s", time())."]<br>");
sleep(5);
print(". . . and something 5 seconds later [".date("d/m/Y H:i:s", time())."]");

?>

I get this on the screen,

Something now . . . [22/08/2004 12:23:23]
. . . and something 5 seconds later [22/08/2004 12:23:28]

The result is on the sceen is obviously correct, but I get the two lines at the same time, so I do not appreciate any delay on the screen, like you can see in this web page.

http://demo.webignition.net/06/

Maybe the problem is that I have to run the code in a server different from my local PC. I don't know!!!
aufkes is offline
Reply With Quote
View Public Profile
 
Old 08-22-2004, 08:46 AM
Novice Talker

Posts: 11
Trades: 0
The same problem is described here

http://forums.devshed.com/showthread...d=1#post764573
aufkes is offline
Reply With Quote
View Public Profile
 
Old 08-23-2004, 02:48 PM
j0e
Average Talker

Posts: 23
Location: UK
Trades: 0
Your webserver will wait until the PHP script has been executed before returning any results. So need to flush the output buffers if you want to display a bit of the page before it has finished executing.

To do this, just use the flush() function, so your code should look like this:

Code:
print("Something now . . . [".date("d/m/Y H:i:s", time())."]<br>");
flush();
sleep(5);
print(". . . and something 5 seconds later [".date("d/m/Y H:i:s", time())."]");
See more about it here: http://uk2.php.net/manual/en/function.flush.php

I don't really understand your PDF problem, maybe that will help though.

As to the XML, start by reading this: http://uk2.php.net/manual/en/ref.xml.php

Regards,
Joe.
j0e is offline
Reply With Quote
View Public Profile
 
Old 08-23-2004, 03:15 PM
Novice Talker

Posts: 11
Trades: 0
Many thaks indeed, jOe
aufkes is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP script to convert XML to HTML
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.40441 seconds with 12 queries