#including

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

    #1

    #including

    How do I include a php file with arguments in a shtml file? It just gives me
    an error. Can this be done?


  • Boyd

    #2
    Re: #including

    In article <2yvNb.5419$HR. 11057@news.indi go.ie>, no@no.ie says...[color=blue]
    > How do I include a php file with arguments in a shtml file? It just gives me
    > an error. Can this be done?[/color]

    yes if you set the shtml file to parse as a php file.

    --
    *************** *************** ********
    The Eldritch Dark:
    Dedicated to Clark Ashton Smith

    Comment

    • Joe Cybernet

      #3
      Re: #including


      "Boyd" <boyd@dont.spam .me> wrote in message
      news:MPG.1a71b4 2e6662145b9896a 0@news.slingsho t.co.nz...[color=blue]
      > In article <2yvNb.5419$HR. 11057@news.indi go.ie>, no@no.ie says...[color=green]
      > > How do I include a php file with arguments in a shtml file? It just[/color][/color]
      gives me[color=blue][color=green]
      > > an error. Can this be done?[/color]
      >
      > yes if you set the shtml file to parse as a php file.
      >
      > --
      > *************** *************** ********
      > The Eldritch Dark:
      > Dedicated to Clark Ashton Smith
      > http://www.eldritchdark.com/[/color]

      can you please explain how to do this?


      Comment

      • CountScubula

        #4
        Re: #including

        It might be easier to rename the file to .php and use the equivalent parts
        in php rather than .shtml


        --
        Mike Bradley
        http://www.gzentools.com -- free online php tools
        "Joe Cybernet" <no@no.ie> wrote in message
        news:2yvNb.5419 $HR.11057@news. indigo.ie...[color=blue]
        > How do I include a php file with arguments in a shtml file? It just gives[/color]
        me[color=blue]
        > an error. Can this be done?
        >
        >[/color]


        Comment

        • Joe Cybernet

          #5
          Re: #including

          Yeah I dont mind doing that, but if I use the include() function, it gives
          me an error msg if I include any arguments. For example if I have a file
          called ad.php and i include the line

          <?include("ad.p hp")?>

          It works fine. But if I chang it to

          <?include("ad.p hp?id=2")?>

          I get an errormessage.
          "CountScubu la" <me@scantek.hot mail.com> wrote in message
          news:P8INb.1594 $9y7.297@newssv r29.news.prodig y.com...[color=blue]
          > It might be easier to rename the file to .php and use the equivalent parts
          > in php rather than .shtml
          >
          >
          > --
          > Mike Bradley
          > http://www.gzentools.com -- free online php tools
          > "Joe Cybernet" <no@no.ie> wrote in message
          > news:2yvNb.5419 $HR.11057@news. indigo.ie...[color=green]
          > > How do I include a php file with arguments in a shtml file? It just[/color][/color]
          gives[color=blue]
          > me[color=green]
          > > an error. Can this be done?
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • CountScubula

            #6
            Re: #including

            if you want to do something like
            <?php
            include("ad.php ?id=2");
            ?>

            rewrite it like this
            <?php
            $id = 2;
            include("ad.php ");
            ?>

            the variable $id will automaticaly be available to your included ad.php
            script, it is included as if it were part of the original source

            --
            Mike Bradley
            http://www.gzentools.com -- free online php tools
            "Joe Cybernet" <nodger@eircom. net> wrote in message
            news:w8JNb.5583 $HR.11435@news. indigo.ie...[color=blue]
            > Yeah I dont mind doing that, but if I use the include() function, it gives
            > me an error msg if I include any arguments. For example if I have a file
            > called ad.php and i include the line
            >
            > <?include("ad.p hp")?>
            >
            > It works fine. But if I chang it to
            >
            >
            > I get an errormessage.
            > "CountScubu la" <me@scantek.hot mail.com> wrote in message
            > news:P8INb.1594 $9y7.297@newssv r29.news.prodig y.com...[color=green]
            > > It might be easier to rename the file to .php and use the equivalent[/color][/color]
            parts[color=blue][color=green]
            > > in php rather than .shtml
            > >
            > >
            > > --
            > > Mike Bradley
            > > http://www.gzentools.com -- free online php tools
            > > "Joe Cybernet" <no@no.ie> wrote in message
            > > news:2yvNb.5419 $HR.11057@news. indigo.ie...[color=darkred]
            > > > How do I include a php file with arguments in a shtml file? It just[/color][/color]
            > gives[color=green]
            > > me[color=darkred]
            > > > an error. Can this be done?
            > > >
            > > >[/color]
            > >
            > >[/color]
            >
            >[/color]


            Comment

            • Chung Leong

              #7
              Re: #including

              The syntax is <!--#include virtual="/something/counter.php?cow =500" -->.

              Uzytkownik "Joe Cybernet" <no@no.ie> napisal w wiadomosci
              news:2yvNb.5419 $HR.11057@news. indigo.ie...[color=blue]
              > How do I include a php file with arguments in a shtml file? It just gives[/color]
              me[color=blue]
              > an error. Can this be done?
              >
              >[/color]


              Comment

              • Boyd

                #8
                Re: #including

                In article <UeHNb.5572$HR. 11518@news.indi go.ie>, no@no.ie says...[color=blue]
                >
                > "Boyd" <boyd@dont.spam .me> wrote in message
                > news:MPG.1a71b4 2e6662145b9896a 0@news.slingsho t.co.nz...[color=green]
                > > In article <2yvNb.5419$HR. 11057@news.indi go.ie>, no@no.ie says...[color=darkred]
                > > > How do I include a php file with arguments in a shtml file? It just[/color][/color]
                > gives me[color=green][color=darkred]
                > > > an error. Can this be done?[/color]
                > >
                > > yes if you set the shtml file to parse as a php file.
                > >[/color]
                >
                > can you please explain how to do this?
                >[/color]
                Add:
                AddType application/x-httpd-php .shtml
                in your .htaccess file

                --
                *************** *************** ********
                The Eldritch Dark:
                Dedicated to Clark Ashton Smith

                Comment

                Working...