I want to use php to execute javascript and display the final results to the browser screen.
The objective is to remove the javascript from the source code so that search engine spiders will see the same text that the browser displays.
If you view-source on this page, you will only see the javascript. This is what the spiders see. I want the spiders to see the results displayed in the browser.
Thanks,
Mike
PHP code follows (sorry, tgml corrupted by in code):
<?php
echo'<html>
<script language="javascript" >
var aqparams = new Array();
var aqThisUri = document.location.href;
function aqExtractQueryParams(qs)
{
var d = 1;
idx = qs.indexOf(\'?\');
if (idx != -1)
{
aqThisUri = qs.substring(0, idx);
query = qs.slice(idx+1);
query = query.replace(/%26/gi, "&"
;
defs = query.split(\'&\');
prefix = "?";
for (i=0;i<defs.length;i++)
{
if (defs != ""
{
d = defs.split(\'=\');
aqparams[d[0]] = d[1];
if(d[0] != "aqPage"
{
aqThisUri = aqThisUri + prefix + d[0] + "=" + d[1];
prefix = "&";
}
}
}
}
}
aqExtractQueryParams(document.location.href);
function aqGetParam(s)
{
return aqparams;
}
var aqPageIndex = aqGetParam("aqpage"
;
if (aqPageIndex == null || aqPageIndex == "undefined"
{
aqPageIndex = 1;
}
aqPageIndex = parseInt(aqPageIndex);
if (isNaN(aqPageIndex))
{
aqPageIndex = 1;
}
if (aqPageIndex < 0)
{
aqPageIndex = 1;
}
jobs = new Array ();
document.write("<scr" + "ipt language=\'javascript\' src=\' + aqPageIndex + "&cat=Healthcare,+Practitioner+and+Technician&state=AR\'></scr" + "ipt>"
;
</script>
<link rel=stylesheet type=text/css href="<body bgcolor="#ffffFF" class=background topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
<table width=520 border=0 cellpadding=0 cellspacing=0>
<tr>
<td> <img src=" width=15 height=40></td>
<td> <img src=" </tr></table><ul>
<font class=header2>Healthcare Jobs</font> <font class=main>
<a href=" target="_top">Return to Search Page</a>
</font>
<table cellpadding=5 cellspacing=3 border=0><script language="javascript" >
if (jobs != null && jobs.length > 0) {
for (i = 0; i < jobs.length; i++) {
document.write("<tr><td>"
;
document.write("<TABLE style=\'border-color: white; border-style: solid; border-width: 0px;\' "
;
document.write("WIDTH=\'600\'"
;
document.write("BGCOLOR=\'white\' "
;
document.write("CELLSPACING=0 CELLPADDING=0>"
;
document.write("<tr><td width=\'100%\'>"
;
heading = jobs.heading;
if (jobs.heading.length > 128)
heading = jobs.heading.substring(0, 128) + " ...";
document.write("<a href=\'" + jobs.url + "\'>"
;
document.write("<font face=\'Verdana,Trebuchet,sans-serif\' color=\'000099\' size=\'2\'><b>" + heading + "</b></font></a><br>"
;
desc = jobs.text;
if (jobs.text.length > 510)
desc = jobs.text.substring(0, 510) + " ...";
document.write("<font face=\'Arial,sans-serif\' size=\'2\'> " + desc + "</font><br>"
;
if(jobs.location.length > 0) {
document.write("<font face=\'Verdana,Trebuchet,sans-serif\' size=\'2\'>"
;
document.write("Location: " + jobs.location + "</font><br>"
;
}
document.write("</td></tr>"
;
document.write("</table>"
;
document.write("</td></tr>"
;
}
if(aqPaginator != null) {
var aqRootUrl = aqThisUri;
if(aqRootUrl.indexOf(\'?\') == -1) {
aqRootUrl = aqRootUrl + "?";
}
else {
aqRootUrl = aqRootUrl + "&";
}
document.write("<tr><td align=left>"
;
if(aqPaginator["HasPrev"] > 0 && aqPageIndex > 1) {
newPage = aqPageIndex - 1;
document.write("<a href=\"" + aqRootUrl + "aqPage=" + newPage + "\">Prev</a>"
;
}
else {
document.write(" "
;
}
if(aqPaginator["HasNext"] > 0) {
if(aqPaginator["HasPrev"] > 0 && aqPageIndex > 1) {
document.write(" | "
;
}
newPage = aqPageIndex + 1;
document.write("<a href=\"" + aqRootUrl + "aqPage=" + newPage + "\">Next</a>"
;
}
if(aqPaginator["HasNext"] > 0 || aqPaginator["HasPrev"] > 0) {
document.write(" | "
;
}
document.write("<a href=\' + aqPageIndex + "&cat=Healthcare,+Practitioner+and+Technician&state=AR \'>More Results (" + aqNumJobs + " jobs)</a>"
;
document.write("</td></tr>"
;
}
}
</script>
<tr><td width=\'100%\'><b><font size=\'-3\'><font color=\'#A0A0A0\'>Powered by</font> <a href=\' color=\'#000000\'>Access</font><font color=\'#d88f1e\'>Query</font></a></font></b></td></tr></table>
</html>
';
The objective is to remove the javascript from the source code so that search engine spiders will see the same text that the browser displays.
If you view-source on this page, you will only see the javascript. This is what the spiders see. I want the spiders to see the results displayed in the browser.
Thanks,
Mike
PHP code follows (sorry, tgml corrupted by
<?php
echo'<html>
<script language="javascript" >
var aqparams = new Array();
var aqThisUri = document.location.href;
function aqExtractQueryParams(qs)
{
var d = 1;
idx = qs.indexOf(\'?\');
if (idx != -1)
{
aqThisUri = qs.substring(0, idx);
query = qs.slice(idx+1);
query = query.replace(/%26/gi, "&"
defs = query.split(\'&\');
prefix = "?";
for (i=0;i<defs.length;i++)
{
if (defs != ""
{
d = defs.split(\'=\');
aqparams[d[0]] = d[1];
if(d[0] != "aqPage"
{
aqThisUri = aqThisUri + prefix + d[0] + "=" + d[1];
prefix = "&";
}
}
}
}
}
aqExtractQueryParams(document.location.href);
function aqGetParam(s)
{
return aqparams
}
var aqPageIndex = aqGetParam("aqpage"
if (aqPageIndex == null || aqPageIndex == "undefined"
{
aqPageIndex = 1;
}
aqPageIndex = parseInt(aqPageIndex);
if (isNaN(aqPageIndex))
{
aqPageIndex = 1;
}
if (aqPageIndex < 0)
{
aqPageIndex = 1;
}
jobs = new Array ();
document.write("<scr" + "ipt language=\'javascript\' src=\' + aqPageIndex + "&cat=Healthcare,+Practitioner+and+Technician&state=AR\'></scr" + "ipt>"
</script>
<link rel=stylesheet type=text/css href="<body bgcolor="#ffffFF" class=background topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
<table width=520 border=0 cellpadding=0 cellspacing=0>
<tr>
<td> <img src=" width=15 height=40></td>
<td> <img src=" </tr></table><ul>
<font class=header2>Healthcare Jobs</font> <font class=main>
<a href=" target="_top">Return to Search Page</a>
</font>
<table cellpadding=5 cellspacing=3 border=0><script language="javascript" >
if (jobs != null && jobs.length > 0) {
for (i = 0; i < jobs.length; i++) {
document.write("<tr><td>"
document.write("<TABLE style=\'border-color: white; border-style: solid; border-width: 0px;\' "
document.write("WIDTH=\'600\'"
document.write("BGCOLOR=\'white\' "
document.write("CELLSPACING=0 CELLPADDING=0>"
document.write("<tr><td width=\'100%\'>"
heading = jobs.heading;
if (jobs.heading.length > 128)
heading = jobs.heading.substring(0, 128) + " ...";
document.write("<a href=\'" + jobs.url + "\'>"
document.write("<font face=\'Verdana,Trebuchet,sans-serif\' color=\'000099\' size=\'2\'><b>" + heading + "</b></font></a><br>"
desc = jobs.text;
if (jobs.text.length > 510)
desc = jobs.text.substring(0, 510) + " ...";
document.write("<font face=\'Arial,sans-serif\' size=\'2\'> " + desc + "</font><br>"
if(jobs.location.length > 0) {
document.write("<font face=\'Verdana,Trebuchet,sans-serif\' size=\'2\'>"
document.write("Location: " + jobs.location + "</font><br>"
}
document.write("</td></tr>"
document.write("</table>"
document.write("</td></tr>"
}
if(aqPaginator != null) {
var aqRootUrl = aqThisUri;
if(aqRootUrl.indexOf(\'?\') == -1) {
aqRootUrl = aqRootUrl + "?";
}
else {
aqRootUrl = aqRootUrl + "&";
}
document.write("<tr><td align=left>"
if(aqPaginator["HasPrev"] > 0 && aqPageIndex > 1) {
newPage = aqPageIndex - 1;
document.write("<a href=\"" + aqRootUrl + "aqPage=" + newPage + "\">Prev</a>"
}
else {
document.write(" "
}
if(aqPaginator["HasNext"] > 0) {
if(aqPaginator["HasPrev"] > 0 && aqPageIndex > 1) {
document.write(" | "
}
newPage = aqPageIndex + 1;
document.write("<a href=\"" + aqRootUrl + "aqPage=" + newPage + "\">Next</a>"
}
if(aqPaginator["HasNext"] > 0 || aqPaginator["HasPrev"] > 0) {
document.write(" | "
}
document.write("<a href=\' + aqPageIndex + "&cat=Healthcare,+Practitioner+and+Technician&state=AR \'>More Results (" + aqNumJobs + " jobs)</a>"
document.write("</td></tr>"
}
}
</script>
<tr><td width=\'100%\'><b><font size=\'-3\'><font color=\'#A0A0A0\'>Powered by</font> <a href=\' color=\'#000000\'>Access</font><font color=\'#d88f1e\'>Query</font></a></font></b></td></tr></table>
</html>
';