Executing another PHP script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Amir

    Executing another PHP script

    Can one PHP script execute another PHP script?
  • Andy Hassall

    #2
    Re: Executing another PHP script

    On Fri, 11 Feb 2005 21:15:22 GMT, Amir <a.solan@verizo n.net> wrote:
    [color=blue]
    >Can one PHP script execute another PHP script?[/color]

    Yes.

    --
    Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
    <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

    Comment

    • Amir

      #3
      Re: Executing another PHP script

      Andy Hassall wrote:[color=blue]
      > On Fri, 11 Feb 2005 21:15:22 GMT, Amir <a.solan@verizo n.net> wrote:
      >
      >[color=green]
      >>Can one PHP script execute another PHP script?[/color]
      >
      >
      > Yes.
      >[/color]

      How?

      Comment

      • Andy Hassall

        #4
        Re: Executing another PHP script

        On Fri, 11 Feb 2005 21:20:19 GMT, Amir <anyone@verizon .net> wrote:
        [color=blue]
        >Andy Hassall wrote:[color=green]
        >> On Fri, 11 Feb 2005 21:15:22 GMT, Amir <a.solan@verizo n.net> wrote:
        >>[color=darkred]
        >>>Can one PHP script execute another PHP script?[/color]
        >>
        >> Yes.[/color]
        >
        >How?[/color]

        Depends where it is.

        include(), require(), fpassthru(), exec() are all candidates.

        include or require would be the preferred way, since it's all in the same PHP
        interpreter.

        fpassthru() could be used to get the output of a PHP script from another
        server, fetched over HTTP.

        exec() could be a last resort, starting up a separate PHP command-line
        interpreter. Not really a good option.

        --
        Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
        <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

        Comment

        • florent

          #5
          Re: Executing another PHP script



          "Amir" <a.solan@verizo n.net> wrote in message
          news:Kf9Pd.4859 2$g16.8786@trnd ny08...[color=blue]
          > Can one PHP script execute another PHP script?[/color]

          have a look at eval(...);

          Florent
          --




          Comment

          Working...