How to call script from html page?

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

    How to call script from html page?

    Is it possible to call a php script from an html page? I have a
    TestPage.php that I want to convert to TestPage.html - but still call a php
    script from it.

    This is how my TestPage.php looks now:

    <?php
    setcookie("myco okie",time(),36 00,"/");
    ?>
    <html>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    <head>
    <title>TestPage .php</title>
    </head>
    <body>
    content here
    <?php
    include 'myscript.php';
    ?>

    The site is hosted on a LAMP server - Apache 1.3.27
    Is there any way to make this an html page and still call myscript.php?


  • Ian.H

    #2
    Re: How to call script from html page?

    On Sat, 17 Jul 2004 16:24:11 +0000, deko wrote:
    [color=blue]
    > Is it possible to call a php script from an html page? I have a
    > TestPage.php that I want to convert to TestPage.html - but still call a php
    > script from it.
    >
    > This is how my TestPage.php looks now:
    >
    > <?php
    > setcookie("myco okie",time(),36 00,"/");
    > ?>
    > <html>
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    > <head>
    > <title>TestPage .php</title>
    > </head>
    > <body>
    > content here
    > <?php
    > include 'myscript.php';
    > ?>
    >
    > The site is hosted on a LAMP server - Apache 1.3.27
    > Is there any way to make this an html page and still call myscript.php?[/color]


    RewriteRule /^TestPage\.html $ /TestPage.php [L]


    Or if you plan on doing this "globally":


    RewriteRule /^(.*)\.html$ /$1.php [L]


    HTH =)



    Regards,

    Ian

    --
    Ian.H
    digiServ Network
    London, UK


    Comment

    • Marco Dieckhoff

      #3
      Re: How to call script from html page?

      On 2004-07-17, deko <nospam@hotmail .com> wrote:[color=blue]
      > Is it possible to call a php script from an html page? I have a
      > TestPage.php that I want to convert to TestPage.html - but still call a php
      > script from it.[/color]

      What do you mean by "convert"in g it to .html?

      Renaming?

      --
      Marco Dieckhoff
      icq# 22243433
      GPG Key 0x1A6C95BA -- http://www.frankonia-brunonia.de/keys

      Comment

      • Edward Alfert

        #4
        Re: How to call script from html page?

        "deko" <nospam@hotmail .com> wrote in
        news:LocKc.1148 3$LW4.1476@news svr25.news.prod igy.com:
        [color=blue]
        > Is it possible to call a php script from an html page? I have a
        > TestPage.php that I want to convert to TestPage.html - but still call
        > a php script from it.
        >
        > This is how my TestPage.php looks now:
        >
        > <?php
        > setcookie("myco okie",time(),36 00,"/");
        > ?>
        > <html>
        > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        > <head>
        > <title>TestPage .php</title>
        > </head>
        > <body>
        > content here
        > <?php
        > include 'myscript.php';
        > ?>
        >
        > The site is hosted on a LAMP server - Apache 1.3.27
        > Is there any way to make this an html page and still call
        > myscript.php?
        >[/color]

        There are two techniques you can use....dependin g on what is easier.

        (1) edit your apache conf file and add .html extension to AddType
        application/x-httpd-php

        (2) force .html to be parsed through php by using the ForceType directive
        in an .htaccess file


        --
        Edward Alfert

        Multiple Domain Hosting and Reseller Hosting Plans
        Coupon Code (Recurring $5/month Discount): newsgroup

        Comment

        • deko

          #5
          Re: How to call script from html page?

          > There are two techniques you can use....dependin g on what is easier.[color=blue]
          >
          > (1) edit your apache conf file and add .html extension to AddType
          > application/x-httpd-php
          >
          > (2) force .html to be parsed through php by using the ForceType directive
          > in an .htaccess file[/color]

          Hi and thanks for the reply. #1 is already done - httpd will process both
          html and php

          As for #2 - this would only result in the same problem. What I want to do
          is call a php script from an html page that is not parsed by php.

          The problem I'm having is this:

          When scrolling with the mouse wheel, the bottom of the left nav bar does not
          display. To duplicate this problem, size your browser window so the vertical
          height is about half of your screen's height. Load the php page and then try
          scrolling down. You will notice that the bottom part of the left nav bar
          (the part that was not visible due to the limited height of the browser
          window) does not display - the left nav bar just stops and ugly white space
          appears where the nav bar should. I've tried this on a couple of computers
          and got the same result - apparently this is an issue with IE 6 since this
          does not happen with html pages.


          Comment

          • deko

            #6
            Re: How to call script from html page?

            > What do you mean by "convert"in g it to .html?[color=blue]
            >
            > Renaming?[/color]

            yes. see my reply to Edward for more details...


            Comment

            • Edward Alfert

              #7
              Re: How to call script from html page?

              "deko" <nospam@hotmail .com> wrote in
              news:X5dKc.9336 6$Vt4.32918@new ssvr29.news.pro digy.com:
              [color=blue][color=green]
              >> There are two techniques you can use....dependin g on what is easier.
              >>
              >> (1) edit your apache conf file and add .html extension to AddType
              >> application/x-httpd-php
              >>
              >> (2) force .html to be parsed through php by using the ForceType
              >> directive in an .htaccess file[/color]
              >
              > Hi and thanks for the reply. #1 is already done - httpd will process
              > both html and php
              >
              > As for #2 - this would only result in the same problem. What I want
              > to do is call a php script from an html page that is not parsed by
              > php.
              >
              > The problem I'm having is this:
              >
              > When scrolling with the mouse wheel, the bottom of the left nav bar
              > does not display. To duplicate this problem, size your browser window
              > so the vertical height is about half of your screen's height. Load the
              > php page and then try scrolling down. You will notice that the bottom
              > part of the left nav bar (the part that was not visible due to the
              > limited height of the browser window) does not display - the left nav
              > bar just stops and ugly white space appears where the nav bar should.
              > I've tried this on a couple of computers and got the same result -
              > apparently this is an issue with IE 6 since this does not happen with
              > html pages.
              >[/color]

              If you could provide a link to the page it would help. :)

              I don't believe the problem is that the page is php. There must be
              something missing/different between the working .html version and the
              misbehaving .php version of your page. Please provide links to both and we
              may be able to figure out what is wrong.


              --
              Edward Alfert

              Multiple Domain Hosting and Reseller Hosting Plans
              Coupon Code (Recurring $5/month Discount): newsgroup

              Comment

              • deko

                #8
                Re: How to call script from html page?

                > >> There are two techniques you can use....dependin g on what is easier.[color=blue][color=green][color=darkred]
                > >>
                > >> (1) edit your apache conf file and add .html extension to AddType
                > >> application/x-httpd-php
                > >>
                > >> (2) force .html to be parsed through php by using the ForceType
                > >> directive in an .htaccess file[/color]
                > >
                > > Hi and thanks for the reply. #1 is already done - httpd will process
                > > both html and php
                > >
                > > As for #2 - this would only result in the same problem. What I want
                > > to do is call a php script from an html page that is not parsed by
                > > php.
                > >
                > > The problem I'm having is this:
                > >
                > > When scrolling with the mouse wheel, the bottom of the left nav bar
                > > does not display. To duplicate this problem, size your browser window
                > > so the vertical height is about half of your screen's height. Load the
                > > php page and then try scrolling down. You will notice that the bottom
                > > part of the left nav bar (the part that was not visible due to the
                > > limited height of the browser window) does not display - the left nav
                > > bar just stops and ugly white space appears where the nav bar should.
                > > I've tried this on a couple of computers and got the same result -
                > > apparently this is an issue with IE 6 since this does not happen with
                > > html pages.
                > >[/color]
                >
                > If you could provide a link to the page it would help. :)
                >
                > I don't believe the problem is that the page is php. There must be
                > something missing/different between the working .html version and the
                > misbehaving .php version of your page. Please provide links to both and[/color]
                we[color=blue]
                > may be able to figure out what is wrong.[/color]

                Here's the link:



                Thanks for the help!


                Comment

                • Edward Alfert

                  #9
                  Re: How to call script from html page?

                  "deko" <nospam@hotmail .com> wrote in news:6GdKc.9337 5$jE4.91670
                  @newssvr29.news .prodigy.com:
                  [color=blue][color=green][color=darkred]
                  >> >> There are two techniques you can use....dependin g on what is[/color][/color][/color]
                  easier.[color=blue][color=green][color=darkred]
                  >> >>
                  >> >> (1) edit your apache conf file and add .html extension to AddType
                  >> >> application/x-httpd-php
                  >> >>
                  >> >> (2) force .html to be parsed through php by using the ForceType
                  >> >> directive in an .htaccess file
                  >> >
                  >> > Hi and thanks for the reply. #1 is already done - httpd will[/color][/color][/color]
                  process[color=blue][color=green][color=darkred]
                  >> > both html and php
                  >> >
                  >> > As for #2 - this would only result in the same problem. What I[/color][/color][/color]
                  want[color=blue][color=green][color=darkred]
                  >> > to do is call a php script from an html page that is not parsed by
                  >> > php.
                  >> >
                  >> > The problem I'm having is this:
                  >> >
                  >> > When scrolling with the mouse wheel, the bottom of the left nav bar
                  >> > does not display. To duplicate this problem, size your browser[/color][/color][/color]
                  window[color=blue][color=green][color=darkred]
                  >> > so the vertical height is about half of your screen's height. Load[/color][/color][/color]
                  the[color=blue][color=green][color=darkred]
                  >> > php page and then try scrolling down. You will notice that the[/color][/color][/color]
                  bottom[color=blue][color=green][color=darkred]
                  >> > part of the left nav bar (the part that was not visible due to the
                  >> > limited height of the browser window) does not display - the left[/color][/color][/color]
                  nav[color=blue][color=green][color=darkred]
                  >> > bar just stops and ugly white space appears where the nav bar[/color][/color][/color]
                  should.[color=blue][color=green][color=darkred]
                  >> > I've tried this on a couple of computers and got the same result -
                  >> > apparently this is an issue with IE 6 since this does not happen[/color][/color][/color]
                  with[color=blue][color=green][color=darkred]
                  >> > html pages.
                  >> >[/color]
                  >>
                  >> If you could provide a link to the page it would help. :)
                  >>
                  >> I don't believe the problem is that the page is php. There must be
                  >> something missing/different between the working .html version and the
                  >> misbehaving .php version of your page. Please provide links to both[/color][/color]
                  and[color=blue]
                  > we[color=green]
                  >> may be able to figure out what is wrong.[/color]
                  >
                  > Here's the link:
                  >
                  > http://www.clearpointsystems.com
                  >
                  > Thanks for the help![/color]

                  I was hoping for a link to the .html page and a separate link to the
                  ..php generated page so that I could compare the two.

                  Just looking at the source http://www.clearpointsystems.com/ it contains
                  several errors.

                  (1) you have <div> inside <head>
                  (2) you have </head> twice
                  (3) you have <META ...> after the first </head>
                  (4) you have <body> before the second </head>

                  I would run whatever page you are designing through a validator to clean
                  all errors up. If you do not code to adhere to the standard you are
                  using, then it is highly likely that browsers will interpret things
                  wrong and cause the weird effects you are seeing.

                  Take a look at the errors detected by the w3 validator...





                  --
                  Edward Alfert

                  Multiple Domain Hosting and Reseller Hosting Plans
                  Coupon Code (Recurring $5/month Discount): newsgroup

                  Comment

                  • deko

                    #10
                    Re: How to call script from html page?

                    > > When scrolling with the mouse wheel, the bottom of the left nav bar[color=blue][color=green]
                    > > does not display. To duplicate this problem, size your browser window
                    > > so the vertical height is about half of your screen's height. Load the
                    > > php page and then try scrolling down. You will notice that the bottom
                    > > part of the left nav bar (the part that was not visible due to the
                    > > limited height of the browser window) does not display - the left nav
                    > > bar just stops and ugly white space appears where the nav bar should.
                    > > I've tried this on a couple of computers and got the same result -
                    > > apparently this is an issue with IE 6 since this does not happen with
                    > > html pages.
                    > >[/color]
                    >
                    > If you could provide a link to the page it would help. :)
                    >
                    > I don't believe the problem is that the page is php. There must be
                    > something missing/different between the working .html version and the
                    > misbehaving .php version of your page. Please provide links to both and[/color]
                    we[color=blue]
                    > may be able to figure out what is wrong.[/color]

                    Interesting... I've created 2 versions of the same page: one is a php page
                    and one is an html page:

                    http://www.clearpointsystems.com (php)

                    http://www.clearpointsystems.com.htmlpage.html (html)

                    I seem to be getting same results in both....


                    Comment

                    • deko

                      #11
                      Re: How to call script from html page?

                      > I was hoping for a link to the .html page and a separate link to the[color=blue]
                      > .php generated page so that I could compare the two.
                      >
                      > Just looking at the source http://www.clearpointsystems.com/ it contains
                      > several errors.
                      >
                      > (1) you have <div> inside <head>
                      > (2) you have </head> twice
                      > (3) you have <META ...> after the first </head>
                      > (4) you have <body> before the second </head>
                      >
                      > I would run whatever page you are designing through a validator to clean
                      > all errors up. If you do not code to adhere to the standard you are
                      > using, then it is highly likely that browsers will interpret things
                      > wrong and cause the weird effects you are seeing.
                      >
                      > Take a look at the errors detected by the w3 validator...
                      >
                      > http://validator.w3.org/check?uri=ht...intsystems.com[/color]

                      Here are links. I will try cleaning up the code and see if the results are
                      the same.

                      http://www.clearpointsystems.com (php)

                      http://www.clearpointsystems.com.htmlpage.html (html)


                      Comment

                      • Edward Alfert

                        #12
                        Re: How to call script from html page?

                        "deko" <nospam@hotmail .com> wrote in
                        news:c2eKc.1161 5$KX5.3826@news svr25.news.prod igy.com:
                        [color=blue][color=green]
                        >> I was hoping for a link to the .html page and a separate link to the
                        >> .php generated page so that I could compare the two.
                        >>
                        >> Just looking at the source http://www.clearpointsystems.com/ it
                        >> contains several errors.
                        >>
                        >> (1) you have <div> inside <head>
                        >> (2) you have </head> twice
                        >> (3) you have <META ...> after the first </head>
                        >> (4) you have <body> before the second </head>
                        >>
                        >> I would run whatever page you are designing through a validator to
                        >> clean all errors up. If you do not code to adhere to the standard
                        >> you are using, then it is highly likely that browsers will interpret
                        >> things wrong and cause the weird effects you are seeing.
                        >>
                        >> Take a look at the errors detected by the w3 validator...
                        >>
                        >> http://validator.w3.org/check?uri=ht...pointsystems.c
                        >> om[/color]
                        >
                        > Here are links. I will try cleaning up the code and see if the
                        > results are the same.
                        >
                        > http://www.clearpointsystems.com (php)
                        >
                        > http://www.clearpointsystems.com.htmlpage.html (html)[/color]

                        that second link should be http://www.clearpointsystems.com/htmlpage.html
                        with a / not a . before htmlpage.html (typing error i'm assuming)

                        Looking at both I noticed that you are calling "../csi.css" in the .php
                        version and "csi.css" in the .html version. That might be your something
                        to look at.

                        --
                        Edward Alfert

                        Multiple Domain Hosting and Reseller Hosting Plans
                        Coupon Code (Recurring $5/month Discount): newsgroup

                        Comment

                        • deko

                          #13
                          Re: How to call script from html page?

                          > that second link should be http://www.clearpointsystems.com/htmlpage.html[color=blue]
                          > with a / not a . before htmlpage.html (typing error i'm assuming)[/color]

                          yes... typo..
                          [color=blue]
                          > Looking at both I noticed that you are calling "../csi.css" in the .php
                          > version and "csi.css" in the .html version. That might be your something
                          > to look at.[/color]

                          yes, link to stylesheet is wrong.

                          In any case, I've tried a clean version of the code and still get the same
                          problem. Maybe the issue is simple IE6 sucks? Do you know of any pages
                          where a left nav bar works correctly?


                          Comment

                          • Geoff Berrow

                            #14
                            Re: How to call script from html page?

                            I noticed that Message-ID:
                            <1AeKc.22909$IM 3.5944@newssvr2 7.news.prodigy. com> from deko contained
                            the following:
                            [color=blue]
                            >
                            >In any case, I've tried a clean version of the code and still get the same
                            >problem. Maybe the issue is simple IE6 sucks?[/color]


                            Whilst that may be true, I doubt it is your problem, which I think is in
                            the css. Might I suggest including the css in the document rather than
                            as a link for development purposes?
                            --
                            Geoff Berrow (put thecat out to email)
                            It's only Usenet, no one dies.
                            My opinions, not the committee's, mine.
                            Simple RFDs http://www.ckdog.co.uk/rfdmaker/

                            Comment

                            • deko

                              #15
                              Re: How to call script from html page?

                              > Whilst that may be true, I doubt it is your problem, which I think is in[color=blue]
                              > the css. Might I suggest including the css in the document rather than
                              > as a link for development purposes?[/color]

                              will do... give me a couple of minutes... will post back...


                              Comment

                              Working...