|
#1
|
||||
|
||||
|
Ok all you PHP gurus, I have a little dilemma here. I will start with some background.
One of my clients sites has all static pages, and I have been maintaining it for them for 9 years. All the main files for there listings are static htm and all in the root "public_html" directory. Most my other sites are data base driven with dynamic Mysql/PHP, so they can manually add/change there own real estate listings. One main reason for the static pages on this site is "search engine" ranking. It is a high volume site for the real estate they sell, and all the key words gets them on page one, which is rather hard to do in the competitive world of "Ranches for sale in Texas". Now my problem, after a few health issues, and the fact they need any changes to there web site ASAP, I have a database with dynamic generated pages either to add or change the content and then have it "fopen" "chmod" , etc, all the pages to htm. static pages. Problem, the directory I can create them in can not be in the "public_html", as I need it to be chmod to 777, and one, it will not let me, and two I don't want the root to be 777. I can change the chmod to any directory to 777 to fopen a file, and then back again to 750, just will not happen to the root. I other words, I can have my 13 year old granddaughter make the changes without having to know html, just need to get the htm static pages to the root directory. Please don't recommend "frontpage", as I don't even have the server setup for the extensions. I can do all this online with my program, only that one problem. I hate to have to FTP to the account and copy the new static pages every time, which is an option if all else fails. Last edited by TeeJa; 07-08-2006 at 11:05 AM. |
|
#2
|
||||
|
||||
|
As a follow up.
Using a test setup to do what I want, I can now create a static page in the root dir. It is a combination of using "fopen" & "ftp_site". connects using ftp with user name/password, CHMOD to 777, writes the file, then another function to bring the root "public_html" back to 750. Now have to put it all together using the database. Was wondering if there is a security risk by putting the root as 777 for a fraction of a second??? |
|
#3
|
||||
|
||||
|
Why would you need to have it 777 in the first place. Are you not running PHPSuExec?
Search engines can index dynamic pages now. So having a PHP page isn't really a problem. |
|
#4
|
||||
|
||||
|
No, I don't have PHPSuExec installed.
Like I said in my post, static pages seem to do way better than the database ones, even with them showing as html pages through .htaccess. Changed a couple static pages to dynamic , and did see a drop in ranking with them. Client does not want to do there own pages, and prefers static pages. When you can sell million dollar ranches from visitors off the web site, client does not want to rock the boat. Besides, he is my biggest client and has no quams on my fee. All I got to do is modify the script to write the data to the file now, which seems like a few weeks to get it tweaked out, but it was something I wanted to do for a while now anyway. This way any one can update the pages in case I have another emergency run to the hospital. |
|
#5
|
||||
|
||||
|
Forget the 777 thing. Write a little perl script that does the copy. It just needs to be a few lines and it will do what the 777 would need to do.
|
|
#6
|
||||
|
||||
|
Ok, I found a little obscure script googling.
It is really simple to make a static html from a dynamically produced PHP/Mysql call. http://www.mccollom.com/listings/test2.php This is just a quick test I ran on it, I need to add all the variables to it, incorporate it into the main program and when a change is made or new listing in the admin, there will be a one button make file that will create the static listing page and the Index page(s) for what ever category it falls into and put into the root dir. NO, you do not want every visitor that comes to your site to generate a page, it can suck up a lot of resources, there just made once, or modified by who ever is creating the new listing. If any one is interested, here is the function script: Code:
<?php
function wwwcopy($link,$file)
{
$fp = @fopen($link,"r");
while(!feof($fp))
{
$cont.= fread($fp,1024);
}
fclose($fp);
$fp2 = @fopen($file,"w");
fwrite($fp2,$cont);
fclose($fp2);
}
//Example on using this function
echo "<br><br><center> This is now creating a static page from this php link</center>";
echo "<br><br><center> http://yoursite.com/listings/ranchview.php?listingID=1</center>";
wwwcopy("http://yoursite.com/listings/ranchview.php?listingID=1", "6001.htm");
echo "<center><a href=\"http://yoursite.com/listings/6001.htm\">Check your link as a static page.</a></center>";
?>
|
|
#7
|
||||
|
||||
|
I have something like that on one of my pages. The way I got around the resources is that I checked the time stamp on the file. If it was older than a set amount, the page was regenerated.
However, I still don't think that page rank is based on file type. I'm fairly sure if you took a well ranked dynamic page and change it to a static page, you would see a drop in page ranking. Plus with mod_rewrite, it is impossible for google to tell a dynamic page from a static page. |
|
#8
|
||||
|
||||
|
Quote:
I want to take a few weeks off occasionally and be a beach bum at the Gulf where there is no cell phone signal and surf fish......
|
|
#9
|
||||
|
||||
|
Given that, you can do like I do for those types of things. Just give them a button to press that builds the page when they have made the updates. I'm doing that right now with a dynamically generated PDF file for a client. They update the database and then press a button that builds a new PDF file for the site. Dynamic and static at the same time. (Its a PDF so the customers can print it).
I've found that the button thing does work well. The customers have no problem understanding how to build a new page. I even added a function that allows them to create an empty page. I didn't even have to explain what it was, they just saw it and started using it. |
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
|
|
All times are GMT -5. The time now is 07:56 AM.









