PHP Question ...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lil2rich4u2
    ICQ: 175171926
    • Oct 2002
    • 11046

    #1

    PHP Question ...

    How else can i include a php file into my .shtml file?

    TTT Script tells me to use this:
    [!--#include file="ttt-in.php" --]
    which has worled for me on other servers, but this new server has a problem with that format.


    I tried:
    [!--#include file="http://www.domain.com/ttt-in.php" --]
    but that didnt work


    Any other ways?
    HEY!!

    Unbeatable hosting! Customer service is top notch!

    --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!
  • X37375787

    #2
    uhm, did you replace [ ] with < > ??

    Comment

    • Libertine
      sex dwarf
      • May 2002
      • 17860

      #3
      The [ should be a <, but I assume you know that.

      You need to have the relative server path to the file, not the url.
      Try this:
      [!--#include virtual="ttt-in.php" --]

      (replace the ] and [ with > and < ofcourse)
      /(bb|[^b]{2})/

      Comment

      • lil2rich4u2
        ICQ: 175171926
        • Oct 2002
        • 11046

        #4
        no why would i do that?


        lol j/k ofcourse i did




        btw nice sig, lol
        HEY!!

        Unbeatable hosting! Customer service is top notch!

        --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!

        Comment

        • X37375787

          #5

          Comment

          • lil2rich4u2
            ICQ: 175171926
            • Oct 2002
            • 11046

            #6
            Originally posted by punkworld
            The [ should be a <, but I assume you know that.

            You need to have the relative server path to the file, not the url.
            Try this:
            [!--#include virtual="ttt-in.php" --]

            (replace the ] and [ with > and < ofcourse)

            ok ill go try it, thanks for trying to help.

            Ill keep you posted.
            HEY!!

            Unbeatable hosting! Customer service is top notch!

            --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!

            Comment

            • X37375787

              #7
              You gotta have SSI enabled on your server in order for it to work. Ask your noc.

              Comment

              • Libertine
                sex dwarf
                • May 2002
                • 17860

                #8
                Btw, what error message do you get?
                /(bb|[^b]{2})/

                Comment

                • mrthumbs
                  salad tossing sig guy
                  • Apr 2002
                  • 11702

                  #9
                  php and ssi dont go along..

                  Just convert the page to php..no need for ssi
                  if php is enabled on the machine.

                  Comment

                  • Libertine
                    sex dwarf
                    • May 2002
                    • 17860

                    #10
                    Originally posted by mrthumbs
                    php and ssi dont go along..

                    Just convert the page to php..no need for ssi
                    if php is enabled on the machine.
                    /(bb|[^b]{2})/

                    Comment

                    • lil2rich4u2
                      ICQ: 175171926
                      • Oct 2002
                      • 11046

                      #11
                      Originally posted by punkworld
                      The [ should be a <, but I assume you know that.

                      You need to have the relative server path to the file, not the url.
                      Try this:
                      [!--#include virtual="ttt-in.php" --]

                      (replace the ] and [ with > and < ofcourse)

                      Ok nope didnt work, its still showing all hits as bookmarks.


                      Any other ideas?

                      BTW Im assuming that goes between the [head] [/head] tags?
                      HEY!!

                      Unbeatable hosting! Customer service is top notch!

                      --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!

                      Comment

                      • mrthumbs
                        salad tossing sig guy
                        • Apr 2002
                        • 11702

                        #12
                        you can, ofcourse, include a php files content with shtml but youll experience processing/execution difficulties by default.

                        Comment

                        • Libertine
                          sex dwarf
                          • May 2002
                          • 17860

                          #13
                          hit me up on icq, 85992840
                          /(bb|[^b]{2})/

                          Comment

                          • lil2rich4u2
                            ICQ: 175171926
                            • Oct 2002
                            • 11046

                            #14
                            Originally posted by mrthumbs
                            php and ssi dont go along..

                            Just convert the page to php..no need for ssi
                            if php is enabled on the machine.

                            ok i changed it to .php

                            same issues. It is counting all hits as bookmarkers even though i know the hit came from a referrer.


                            Any other ideas?
                            HEY!!

                            Unbeatable hosting! Customer service is top notch!

                            --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!

                            Comment

                            • lil2rich4u2
                              ICQ: 175171926
                              • Oct 2002
                              • 11046

                              #15
                              so nobody knows any other ways to include a php file?


                              there must be more than one way, lol
                              HEY!!

                              Unbeatable hosting! Customer service is top notch!

                              --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!

                              Comment

                              • lil2rich4u2
                                ICQ: 175171926
                                • Oct 2002
                                • 11046

                                #16
                                Ok this is what i have tried ...


                                with main page as a .shtml,
                                [!--#include file="ttt-in.php" --> (within the head> tags)
                                [!--#include file="ttt-in.php" --> (outside the head> tags)
                                [!--#include file="http://www.totaltwat.com/ttt-in.php" --> (within the head> tags)
                                [!--#include file="http://www.totaltwat.com/ttt-in.php" --> (outside the head> tags)
                                [!--#include virtual="ttt-in.php" --> (within the head> tags)
                                [!--#include virtual="ttt-in.php" --> (outside the head> tags)

                                with main page as a .php,
                                [?php include("ttt-in.php"); ?> (outside head> tags)
                                [? require("wb_pgm.inc"); ?> (outside head> tags)
                                [!--#include file="ttt-in.php" --> (within the head> tags)
                                [!--#include file="ttt-in.php" --> (outside the head> tags)
                                [!--#include file="http://www.totaltwat.com/ttt-in.php" --> (within the head> tags)
                                [!--#include file="http://www.totaltwat.com/ttt-in.php" --> (outside the head> tags)
                                HEY!!

                                Unbeatable hosting! Customer service is top notch!

                                --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!

                                Comment

                                • buran
                                  Confirmed User
                                  • Mar 2002
                                  • 264

                                  #17
                                  Unless you're running Apache2, you cannot process a file through more than one module (SSI, or PHP). The solution then is this:


                                  &lt;?php
                                  require_once("/path/to/file.php");
                                  ?>

                                  alternatively, you can configure to look at a list of paths to find files, called the include_path. If your file is in one of those directories, you can include it as just

                                  require_once("filename.php");

                                  Recommend you trying running a page with just this command to see how your PHP is configured:

                                  &lt;?php
                                  phpinfo();
                                  ?>

                                  (had to change &lt; to & lt ; in order for it to render in phpBB)
                                  [this signature intentionally left blank]

                                  Comment

                                  • lil2rich4u2
                                    ICQ: 175171926
                                    • Oct 2002
                                    • 11046

                                    #18
                                    Originally posted by buran
                                    Recommend you trying running a page with just this command to see how your PHP is configured:

                                    &lt;?php
                                    phpinfo();
                                    ?>

                                    here is the result:
                                    http://totaltwat.com/test.php


                                    here is my page with the !--#include:
                                    http://totaltwat.com/index.shtml

                                    here is my page with .php extension:
                                    http://totaltwat.com/index.shtml



                                    nothing is working. All the hits still register as bookmarkers meaning the cookie is not working (the php include)
                                    HEY!!

                                    Unbeatable hosting! Customer service is top notch!

                                    --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!

                                    Comment

                                    • Libertine
                                      sex dwarf
                                      • May 2002
                                      • 17860

                                      #19
                                      Edit your post <i>now</i>. You do <b>not</b> want to give out the details of phpinfo() to a bunch of strangers.

                                      The problem lies in the fact that you use revsharehosting, I am 99% certain of that. Try to find some people who have dealt with that problem before. (ie the problem of the trade script not recognizing referers)

                                      Also, the problem most likely isn't the cookie, since that is used for counting productivity, not hits.
                                      /(bb|[^b]{2})/

                                      Comment

                                      • lil2rich4u2
                                        ICQ: 175171926
                                        • Oct 2002
                                        • 11046

                                        #20
                                        Originally posted by punkworld
                                        Edit your post <i>now</i>. You do <b>not</b> want to give out the details of phpinfo() to a bunch of strangers.

                                        The problem lies in the fact that you use revsharehosting, I am 99% certain of that. Try to find some people who have dealt with that problem before. (ie the problem of the trade script not recognizing referers)

                                        Also, the problem most likely isn't the cookie, since that is used for counting productivity, not hits.

                                        omg, lol

                                        ok i deleted the file, rofl
                                        HEY!!

                                        Unbeatable hosting! Customer service is top notch!

                                        --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!

                                        Comment

                                        • lil2rich4u2
                                          ICQ: 175171926
                                          • Oct 2002
                                          • 11046

                                          #21
                                          Originally posted by punkworld
                                          The problem lies in the fact that you use revsharehosting, I am 99% certain of that. Try to find some people who have dealt with that problem before. (ie the problem of the trade script not recognizing referers)

                                          yes that is the problem, im trying to find a way to get it working. Ive tried on rev's board, and on chicken board, figured id try here also.
                                          HEY!!

                                          Unbeatable hosting! Customer service is top notch!

                                          --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!

                                          Comment

                                          • rowan
                                            Too lazy to set a custom title
                                            • Mar 2002
                                            • 17393

                                            #22
                                            This is just a hunch, but try this...

                                            &lt;?php
                                            echo $_COOKIE["ttt_cookie"];
                                            ?&gt;

                                            This will show if your PHP scripts are seeing the TTT cookie.

                                            Comment

                                            • Libertine
                                              sex dwarf
                                              • May 2002
                                              • 17860

                                              #23
                                              Instead of including the ttt-in.php, try including a php script containing the following:

                                              PHP Code:
                                              <?php
                                              $towrite = $_SERVER["HTTP_REFERER"] . "\n";
                                              $handle = fopen("refs.txt", "a");
                                              flock($handle, 2);
                                              fputs($handle, $towrite);
                                              flock($handle, 3);
                                              fclose($handle);
                                              ?>
                                              Make a blank file called refs.txt, upload it to your server and chmod it 777. After a few dozen hits, check out what's in it. The referers as seen by the server will be in it, if they are in order, the trade script is at fault.
                                              /(bb|[^b]{2})/

                                              Comment

                                              • lil2rich4u2
                                                ICQ: 175171926
                                                • Oct 2002
                                                • 11046

                                                #24
                                                Originally posted by rowan
                                                This is just a hunch, but try this...

                                                &lt;?php
                                                echo $_COOKIE["ttt_cookie"];
                                                ?&gt;

                                                This will show if your PHP scripts are seeing the TTT cookie.

                                                Ok i did it and it echoed some numbers, i guess the name of the cookie?

                                                http://www.totaltwat.com/test.php
                                                HEY!!

                                                Unbeatable hosting! Customer service is top notch!

                                                --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!

                                                Comment

                                                • lil2rich4u2
                                                  ICQ: 175171926
                                                  • Oct 2002
                                                  • 11046

                                                  #25
                                                  Originally posted by punkworld
                                                  Instead of including the ttt-in.php, try including a php script containing the following:

                                                  PHP Code:
                                                  <?php
                                                  $towrite = $_SERVER["HTTP_REFERER"] . "\n";
                                                  $handle = fopen("refs.txt", "a");
                                                  flock($handle, 2);
                                                  fputs($handle, $towrite);
                                                  flock($handle, 3);
                                                  fclose($handle);
                                                  ?>
                                                  Make a blank file called refs.txt, upload it to your server and chmod it 777. After a few dozen hits, check out what's in it. The referers as seen by the server will be in it, if they are in order, the trade script is at fault.

                                                  ok gimme a sec
                                                  HEY!!

                                                  Unbeatable hosting! Customer service is top notch!

                                                  --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!

                                                  Comment

                                                  • lil2rich4u2
                                                    ICQ: 175171926
                                                    • Oct 2002
                                                    • 11046

                                                    #26
                                                    Originally posted by lil2rich4u2



                                                    ok gimme a sec

                                                    ok you guys click this so i can see if its logging ref's

                                                    http://totaltwat.com/test2.php
                                                    HEY!!

                                                    Unbeatable hosting! Customer service is top notch!

                                                    --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!

                                                    Comment

                                                    • lil2rich4u2
                                                      ICQ: 175171926
                                                      • Oct 2002
                                                      • 11046

                                                      #27
                                                      ok its logging ref's

                                                      http://totaltwat.com/refs.txt


                                                      what does that mean again?
                                                      HEY!!

                                                      Unbeatable hosting! Customer service is top notch!

                                                      --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!

                                                      Comment

                                                      • Libertine
                                                        sex dwarf
                                                        • May 2002
                                                        • 17860

                                                        #28
                                                        It's logging refs alright.

                                                        http://totaltwat.com/refs.txt
                                                        /(bb|[^b]{2})/

                                                        Comment

                                                        • Libertine
                                                          sex dwarf
                                                          • May 2002
                                                          • 17860

                                                          #29
                                                          Originally posted by lil2rich4u2
                                                          ok its logging ref's

                                                          http://totaltwat.com/refs.txt


                                                          what does that mean again?
                                                          That means that something is going wrong in the trade script. You see, this tiny piece of code could (with a whole lot of work) be transformed into a trade script, and that trade script *would* be working on your server.
                                                          /(bb|[^b]{2})/

                                                          Comment

                                                          • lil2rich4u2
                                                            ICQ: 175171926
                                                            • Oct 2002
                                                            • 11046

                                                            #30
                                                            Originally posted by punkworld
                                                            It's logging refs alright.

                                                            http://totaltwat.com/refs.txt

                                                            why do they keep disapering?

                                                            and what does that accomplish?
                                                            HEY!!

                                                            Unbeatable hosting! Customer service is top notch!

                                                            --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!

                                                            Comment

                                                            • lil2rich4u2
                                                              ICQ: 175171926
                                                              • Oct 2002
                                                              • 11046

                                                              #31
                                                              Originally posted by punkworld
                                                              That means that something is going wrong in the trade script. You see, this tiny piece of code could (with a whole lot of work) be transformed into a trade script, and that trade script *would* be working on your server.


                                                              but i use this script on a few other sites and never had problem, and a zillion other people use it too .... only problem is on revshare
                                                              HEY!!

                                                              Unbeatable hosting! Customer service is top notch!

                                                              --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!

                                                              Comment

                                                              • Libertine
                                                                sex dwarf
                                                                • May 2002
                                                                • 17860

                                                                #32
                                                                btw, you can delete the test2.php and refs.txt from your server now.
                                                                /(bb|[^b]{2})/

                                                                Comment

                                                                • Libertine
                                                                  sex dwarf
                                                                  • May 2002
                                                                  • 17860

                                                                  #33
                                                                  Originally posted by lil2rich4u2




                                                                  but i use this script on a few other sites and never had problem, and a zillion other people use it too .... only problem is on revshare
                                                                  You said it... the problem is on revshare, in combination with your script.

                                                                  How many trades do you have in your script?
                                                                  /(bb|[^b]{2})/

                                                                  Comment

                                                                  • lil2rich4u2
                                                                    ICQ: 175171926
                                                                    • Oct 2002
                                                                    • 11046

                                                                    #34
                                                                    Originally posted by punkworld


                                                                    You said it... the problem is on revshare, in combination with your script.

                                                                    How many trades do you have in your script?

                                                                    yes i know the problem is in revshare, lol ... i was hoping to find a way to call the php that will work with the bug within revshare.


                                                                    I have 4 trades in my script.
                                                                    HEY!!

                                                                    Unbeatable hosting! Customer service is top notch!

                                                                    --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!

                                                                    Comment

                                                                    • Libertine
                                                                      sex dwarf
                                                                      • May 2002
                                                                      • 17860

                                                                      #35
                                                                      Your problem:

                                                                      http://chickenboard.com/read.php?f=13&i=1097&t=1097
                                                                      /(bb|[^b]{2})/

                                                                      Comment

                                                                      • Libertine
                                                                        sex dwarf
                                                                        • May 2002
                                                                        • 17860

                                                                        #36
                                                                        That means the problem is with revsharehosting, and so far nobody has been able to figure out what it is yet.
                                                                        /(bb|[^b]{2})/

                                                                        Comment

                                                                        • lil2rich4u2
                                                                          ICQ: 175171926
                                                                          • Oct 2002
                                                                          • 11046

                                                                          #37
                                                                          Originally posted by punkworld
                                                                          Your problem:

                                                                          http://chickenboard.com/read.php?f=13&i=1097&t=1097
                                                                          yes ive been there, as well as several other threads on this same exact problem. Cant seem to find a resolve though.

                                                                          I have contacted server admin and he is "looking into it", just figured someone here might help me find a resolve.
                                                                          HEY!!

                                                                          Unbeatable hosting! Customer service is top notch!

                                                                          --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!

                                                                          Comment

                                                                          • lil2rich4u2
                                                                            ICQ: 175171926
                                                                            • Oct 2002
                                                                            • 11046

                                                                            #38
                                                                            this is an exact copy of an email the admin wrote me ...


                                                                            i was just looking through the board of turbotraffictrader.com and it seems there's a lot of issues regarding the hit counter... please refer to the

                                                                            http://www.chickenboard.com/read.php?f=13&i=1276&t=1276

                                                                            this guy is talking about the full server path which i think this is the only issue...
                                                                            we are currently using PHP 4.2.3 which it is compatible with their script.

                                                                            alot of people are having problem with this hits and this is the key issue is the server path...please let me know what paths you have setup for the script?




                                                                            Now what exactly is a server path and how do i change it?
                                                                            HEY!!

                                                                            Unbeatable hosting! Customer service is top notch!

                                                                            --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!

                                                                            Comment

                                                                            • Libertine
                                                                              sex dwarf
                                                                              • May 2002
                                                                              • 17860

                                                                              #39
                                                                              Originally posted by lil2rich4u2

                                                                              Now what exactly is a server path and how do i change it?
                                                                              Server path = path on the server to your files.
                                                                              You can either use absolute paths, for instance:

                                                                              /var/www/html/in.php
                                                                              /blegh/blagh/www/httpdocs/cj/in.php

                                                                              or relative paths, for instance:

                                                                              in.php
                                                                              cj/in.php
                                                                              /(bb|[^b]{2})/

                                                                              Comment

                                                                              • Libertine
                                                                                sex dwarf
                                                                                • May 2002
                                                                                • 17860

                                                                                #40
                                                                                Now, the question is what paths are used in the script.

                                                                                For instance, it could be that
                                                                                $_SERVER['DOCUMENT_ROOT']
                                                                                is used as the path to the scripts, which on certain servers may give problems.
                                                                                /(bb|[^b]{2})/

                                                                                Comment

                                                                                • lil2rich4u2
                                                                                  ICQ: 175171926
                                                                                  • Oct 2002
                                                                                  • 11046

                                                                                  #41
                                                                                  Originally posted by punkworld
                                                                                  Now, the question is what paths are used in the script.

                                                                                  For instance, it could be that
                                                                                  $_SERVER['DOCUMENT_ROOT']
                                                                                  is used as the path to the scripts, which on certain servers may give problems.

                                                                                  if (time() > $row[1]) { require_once("ttt-do_reset.inc.php"); dailylog(); }


                                                                                  thats a line from the script, so it uses simple path's?
                                                                                  HEY!!

                                                                                  Unbeatable hosting! Customer service is top notch!

                                                                                  --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!

                                                                                  Comment

                                                                                  • Libertine
                                                                                    sex dwarf
                                                                                    • May 2002
                                                                                    • 17860

                                                                                    #42
                                                                                    Everything below this is illegal. Do it at your own risk. (It might work though).

                                                                                    In ttt-in.php, replace

                                                                                    $referer = getenv("HTTP_REFERER");
                                                                                    $ip = getenv("REMOTE_ADDR");

                                                                                    with

                                                                                    $referer = $_SERVER["HTTP_REFERER"];
                                                                                    $ip = $_SERVER['REMOTE_ADDR'];


                                                                                    I repeat, this is illegal, and Choker may get pissed off because of it. If you tell him, that is.
                                                                                    /(bb|[^b]{2})/

                                                                                    Comment

                                                                                    • lil2rich4u2
                                                                                      ICQ: 175171926
                                                                                      • Oct 2002
                                                                                      • 11046

                                                                                      #43
                                                                                      Originally posted by punkworld
                                                                                      Everything below this is illegal. Do it at your own risk. (It might work though).

                                                                                      In ttt-in.php, replace

                                                                                      $referer = getenv("HTTP_REFERER");
                                                                                      $ip = getenv("REMOTE_ADDR");

                                                                                      with

                                                                                      $referer = $_SERVER["HTTP_REFERER"];
                                                                                      $ip = $_SERVER['REMOTE_ADDR'];


                                                                                      I repeat, this is illegal, and Choker may get pissed off because of it. If you tell him, that is.

                                                                                      well it would prolly work since obviously you know your stuff, but ive already had a run-in with choker about editing his script, never again, lol

                                                                                      Thanks though
                                                                                      HEY!!

                                                                                      Unbeatable hosting! Customer service is top notch!

                                                                                      --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!

                                                                                      Comment

                                                                                      • lil2rich4u2
                                                                                        ICQ: 175171926
                                                                                        • Oct 2002
                                                                                        • 11046

                                                                                        #44
                                                                                        or maybe if i edit it, he will get pissed at me and send me 5 million free hits?


                                                                                        lol j/k
                                                                                        HEY!!

                                                                                        Unbeatable hosting! Customer service is top notch!

                                                                                        --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!

                                                                                        Comment

                                                                                        • lil2rich4u2
                                                                                          ICQ: 175171926
                                                                                          • Oct 2002
                                                                                          • 11046

                                                                                          #45
                                                                                          damnit, server admin still cant figure it out and lord knows im as useless as a set of tits on a bull, lol
                                                                                          HEY!!

                                                                                          Unbeatable hosting! Customer service is top notch!

                                                                                          --> ISPrime <-- Do a search on any board, their reputation is rock solid .. for years!!

                                                                                          Comment

                                                                                          Working...