PHP Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aico
    Moo Moo Cow
    • Mar 2004
    • 14748

    #1

    PHP Question

    I changed a .shtml page into a .php page so I could include some PHP files, etc.

    On the .shtml page I was calling out a cgi script to be run like this:
    <!--#exec cgi="../cgi-bin/script.cgi" -->

    But now that the page is a .php it's not running. How to I call this out with php?

    I tried:
    <?php
    include("../cgi-bin/script.cgi");
    ?>

    But that didn't work...

    Thanks!
  • broke
    Confirmed User
    • Aug 2003
    • 4501

    #2
    exec( "/path/to/cgi/script/script.cgi" );
    Perfect Gonzo

    Comment

    • grumpy
      Too lazy to set a custom title
      • Jan 2002
      • 9870

      #3
      include "file.php";
      Don't let greediness blur your vision | You gotta let some shit slide
      icq - 441-456-888

      Comment

      • darksoul
        Confirmed User
        • Apr 2002
        • 4997

        #4
        Originally posted by grumpy
        include "file.php";
        how does it feel to post such a useless reply ?
        have you even bothered to read the thread ?
        1337 5y54|)m1n: 157717888
        BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
        Cambooth

        Comment

        • submitter
          Confirmed User
          • May 2004
          • 570

          #5
          try
          virtual("../cgi-bin/script.cgi");
          it work for me
          * lesbian thumb tgp/mgp:looking for trades
          * submit your lesbian galleries here
          * simple php programing on the cheap
          * icq:158726131

          Comment

          • RazorSharpe
            Confirmed User
            • Aug 2001
            • 2238

            #6
            <?virtual("../cgi-bin/script.cgi");?>

            that should work for you ...
            Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

            Comment

            • Radiate
              Confirmed User
              • Dec 2004
              • 1454

              #7
              you can use the SetHandler directive in htaccess to process the .php file as a .shtml file if you need to

              icq 199437756 - contact me if you need a solid hosting solution

              Comment

              • drama
                Confirmed User
                • Jul 2004
                • 847

                #8
                ask jimthefiend, he knows everything!

                Comment

                • Gungadin
                  Confirmed User
                  • Aug 2005
                  • 444

                  #9
                  Yeah, virtual might work, havent messed with it in a while. You could also try to fopen("http://www.your.com/cgi-bin/file.cgi"), slower but maybe better.

                  The problem is that PHP has no idea how to parse your CGI code, so you will have to read in the OUTPUT of the script.

                  -G
                  The GFY popularity contest scoreboard

                  Comment

                  • Nathan
                    Confirmed User
                    • Jul 2003
                    • 3108

                    #10
                    virtual() is your best solution here as long as it is apache.

                    You can also use passthru() to execute the script, this would not case an apache subrequest to launch, and might be better in some cases.
                    "Think about it a little more and you'll agree with me, because you're smart and I'm right."
                    - Charlie Munger

                    Comment

                    • ServerGenius
                      Confirmed User
                      • Feb 2002
                      • 9377

                      #11
                      Originally posted by drama
                      ask jimthefiend, he knows everything!
                      | http://www.sinnerscash.com/ | ICQ: 370820 | Skype: SinnersCash | AdultWhosWho |

                      Comment

                      • aico
                        Moo Moo Cow
                        • Mar 2004
                        • 14748

                        #12
                        Hey, thanks for all the replies. I just made a seperate .shtml page and put it in an iframe, that worked the best.

                        Thanks!

                        Comment

                        Working...