Forum Moderators: coopster
I have a php search engine script, it works fine and gets results from a mysql database.
I was displaying the results in my html pages by way of server side parsing using php include. For some unknown reason after one year of faultless operation (I did not alter anything) it began to parse my results incorrectly. It would parse the wrong id number for data entries. For example it should have displayed id=3456, instead displayed id=17500 which did not exist.
I gave up trying to solve this problem and used an iframe to display the php search results. But I have been advised that many visitors could have disabled the display of iframes (iframes are being used to inject malware into visitors computers so more and more they will be blocked) into the browser.
Is there any other option to get my php script results to display in my html pages?, could I use javascript to display the results of my php script?
I have not been able to understand why this error occurs.
At the moment I use this iframe code which works perfectly,
<iframe
src ="http://www.mysite.co.uk/t/search.php?q=sony&Submit=Search"
width="700" height="1500" scrolling="no"></iframe>
----------------------------------------------------------------------------------
Beforehand I was using this system without error for two years.
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite\.co.uk$ [NC]
RewriteRule ^(.*)$ [mysite.co.uk...] [R=301,L]
AddType application/x-httpd-php .htm .html
Addhandler application/x-httpd-php .html .php
Then this code within my pages,
<?php include('http://www.mysite.co.uk/t/search.php?q=sony&Submit=Search');?>
No problem.
But suddenly without any alteration to anything my end, the above php include throwed up this error,
Warning: main([mysite.co.uk ] ) [function.main]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/mysite/public_html/2.html on line 30Warning: main([mysite.co.uk ] ) [function.main]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/mysite/public_html/2.html on line 30
Warning: main() [function.include]: Failed opening 'http://www.mysite.co.uk/t/search.php?q=sony&Submit=Search ' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mysite/public_html/2.html on line 30
But if I create a php include such as,
<?php include('http://www.mysite.co.uk/index.html');?>
It runs fine.
I can create a new html file like '3.html' and insert it into a php include and then the above error occurs. My server seems to like some urls and not others. And I cannot understand why.
No doubt it's something simple I've missed.