 |

05-04-2006, 03:21 AM
|
 |
SEO
|
|
Join Date: Feb 2006
Posts: 374

|
|
|
turning database records into html
does anyone know a good tutorial about turning database records into html pages.(SEO friendly) ?
would really appreciate it!
thanks!
|

05-04-2006, 10:16 AM
|
 |
SEO GUY Moderator
|
|
Join Date: Sep 2004
Location: Antalya, Turkey
Posts: 4,111

|
|
|
Hi,
there are lots of ways to do it. What sort of database is it Access, MySQL, MS SQl etc.. Is it all text content? Any other info...
Cheers,
Paz.
__________________
10.3 million entries for Hotels in Turkey but I'm still chipping away.
|

05-04-2006, 02:47 PM
|
 |
SEO
|
|
Join Date: Feb 2006
Posts: 374

|
|
|
it's text content only.. it's MySql database. I will use PHP to do it.. the thing is that I pretty much have an idea how to do it, found a nice tutorial also..the DB contains poems.. and after I display them I would like to make the dynamic content look like directories.. as on this site famouswhy.com.
and I would love to have some help along the way.. I know I will have to edit the .htaccess in the end to do this..
Is it so very hard? Pls. explain this process a little to me and show me some alternatives.
thanks in advance ppl. but mostly thanks PAZ!
|

05-04-2006, 10:45 PM
|
 |
SEO GUY Moderator
|
|
Join Date: Sep 2004
Location: Antalya, Turkey
Posts: 4,111

|
|
|
Hi,
I looked at the site and it's nice, but I couldn't figure out which directory software they are using.
If you're looking more for a text directory with thumbnails, then I'd go for php Link directory, or the site sift software. Both have free versions.
The htaccess isn't worth the work you'd have to do, in my view, but there may be seo-friendly hacks for those directories. In fact the site sift software was developed by a forum member, and I'm sure it's spider friendly.
Why not post something in the "directories" forum and see what people suggest.
Cheers,
Paz.
__________________
10.3 million entries for Hotels in Turkey but I'm still chipping away.
|

05-05-2006, 01:23 AM
|
 |
SEO
|
|
Join Date: Feb 2006
Posts: 374

|
|
|
hm... I keep getting the same suggests from others.. to stay away from the .htaccess..
everyone says it's hard.. I have a little programming experience.. I think I could figure it out with some good tutorial and advice..
P.S. I posted as you suggested in the directories part of the forum..
But you won't escape.. I'll still be expecting a solution from you Paz, cz you solve everything all the time haha
|

05-05-2006, 02:39 AM
|
 |
SEO GUY Moderator
|
|
Join Date: Sep 2004
Location: Antalya, Turkey
Posts: 4,111

|
|
__________________
10.3 million entries for Hotels in Turkey but I'm still chipping away.
|

05-09-2006, 07:34 AM
|
 |
SEO Junior and a half
|
|
Join Date: May 2006
Posts: 69
|
|
Hi,
I've created data driven sites with both ASP and ASP.net. I haven't created sites where it appears to be a directory as the URL. My URLs have parameters like www.mysite.com?parm1=3&parm2=7
Search engines index these pages for me so that's not a problem. PHP is scripting, so I think of it as:
1. connect to the database to fetch the data,
2. then generate the HTML page on the fly.
|

06-09-2006, 10:59 AM
|
 |
SEO Junior
|
|
Join Date: Jun 2006
Posts: 22
|
|
a little late, but I wasn't sure if you've figured this out yet:
Basically you take things on query at a time, then display the results.
PHP Code:
<?php
// SERVER VARIABLES
$server = "localhost";
$user = "johndoe";
$pass = "password";
$database = "articles";
// Connect to MySQL
mysql_connect($server, $user, $pass) or die("Could not connect to server");
// Select Database
mysql_select_db($server, $user, $pass) or die("Could not select Database");
// Run a Query
// In this case, select the ID and author's name from the table "article_listing"
$query = mysql_query("SELECT id, author_name FROM article_listing");
// Fetch the resuls and Display
// Using the mysql_fetch_assoc(), it will create an array $row
// and the keys of that array will be named after what we pulled in the database
// so $row["id"] and $row["author_name"]
while($row = mysql_fetch_assoc($query)) {
echo "<a href=\"poem_listing.php?author_id=".$row["id"]."\">".$row["author_name"]."</a><br />\n";
}
?>
This writes Each author's name on a new line with a link to poem_listing.php
it passes a variable in the URL called author_id with the unique id of that author in the database
by having this, the database knows to display all poems by the author whose ID is in the url
the query on poem_listing.php might look like this
?>
PHP Code:
<?php
// poem_listing.php
// if the variable author_id is not set in the url, give the user an error message
if(!isset($_GET["author_id"]) {
echo "We're sorry. No author was selected. Please go back and try again.";
} else {
// Run the query
// ASSUME THE SERVER VARIABLES ARE ALL DEFINED ON THIS SCRIPT ALSO
// Connect to MySQL
mysql_connect($server, $user, $pass) or die("Could not connect to server");
// Select Database
mysql_select_db($server, $user, $pass) or die("Could not select Database");
$query = mysql_query("SELECT * FROM article_list WHERE author_id='".$_GET["author_id"]."'");
if(mysql_num_rows($query) > 0) {
// DISPLAY RESULTS HERE
} else {
// That author has no articles in the database
echo "We're sorry. That author currently has no articles written.";
}
}
?>
There may be a few small syntax errors here and there (missing semi colon or quote, etc), I just wrote this down quick. But once you have the PHP syntax down, all you need is the manual at php.net.
Let me know if you have any questions.
|

06-09-2006, 01:21 PM
|
 |
SEO GUY Moderator
|
|
Join Date: Sep 2004
Location: Antalya, Turkey
Posts: 4,111

|
|
Quote:
|
Originally Posted by ixpleo
a little late, but I wasn't sure if you've figured this out yet:
<snip>
|
Well better late than never.... nice to have a php coder in the forum.... Welcome!
Cheers,
Paz.
__________________
10.3 million entries for Hotels in Turkey but I'm still chipping away.
|

06-19-2006, 01:33 AM
|
 |
SEO
|
|
Join Date: Feb 2006
Posts: 374

|
|
|
thanks a lot ixpleo for explaining this.. I've just seen it now..
|
 |
| Thread Tools |
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|