PHP in PErl

Discussion in 'Perl' started by Gary, Aug 25, 2004.

  1. Gary

    Gary Guest

    I am calling a perl script that writes a WEB page - Plain and simple except
    that the perl script also writes out some PHP processing. All works fine
    when I just create an html file of the program but when I use perl to write
    it the php tags are ignored ?

    I have the apache Xbithack on so php is parsed for all html files and the
    perl script says it is an html file as below.

    This code is called from a WEB page

    #!/usr/local/bin/perl
    print <<END;
    Content-type: text/html

    <?php
    SCRIPT etc etc
    ?>
    END

    PHP tags are just printed on the screen.

    Any pointers.
    Gary
    Gary, Aug 25, 2004
    #1
    1. Advertising

  2. Gary

    Guest

    "Gary" <> multi-posts.

    Please don't do that.
    , Aug 25, 2004
    #2
    1. Advertising

  3. Gary

    Joe Smith Guest

    Gary wrote:

    > I am calling a perl script that writes a WEB page - Plain and simple except
    > that the perl script also writes out some PHP processing. All works fine
    > when I just create an html file of the program but when I use perl to write
    > it the php tags are ignored ?


    PHP is processed on the server only when the server reads it from a file.
    Joe Smith, Aug 25, 2004
    #3
  4. Gary

    Wayne Power Guest

    Look at your first line - #!usr/local/bin/perl - does your perl binary
    actually sit in /usr/local/bin/? Mine is in /usr/bin
    Try $whereis perl

    Wayne

    "Gary" <> wrote in message
    news:jBTWc.141014$Oi.66269@fed1read04...
    > I am calling a perl script that writes a WEB page - Plain and simple

    except
    > that the perl script also writes out some PHP processing. All works fine
    > when I just create an html file of the program but when I use perl to

    write
    > it the php tags are ignored ?
    >
    > I have the apache Xbithack on so php is parsed for all html files and the
    > perl script says it is an html file as below.
    >
    > This code is called from a WEB page
    >
    > #!/usr/local/bin/perl
    > print <<END;
    > Content-type: text/html
    >
    > <?php
    > SCRIPT etc etc
    > ?>
    > END
    >
    > PHP tags are just printed on the screen.
    >
    > Any pointers.
    > Gary
    >
    >
    >
    >
    Wayne Power, Aug 28, 2004
    #4
  5. Gary

    Gary Guest

    "Joe Smith" <> wrote in message
    news:At4Xc.232601$eM2.48080@attbi_s51...
    > Gary wrote:
    >
    > > I am calling a perl script that writes a WEB page - Plain and simple

    except
    > > that the perl script also writes out some PHP processing. All works fine
    > > when I just create an html file of the program but when I use perl to

    write
    > > it the php tags are ignored ?

    >
    > PHP is processed on the server only when the server reads it from a file.


    So basically this will never work.

    The reason for this is as follows.

    I want to load an HTML page with PHP tags that then calls a CGI written in
    Perl but also to pass it parameters. The perl program does some work, and
    will then need to return resulkts to the PHP program for display . I guess I
    could have the perl program write the results to a file and then have PHP
    readc the file but this seems crude it at all possible anyway ?

    Gary
    Gary, Aug 29, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ted Zeng
    Replies:
    4
    Views:
    488
    Tim Arnold
    Oct 3, 2006
  2. Ted Zeng
    Replies:
    0
    Views:
    613
    Ted Zeng
    Oct 13, 2006
  3. Rajive Narain
    Replies:
    0
    Views:
    1,641
    Rajive Narain
    Sep 18, 2009
  4. Ignoramus6539
    Replies:
    2
    Views:
    203
    Colin McKinnon
    Aug 30, 2006
  5. M. Strobel
    Replies:
    1
    Views:
    213
    The Natural Philosopher
    Mar 5, 2013
Loading...

Share This Page