+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 10 of 15

Thread: Include wont work

  1. Join Date
    Sep 2005
    Posts
    1

    Include wont work

    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..?

  2. Join Date
    Aug 2004
    Posts
    781

    Include wont work

    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.

  3. Re: Include wont work

    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."

  4. Join Date
    Aug 2004
    Posts
    781

    Re: Include wont work

    If you have header / footer files that you are using to display your site, such as:

    PHP Code:
    <?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:
    PHP Code:
    <? 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.

  5. Re: Include wont work

    Awesome! Thanks!

    Hopefully I will get to try it all out tonight.

  6. Re: Include wont work

    Quote Originally Posted by Patiek

    If you have header / footer files that you are using to display your site, such as:
    Code:
    PHP Code:
    <?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:
    PHP Code:
    <? include("/absolute/path/to/whois/whois.php"); ?>
    This part worked just fine. Page looked good.

    Quote Originally Posted by Patiek

    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.



  7. Join Date
    Aug 2004
    Posts
    781

    Re: Include wont work

    That is nice and all... but without a URL I have no idea where your problem is.

  8. Re: Include wont work

    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.

  9. Join Date
    Aug 2004
    Posts
    781

    Re: Include wont work

    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.

  10. Re: Include wont work

    Oops! told you ... PHP noob ... lesson learned I will modify as stated and give it a go. Thanks for your help!!

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts