Displaying text with include file.

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

    Displaying text with include file.

    Given this html code page;
    ======begin
    <html>
    <body>
    <!--#include file="outing.1. shtml"-->
    <form action="form.ph p" method="GET">
    <input type="hidden" name="op" value="ds">
    <table width="468" border="0" cellspacing="0" cellpadding="0" >
    <tr>
    <input type="hidden" name="id[1]" value="1">
    <td>Name<inpu t name="name[1]" type="text" size="30"></td>
    <td>Email<inp ut name="email[1]" type="text" size="60"></td>
    <td>Phone<inp ut name="phone[1]" type="text" size="15"></td>
    </tr>
    </table>
    <input type="submit" name="submit" value="submit">
    </form>

    </body>
    </html>
    ===========end
    and this php code page;
    ==========begin
    form.php
    <?php
    if($_GET["op"] == "ds") {
    foreach ($_GET["name"] as $key=>$value) {
    echo $_GET["name"][$key] ."-". $_GET["email"][$key] ."-".\
    $_GET["phone"][$key] ."-". $_GET["id"][$key];

    $fp=fopen("outi ng.1.shtml","a" );
    fwrite($fp,$_GE T["name"][$key] ."-". $_GET["email"][$key] ."-".\
    $_GET["phone"][$key]);
    fclose($fp);
    }
    }
    ?>
    ========end

    Both of these are on my IP server, EV1.

    I would like the contents of 'outing.1.shtml ' to be displayed hence
    the <!--#include file="outing.1. shtml"--in the HTML code.
    Since it does not work, I must ask what is the correct to do this?
    TIA
    Dave
  • PDannyD

    #2
    Re: Displaying text with include file.

    On Sunday 10 September 2006 23:35, Dave Kelly [daveekelly@eart hlink.net]
    wrote in message <4r0Ng.5983$v%4 .159@newsread1. news.pas.earthl ink.net>
    Given this html code page;
    ======begin
    <html>
    <body>
    <!--#include file="outing.1. shtml"-->
    I would like the contents of 'outing.1.shtml ' to be displayed hence
    the <!--#include file="outing.1. shtml"--in the HTML code.
    Since it does not work, I must ask what is the correct to do this?
    <?php include("outing .1.shtml")?>

    You were using the ASP #include.

    Comment

    • Jerry Stuckle

      #3
      Re: Displaying text with include file.

      PDannyD wrote:
      On Sunday 10 September 2006 23:35, Dave Kelly [daveekelly@eart hlink.net]
      wrote in message <4r0Ng.5983$v%4 .159@newsread1. news.pas.earthl ink.net>
      >
      >>Given this html code page;
      >>======begin
      >><html>
      >><body>
      >><!--#include file="outing.1. shtml"-->
      >
      >
      >>I would like the contents of 'outing.1.shtml ' to be displayed hence
      >>the <!--#include file="outing.1. shtml"--in the HTML code.
      >>Since it does not work, I must ask what is the correct to do this?
      >
      >
      <?php include("outing .1.shtml")?>
      >
      You were using the ASP #include.
      Actually, this is not the ASP include. It is the SSI include, and is
      perfectly valid.

      But Apache needs to be told to parse these pages for SSI includes (and
      similar statements).

      Check alt.apache.conf iguration and/or alt.html. This has nothing to do
      with php.

      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstucklex@attgl obal.net
      =============== ===

      Comment

      • flamer die.spam@hotmail.com

        #4
        Re: Displaying text with include file.


        PDannyD wrote:
        On Sunday 10 September 2006 23:35, Dave Kelly [daveekelly@eart hlink.net]
        wrote in message <4r0Ng.5983$v%4 .159@newsread1. news.pas.earthl ink.net>
        >
        Given this html code page;
        ======begin
        <html>
        <body>
        <!--#include file="outing.1. shtml"-->
        >
        I would like the contents of 'outing.1.shtml ' to be displayed hence
        the <!--#include file="outing.1. shtml"--in the HTML code.
        Since it does not work, I must ask what is the correct to do this?
        >
        <?php include("outing .1.shtml")?>
        >
        You were using the ASP #include.
        No that is a server side include, well possibly your server doesnt
        support ssi?? and why not just use php anyway since you have that code
        int he document already, rename the file as .php and use as suggested
        include("page.p hp");

        Flamer.

        Comment

        Working...