Forum Moderators: coopster
I am making a members site in my website. This is how it works,
When an user creates an account a subdomain in created like this
[member-userid.example.com...]
By using PHP's fwrite function i am dynamically generating a blank web page.
[member-userid.example.com...]
Then i take the user to the profile page where they fill up 'keywords', 'body', and other html info. Then I dynamically regenerate the html page with all user info.
I was thinking is this the way to do it or should I store all info into database and each time the page is called, get the info from mysql.
How about changing the theme? Should i delete the old page and create a new page with new theme and ask the user to fill in 'keywords', 'body' again?
I guess i should learn how PhPBB forum works or may be this forum
Any help will be appreciated.
Thank you,
[edited by: dreamcatcher at 12:52 am (utc) on Dec. 19, 2009]
[edit reason] use example.com, thanks. [/edit]
If you want an .html extension, I'd capture it with mod_rewrite and just point it to the script, parse out the file name. All that would be required is to store the file name in the database, for example,
rewrite_rule ^members/([\w\-\d\_]+\.html)$ your-script.php?f=$1
So "filename.html" will be in $_GET['f'] for your-script.php
select * from members where filename='$f'
.....
if ($row=mysql_fetchrow_array($result)) {
//
}
else { error_func("No results"); }
The rewrite above is for example only, untested, may require nursing.
Okie. So now lets say I am storing all data into a database. Most of the stuff of a profile page such as name, address, email, contact number and hobbies, birthdays, and so on .. are now available in a data base.
Like you said I can do this.
[website.com...]
This will fetch all profile data on rocknbil
But I am thinking in a different way. When the user register, I want to actually create a web page for them in their name. For SEO point of view.
[website.com...]
Previously, I wanted to create the whole page with complete data but now, since I am using a database to store info. I will just create the template(Theme). When some calls this page. This template (Theme page) will put different data in specified place after fetching from database.
When user changes the 'theme', I will simply change the template. So, the same data will be displayed in different position and would like different.
ALL THIS IS OK BUT, I am wondering due to my limited programming knowledge how on earth will google or any other search engine will find this? All my keywords and other important data are now in database, Which google cant reach?
Thank you very much for reading this.
...how on earth will google or any other search engine will find this? All my keywords and other important data are now in database, Which google cant reach?
Google sees just the generated HTML page, the same as what the end user sees when they browse to your webpage. Google, or any other search engine has no idea how that page is actually generated, whether from a database or static.
...why write out files that can be just served to the browser, this is a waste of space.
Well, it certainly uses more space, but to cache a dynamically generated page as a static page on the server that can just be served (without much processing) can save a lot of server time on busy sites. Particulary useful when using cookies/sessions that are preventing the page from being cached client side.
http://www.website.com/profile/profile?name=rocknbil
This will fetch all profile data on rocknbil...When the user register, I want to actually create a web page for them in their name. For SEO point of view.
[website.com...]I think rocknbil touches on this... you can use mod_rewrite to serve friendly URLs (ie. [website.com...] but actually process this as "http://www.website.com/profile/profile?name=rocknbil" server side. Although I think these days that the SEO benefit might be marginal with just one argument in the query string?
The problem is that, I want my members to have an unique friendly url which they can TELL others over phone. So I guess an url of this type would make more sense, just like blogger (I am new to programming, so I try to copy what others does!)
[impact.website.com...]
To make it more SEO friendly I have decided to make it
[impact.website.com...]
I have another question. Let some one call this url [impact.website.com...]
the page is dynamically generated with info fetched from database. How can i cache this dynamic page? Is there any script for this? I wont use session scripting here as this will be public always but might use cookies later.
Thank you