Generating Static Pages: Need an Expert's Advice!!!
Moderator: General Moderators
Generating Static Pages: Need an Expert's Advice!!!
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.
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.
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.
Just a quick, and dirty example.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...
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 */
?>