Page 1 of 1
Generating Static Pages: Need an Expert's Advice!!!
Posted: Thu Oct 03, 2002 1:45 pm
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.
Posted: Thu Oct 03, 2002 2:45 pm
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.
Posted: Thu Oct 03, 2002 3:36 pm
by Takuma
Can't you configure the firewall?
Posted: Thu Oct 03, 2002 8:28 pm
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!
Posted: Thu Oct 03, 2002 11:36 pm
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 */
?>
Posted: Fri Oct 04, 2002 7:40 am
by kcomer
Just a side not. You can get wget for windows if you need it.
Keith
Posted: Fri Oct 04, 2002 10:18 am
by johnbran
Thank you....I will have her try this today. Hope it works. I'll keep you posted!
Thanks!