Generating Static Pages: Need an Expert's Advice!!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
johnbran
Forum Newbie
Posts: 17
Joined: Tue Jul 16, 2002 8:18 pm

Generating Static Pages: Need an Expert's Advice!!!

Post by johnbran »

I'm a novice but I am proud to say that I have just finished developing some really nice dynamic pages using PHP. However, now we want to upload the pages to an offsite server because of our firewall limitations. We want the pages to be accessible via the internet....but again because of our firewall. We have just discovered that this will not work because my dynamic pages are connnecting to MSSQL via ODBC and once the pages are uploaded to the offsite server my pages no longer work. So, my question is how can I generate static pages locally and then upload those particular static pages to the server? Can someone please help me! I hope my question makes sense.
rev
Forum Commoner
Posts: 52
Joined: Wed Oct 02, 2002 3:58 pm
Location: Atlanta, GA

Post by rev »

Take a look at the Output Control functions in PHP, let us know if these do the trick for ya.

http://www.php.net/manual/en/ref.outcontrol.php

I am guessing that you are Windows, so my UNIX-based suggestions may not prove useful. But, if you are on UNIX, something you could do is use 'wget' to grab the file from your development server and then write a method to ftp/scp/etc... the wget output file over to your front-end web server.
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

Can't you configure the firewall?
johnbran
Forum Newbie
Posts: 17
Joined: Tue Jul 16, 2002 8:18 pm

Post by johnbran »

I think she is using Linux. Regarding the firewall....our IS department won't allow it!

So, can the wget you suggested be used for Linux? If so, can you refer me to an example of how to make this happen...

Thank You again!
rev
Forum Commoner
Posts: 52
Joined: Wed Oct 02, 2002 3:58 pm
Location: Atlanta, GA

Post by rev »

johnbran wrote:So, can the wget you suggested be used for Linux? If so, can you refer me to an example of how to make this happen...
Just a quick, and dirty example.

Code: Select all

<?php
/* make sure '/dir/where/you/want/to/store/the/file/' is readable/writable by your web server */
@chdir("/dir/where/you/want/to/store/the/file/");
/* wget may not be in your user path, thus you might have to call it literally... e.g. /bin/wget or /usr/sbin/wget, etc... */
@exec("wget -q http://your.server.com/path/to/file.php");
@exec("mv file.php file.html");

/* now you have a flat html file of the php output post parse */
?>
kcomer
Forum Contributor
Posts: 108
Joined: Tue Aug 27, 2002 8:50 am

Post by kcomer »

Just a side not. You can get wget for windows if you need it.

Keith
johnbran
Forum Newbie
Posts: 17
Joined: Tue Jul 16, 2002 8:18 pm

Post by johnbran »

Thank you....I will have her try this today. Hope it works. I'll keep you posted!

Thanks!
Post Reply