Forum Moderators: coopster

Message Too Old, No Replies

Getting spiders into the database

         

zonkd

3:15 pm on Aug 31, 2005 (gmt 0)

10+ Year Member



This is probably an old topic, sorry, but how can I show google spiders et al the text in my mysql db, please?

coopster

3:44 pm on Aug 31, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Create a link from an existing page that executes a script which read the text from the database and display it in an html page.

zonkd

7:40 am on Sep 1, 2005 (gmt 0)

10+ Year Member



Hi coopster

Do you mean so that it is on permanent display as html pages are? (That's the problem the way things are: because spiders don't click buttons, the text remains in the db for likely spider visits.)

If the site has a hundred pages in the db, does this mean I should have a hundred pages duplicated in permanent display? Couldn't be, could it, otherwise what's the use of php/mysql?

I hope you won't mind explaining - or directing me to some article please.

Cheers

zulu_dude

8:33 am on Sep 1, 2005 (gmt 0)

10+ Year Member Top Contributors Of The Month



Hi zonkd,

As coopster says, you need to read the info from the database and display it as an html file (or .php or .asp or whatever). In other words, you need to stick it into a format that a normal web browser can read.

From what it sounds like, it seems that the easiest way for you to do this would be to create a php page with a $_GET variable which corresponds to the page you want to get from the database.

So, you create a page mypage.php

Pass it a variable to tell it which page to load from DB: mypage.php?page=widgets1

In the php, use $_GET to get the variable passed to the script: $page=addslashes($_GET['page']);

This page will then take the variable 'widgets1', look up the correct database entry for widgets1 and load it up for the spider (and/or users) to chew on.

You might then ask, what is the point of this? It looks like you'll have to make a page for every page in the database... however, if you then create another page with a whole bunch of links like so:

mypage.php?page=widgets1
mypage.php?page=widgets2
mypage.php?page=widgets3
mypage.php?page=widgets4

You can display 100 (or more) different pages from your database with just the one page. It also allows your users to browse directly to the articles in your database.

Not sure if all this makes sense, it's too early in the morning to be thinking!

zonkd

9:00 am on Sep 1, 2005 (gmt 0)

10+ Year Member



Thanks very much, zulu-dude.

I think I have grasped it. (Well, I'll print it and go througgh it a few times.)

Very much obliged to you. Cheers