homepage Welcome to WebmasterWorld Guest from 23.23.57.144
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
PHP and Google indexing
How does Google handle php code
claudiasmt

10+ Year Member



 
Msg#: 423 posted 3:05 pm on May 30, 2002 (gmt 0)

Currently my site uses php code to include common file information and to set session variables and to update and access database information.

Can someone explain how the search engines will handle the following?

1 - When I use an "include" statement in my file (the file is named index.php3) -- what does the search engine actually read? Just the code that displays in the View Source page at the browser -- or all the php code from the include file and other php code in the file? Since the php code does not display in the browsers View Source -- I was thinking the search engine does not read this code -- but only the code I am actually seeing in the View Source page?? I am trying to determine how much code the search engine is actually reading through before seeing my key terms on the page.

2 - Is it OK to use a php variable in a <a href>link</a> tag? For example can I use <a href="http://www.somedomain.com/dir<?php$Enviroment?>/junk"> as an affective link that Google will spider correctly? Or do I need to use a static link without the php variable?

3 - What are your thoughts on the rankings a search engine gives to a file with a php extension compared to files with a html extension? I am referring to static php files -- not a page created on the fly.

Thanks!

 

Nick_W

WebmasterWorld Senior Member nick_w us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 423 posted 3:41 pm on May 30, 2002 (gmt 0)

Hi

Most of those questions can be answered by telling you this:

PHP is a server-side scripting environment. The browser, the user (and that includes search engines) will never see one line of your php code.

Whatever your PHP code outputs to the browser will be seen though.

The only thing to avoid is urls like: mysite.com/?id=34&nw=tytyty

because currently only INK and Google will index those pages.

There is no difference in .php or .html as far as I'm aware with regard to ranking.

Hope that helps!

Nick

Lisa

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 423 posted 3:42 pm on May 30, 2002 (gmt 0)

1) Search Engines only see the HTML source you see when you do a view source in your browser.

2) Yes, you can place PHP tags anywhere. <? echo $I; ?>

3) Search engines do not care what extension you use. For that matter PHP doesn't care what extension you use either. You may tell PHP to parse HTML files as well.

ergophobe

WebmasterWorld Administrator ergophobe us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 423 posted 5:23 pm on May 30, 2002 (gmt 0)

[quote]
You may tell PHP to parse HTML files as well.
[quote]

Not to be too picky, but you can't tell PHP to parse HTML - you tell Apache or whatever server you use to send files ending with .html (or whatever) to the PHP parser. These configurations are set in httpd.conf (in Apache) and not in php.ini.

Tom

Nick_W

WebmasterWorld Senior Member nick_w us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 423 posted 5:26 pm on May 30, 2002 (gmt 0)

You forgot the 'na na na na na na!' Tom

;)

claudiasmt

10+ Year Member



 
Msg#: 423 posted 5:36 pm on May 30, 2002 (gmt 0)

Thanks for the help!

ergophobe

WebmasterWorld Administrator ergophobe us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 423 posted 7:50 pm on May 30, 2002 (gmt 0)

na na na na na! :)

Lisa

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 423 posted 1:04 am on May 31, 2002 (gmt 0)

Not to be too picky

A DOC file is something.doc So when I say HTML files I mean something.HTML, I did not say HTML formatted files. I think everyone understood. So you DID mean to be picky. ;)

na na na na na!

ergophobe

WebmasterWorld Administrator ergophobe us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 423 posted 7:33 pm on May 31, 2002 (gmt 0)


So you DID mean to be picky.

Okay, mea culpa, mea culpa, mea maxima culpa....


A DOC file is something.doc So when I say HTML files I mean something.HTML, I did not say HTML formatted files.

That wasn't my point at all. What I was trying to say is that if the original poster was trying to set this up, he would tell his APACHE not PHP to parse the file as PHP. I was trying to avoid confusion (talk about ironic :) ) by pointing out that he would have to modify httpd.conf (i.e. tell Apache) and not php.ini (i.e. tell PHP).

Oh well.... I'm on vacation for two weeks with computer access, so you won't have me to kick around... ou wait that was Nixon... I mean, you won't have me to put up with for while (sorry to foreigners and those too young to remember the reference).

Tom

Tom

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved