View Full Version : Include wont work
Ridge
09-18-2005, 03:44 AM
Hi!
Thankīs for a good script, i have been using the very old version and playing with the new version now, but i canīt get my included menu and other included files to work, admin panel shows "Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /biz/XXXX.XXX/html/whois/config/template.php on line 145" when i try to include Pblang get latest messages. Other included files dont give error but they dont show on webpage..
What can i do..?
Patrick
09-24-2005, 09:28 PM
The solution here is to simply include the whois script rather than having the whois script include your webpage.
In other words, setup a page that includes your own header / menus, the whois script, and your footer. You can modify the whois script's search form to use the new page in the action url rather than whois.php.
ahaynes106
12-08-2005, 08:11 AM
I pretty much have the same problem. Whois worked great until I converted m ysite in an effort to make use of headers and footers with PHP. Script still works, but as above, the include for the header and footer in the templates do not. So, if I make make my own PHP page, what's the best way to include the whois script? I know....NOOB...I keep wanting to try new stuff, before mastering the old :)
Patiek - I guess this is where your statement from another topic in this forum applies...
" My best suggestion would be to copy the html of the form from whois.php into your page and work off of that."
Patrick
12-08-2005, 02:49 PM
If you have header / footer files that you are using to display your site, such as:
<?php include("/some/path/to/header.php"); ?>
CONTENT HERE
<? include("/some/path/to/footer.php"); ?>
Then you simply need to put another include for the whois script where CONTENT HERE is, such as:
<? include("/absolute/path/to/whois/whois.php"); ?>
And you need to save the new php page (that has the header.php, whois.php, and footer.php include statements as some filename, for example "domainwhois.php".
Then you will need to go into admin panel of EP-Dev Whois script and modify all the templates that have a reference to whois.php to instead reference "domainwhois.php".
Don't forget to also change the "Script URL" setting on "Script Settings" page to reflect the URL to your domainwhois.php folder instead of the whois/ folder.
Lastly, some bad error handling causes the script to stop PHP execution on error. So an invalid domain will cause the page to stop where the error occured (usually meaning that your footer.php file won't get displayed. I explained how to fix this in another thread ( http://www.dev-forums.com/index.php/topic,231.0.html ) and will have fixed the bug in the next version.
ahaynes106
12-08-2005, 03:38 PM
Awesome! Thanks! :)
Hopefully I will get to try it all out tonight.
ahaynes106
12-10-2005, 10:55 AM
If you have header / footer files that you are using to display your site, such as:
<?php include("/some/path/to/header.php"); ?>
CONTENT HERE
<? include("/some/path/to/footer.php"); ?>
Then you simply need to put another include for the whois script where CONTENT HERE is, such as:
<? include("/absolute/path/to/whois/whois.php"); ?>
This part worked just fine. Page looked good.
Then you will need to go into admin panel of EP-Dev Whois script and modify all the templates that have a reference to whois.php to instead reference "domainwhois.php".
Don't forget to also change the "Script URL" setting on "Script Settings" page to reflect the URL to your domainwhois.php folder instead of the whois/ folder.
Couldn't get this working right. Either got script error message or just kept returning to searchbar without displaying any results depending on how I modified the script and template settings.
:(
Patrick
12-10-2005, 12:34 PM
That is nice and all... but without a URL I have no idea where your problem is.
ahaynes106
12-10-2005, 10:26 PM
LOL...yea, that's cause I took the changes back out until I had more time. Family Christmas stuff going on and all.
anyway. The whois script was installed at my domain www.web-page-development.com/whois/whois.php
I created www.web-page-development.com/domainwhois.php with the page content include...
<? include("http://web-page-development.com/whois/whois.php"); ?>
between my header and footer include. This page displayed just right, but would not display results when used. If I changed the whois script site url from
www.web-page-development.com/whois/
to
www.web-page-development.com/
and changed the whois templates to reflect action="www.web-page-development.com/domainwhois.php"
I would get script errors in domainwhois.php
as soon as I post this I will set whois config back to what I have stated above if u want to check it out.
Patrick
12-11-2005, 12:06 PM
You are including the page incorrectly.
As I first stated, the include needs to be in the form of /absolute/path/to/whois/whois.php . What you are doing is including based on URL, which should pretty much NEVER be done for any include if you are including something on your own site.
By including "http://www...." you are actually calling the page and including the content of the page rather than including the PHP code. This is why your page does not work. You must include it with your absolute path instead. If you have any other includes using "http://www....." on your site, also change those, as they should be absolute path as well and you are simply putting needless stress on your server.
ahaynes106
12-11-2005, 08:13 PM
Oops! told you ... PHP noob ... lesson learned :) I will modify as stated and give it a go. Thanks for your help!!
ahaynes106
12-11-2005, 08:36 PM
A whole lot better! Just one issue...when you check an unavailable domain and click on the link "View Whois Report" I get 404 Error
example when I check sunsetgrowers.com and click on "View Whois Report", this address is invalid...
http://www.web-page-development.com/whois.php?page=WhoisReport&domain=sunsetgrowers&ext=com&PHPSESSID=0673a5df8bdecf0127eb2cb7c0e8546d
but if I manually modify it to be...
http://www.web-page-development.com/domainwhois.php?page=WhoisReport&domain=sunsetgrowers&ext=com&PHPSESSID=0673a5df8bdecf0127eb2cb7c0e8546d
it works. I assume I need to modify this portion of the "Unavailable Domains" template...
<a href='[[whois-reporturl]]'>View Whois Report</a>
but not sure of the best way to do it.
Patrick
12-11-2005, 09:20 PM
Yeah, you will have to modify that manually using [[domain]] and [[ext]] values.
Based on the example you gave, you need to modify the following in unavailable:
[[whois-reporturl]]
To instead look like:
/domainwhois.php?page=WhoisReport&domain=[[domain]]ext=[[ext]]
ahaynes106
12-11-2005, 09:43 PM
right again ... just had to add an & in the code you gave me [[domain]]&ext
... and it worked great. Great support in addition to a great script! Thanks!!
Patrick
12-11-2005, 10:26 PM
Yeah, that is because originally I had proper HTML code with & instead of just &, but I thought that may be confusing either to you or to others who may view the thread in the future. When I took out the proper HTML, I accidentally removed the second '&'.
ahaynes106
12-12-2005, 08:07 AM
I tried it with
[[domain]]&ext first, but it didn't work for some reason; so I just used &. Thanks again.
Powered by vBulletin™ Version 4.0.0 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.