Connecting Tech Pros Worldwide Help | Site Map

How to call script from html page?

deko
Guest
 
Posts: n/a
#1: Jul 17 '05
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("mycookie",time(),3600,"/");
?>
<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
Guest
 
Posts: n/a
#2: Jul 17 '05

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("mycookie",time(),3600,"/");
> ?>
> <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
http://digiserv.net/

Marco Dieckhoff
Guest
 
Posts: n/a
#3: Jul 17 '05

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"ing it to .html?

Renaming?

--
Marco Dieckhoff
icq# 22243433
GPG Key 0x1A6C95BA -- http://www.frankonia-brunonia.de/keys
Edward Alfert
Guest
 
Posts: n/a
#4: Jul 17 '05

re: How to call script from html page?


"deko" <nospam@hotmail.com> wrote in
news:LocKc.11483$LW4.1476@newssvr25.news.prodigy.c om:
[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("mycookie",time(),3600,"/");
> ?>
> <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....depending 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
http://www.rootmode.com/
Multiple Domain Hosting and Reseller Hosting Plans
Coupon Code (Recurring $5/month Discount): newsgroup

deko
Guest
 
Posts: n/a
#5: Jul 17 '05

re: How to call script from html page?


> There are two techniques you can use....depending 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.


deko
Guest
 
Posts: n/a
#6: Jul 17 '05

re: How to call script from html page?


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

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


Edward Alfert
Guest
 
Posts: n/a
#7: Jul 17 '05

re: How to call script from html page?


"deko" <nospam@hotmail.com> wrote in
news:X5dKc.93366$Vt4.32918@newssvr29.news.prodigy. com:
[color=blue][color=green]
>> There are two techniques you can use....depending 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
http://www.rootmode.com/
Multiple Domain Hosting and Reseller Hosting Plans
Coupon Code (Recurring $5/month Discount): newsgroup

deko
Guest
 
Posts: n/a
#8: Jul 17 '05

re: How to call script from html page?


> >> There are two techniques you can use....depending 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:

http://www.clearpointsystems.com

Thanks for the help!


Edward Alfert
Guest
 
Posts: n/a
#9: Jul 17 '05

re: How to call script from html page?


"deko" <nospam@hotmail.com> wrote in news:6GdKc.93375$jE4.91670
@newssvr29.news.prodigy.com:
[color=blue][color=green][color=darkred]
>> >> There are two techniques you can use....depending 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...

http://validator.w3.org/check?uri=ht...intsystems.com



--
Edward Alfert
http://www.rootmode.com/
Multiple Domain Hosting and Reseller Hosting Plans
Coupon Code (Recurring $5/month Discount): newsgroup

deko
Guest
 
Posts: n/a
#10: Jul 17 '05

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....


deko
Guest
 
Posts: n/a
#11: Jul 17 '05

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)


Edward Alfert
Guest
 
Posts: n/a
#12: Jul 17 '05

re: How to call script from html page?


"deko" <nospam@hotmail.com> wrote in
news:c2eKc.11615$KX5.3826@newssvr25.news.prodigy.c om:
[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
http://www.rootmode.com/
Multiple Domain Hosting and Reseller Hosting Plans
Coupon Code (Recurring $5/month Discount): newsgroup

deko
Guest
 
Posts: n/a
#13: Jul 17 '05

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?


Geoff Berrow
Guest
 
Posts: n/a
#14: Jul 17 '05

re: How to call script from html page?


I noticed that Message-ID:
<1AeKc.22909$IM3.5944@newssvr27.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/
deko
Guest
 
Posts: n/a
#15: Jul 17 '05

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...


deko
Guest
 
Posts: n/a
#16: Jul 17 '05

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]

here is the stylesheet:

http://www.clearpointsystems.com/css02.html



deko
Guest
 
Posts: n/a
#17: Jul 17 '05

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]

Okay, I've summarized the the problem on the page at
http://clearpointsystems.com/112/index2.php and the page itself is an
example of the problem. Appreciate the help!


deko
Guest
 
Posts: n/a
#18: Jul 17 '05

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][color=green]
> > the css. Might I suggest including the css in the document rather than
> > as a link for development purposes?[/color]
>
> Okay, I've summarized the the problem on the page at
> http://clearpointsystems.com/112/index2.php and the page itself is an
> example of the problem. Appreciate the help!
>[/color]

I'm going to repost this since we're on a different subject now - but thanks
for getting me on the right track.


Geoff Berrow
Guest
 
Posts: n/a
#19: Jul 17 '05

re: How to call script from html page?


I noticed that Message-ID:
<OugKc.22965$325.3642@newssvr27.news.prodigy.com > from deko contained
the following:
[color=blue]
>Okay, I've summarized the the problem on the page at
>http://clearpointsystems.com/112/index2.php and the page itself is an
>example of the problem. Appreciate the help![/color]

Why not do it like this:

http://www.ckdog.co.uk/temp/clearpoint.html

--
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/
deko
Guest
 
Posts: n/a
#20: Jul 17 '05

re: How to call script from html page?


> Why not do it like this:[color=blue]
>
> http://www.ckdog.co.uk/temp/clearpoint.html[/color]

That seems to work.

I have it at http://clearpointsystems.com/112/index3.php

Apparently the problem is referenceing the external stylesheet, not html vs.
php as I thought. Nevertheless, the limitation is still with IE6, don't you
think?


Geoff Berrow
Guest
 
Posts: n/a
#21: Jul 17 '05

re: How to call script from html page?


I noticed that Message-ID:
<CBhKc.22986$kF5.19593@newssvr27.news.prodigy.co m> from deko contained
the following:
[color=blue]
>I have it at http://clearpointsystems.com/112/index3.php
>
>Apparently the problem is referenceing the external stylesheet, not html vs.
>php as I thought. Nevertheless, the limitation is still with IE6, don't you
>think?[/color]

No it will still work with an external style sheet. I put it in the same
document for convenience while I was solving the problem which I did by
putting the patterned gif on the back ground of the page rather than the
background of the left nav div. Using the div set at 100% height gives
you a div which is the height of the window. You wanted it to be the
height of the other div with the centre content. How would it know?

--
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/
deko
Guest
 
Posts: n/a
#22: Jul 17 '05

re: How to call script from html page?


> No it will still work with an external style sheet. I put it in the same[color=blue]
> document for convenience while I was solving the problem which I did by
> putting the patterned gif on the back ground of the page rather than the
> background of the left nav div. Using the div set at 100% height gives
> you a div which is the height of the window. You wanted it to be the
> height of the other div with the centre content. How would it know?[/color]

I see. It's working now as desired. The issue was the stylesheet after
all. Solving that was a wrestling match for me... Thanks for your help!


Closed Thread