meta tags and PHP

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
eyewoo
New php-forum User
New php-forum User
Posts: 71
Joined: Sun Mar 09, 2003 10:29 am
Location: Pennsylvania, USA
Contact:

Tue Jun 24, 2003 7:40 am

Are meta tags spidered in PHP files just as they are in HTML files... I would think so, but I don't really have any expertise on the subject :?:
Philip Williams
Image

pootergeist
New php-forum User
New php-forum User
Posts: 191
Joined: Wed Jan 29, 2003 7:11 am
Location: UK
Contact:

Tue Jun 24, 2003 9:45 am

unless you are specifically blocking spider user agents from running the php files, then they will receive exactly the same output as a browser would

thus, it is perfectly ok to do

echo '<meta type="keywords" content=" .$row['k_words']. '">';

or somesuch
avatar image based upon nasas apod (only updates if I post though)

eyewoo
New php-forum User
New php-forum User
Posts: 71
Joined: Sun Mar 09, 2003 10:29 am
Location: Pennsylvania, USA
Contact:

Tue Jun 24, 2003 9:58 am

That's what I would think.... However, I have a question about your line:

Code: Select all

echo '<meta type="keywords" content=" .$row['k_words']. '">'; 


If that builds a meta tag on the fly, then I'm thinking a spider wouldn't actually see it since it is PHP code rather than a meta tag... It would appear to be a meta tag once the file were run... but does a spider run a file before it spiders it... I had thought it just spiders what's in place... :?:
Philip Williams
Image

pootergeist
New php-forum User
New php-forum User
Posts: 191
Joined: Wed Jan 29, 2003 7:11 am
Location: UK
Contact:

Tue Jun 24, 2003 11:35 am

if a spider could just scamper across and read uninterpreted php as php code the language would be dead - everyone would just write spiders to grab everyone elses codes/passwords/tricks.

any http 1.1 request for a .php file (whether from a browser, a spider, a wap phone, a fax machine or indeed another php script) tells Apache to process the php file through the php interpreter and then output whatever code is output (generally html)
avatar image based upon nasas apod (only updates if I post though)

eyewoo
New php-forum User
New php-forum User
Posts: 71
Joined: Sun Mar 09, 2003 10:29 am
Location: Pennsylvania, USA
Contact:

Tue Jun 24, 2003 12:05 pm

OK... That is very good to know... and helps my understanding quite a bit!!! Thanks...
Philip Williams
Image

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests