Can a spider start a php process?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
SmokyBarnable
Forum Contributor
Posts: 105
Joined: Wed Nov 01, 2006 5:44 pm

Can a spider start a php process?

Post by SmokyBarnable »

I have a php page the does an api call when the page is loaded. I am wondering if a search engine spider could also trigger the api call?

Thanks.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Depends on how accessible the page is. Generally the answer is yes.
User avatar
SmokyBarnable
Forum Contributor
Posts: 105
Joined: Wed Nov 01, 2006 5:44 pm

Post by SmokyBarnable »

Wouldn't the spider just read the html and ignore the php? That is, aren't php functions and includes invisible to spiders?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Browsers, just like spiders, don't see the PHP code if it's processed by the server. ... So yes, they are invisible to the spider, just as they are to the browser; however, no they will not be ignored without code in the PHP to not run it when a spider is requesting the page.
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

php gets executed on the server, so by the time the spider sees the content of the page, php has already done it's job...
User avatar
SmokyBarnable
Forum Contributor
Posts: 105
Joined: Wed Nov 01, 2006 5:44 pm

Post by SmokyBarnable »

I'm confused so to clarify my question:

Code: Select all

<?php
require('includes/application_top.php');
require_once 'admin/functions/helpers.php';  
dosomething();
?>
<head>
<title>Title</title>
<meta name="robots" content="noindex,nofollow" />
</head>
So my question is does the spider see and execute the dosomething() function?

Thanks.
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post by dude81 »

No , Spider(If it is a browser) doesn't do it. It is to be done at your server which you are calling in the address bar.
i.e.

Code: Select all

http://yourserver.com/pageyouraccessing.php
I would like to know did you save the file as .php extension. or .html extension. Does your server has php installed??
User avatar
SmokyBarnable
Forum Contributor
Posts: 105
Joined: Wed Nov 01, 2006 5:44 pm

Post by SmokyBarnable »

Yes it is a php page. I just wanted to make certain that only humans could make my php function create an api call on page load and not spiders.
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post by dude81 »

:D , For spider to execute your Api functions you need to write a javascript function.
Post Reply