468,107 Members | 1,414 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,107 developers. It's quick & easy.

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("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?
Jul 17 '05 #1
21 3561
On Sat, 17 Jul 2004 16:24:11 +0000, deko wrote:
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?

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/

Jul 17 '05 #2
On 2004-07-17, deko <no****@hotmail.com> wrote:
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.


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

Renaming?

--
Marco Dieckhoff
icq# 22243433
GPG Key 0x1A6C95BA -- http://www.frankonia-brunonia.de/keys
Jul 17 '05 #3
"deko" <no****@hotmail.com> wrote in
news:Lo******************@newssvr25.news.prodigy.c om:
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?


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

Jul 17 '05 #4
> 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


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.
Jul 17 '05 #5
> What do you mean by "convert"ing it to .html?

Renaming?


yes. see my reply to Edward for more details...
Jul 17 '05 #6
"deko" <no****@hotmail.com> wrote in
news:X5*******************@newssvr29.news.prodigy. com:
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


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.


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

Jul 17 '05 #7
> >> 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
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.


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.


Here's the link:

http://www.clearpointsystems.com

Thanks for the help!
Jul 17 '05 #8
"deko" <no****@hotmail.com> wrote in news:6GdKc.93375$jE4.91670
@newssvr29.news.prodigy.com:
>> 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
>
> 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.
>
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.


Here's the link:

http://www.clearpointsystems.com

Thanks for the help!


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

Jul 17 '05 #9
> > 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.

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.


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....
Jul 17 '05 #10
> 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


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)
Jul 17 '05 #11
"deko" <no****@hotmail.com> wrote in
news:c2******************@newssvr25.news.prodigy.c om:
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


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)


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

Jul 17 '05 #12
> that second link should be http://www.clearpointsystems.com/htmlpage.html
with a / not a . before htmlpage.html (typing error i'm assuming)
yes... typo..
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.


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?
Jul 17 '05 #13
I noticed that Message-ID:
<1A******************@newssvr27.news.prodigy.com > from deko contained
the following:

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?

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/
Jul 17 '05 #14
> 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?


will do... give me a couple of minutes... will post back...
Jul 17 '05 #15
> 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?


here is the stylesheet:

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

Jul 17 '05 #16
> 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?


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!
Jul 17 '05 #17
> > 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?


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!


I'm going to repost this since we're on a different subject now - but thanks
for getting me on the right track.
Jul 17 '05 #18
I noticed that Message-ID:
<Ou******************@newssvr27.news.prodigy.com > from deko contained
the following:
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!


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/
Jul 17 '05 #19
> Why not do it like this:

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


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?
Jul 17 '05 #20
I noticed that Message-ID:
<CB*******************@newssvr27.news.prodigy.co m> from deko contained
the following:
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?


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/
Jul 17 '05 #21
> 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?


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!
Jul 17 '05 #22

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Marshall | last post: by
11 posts views Thread by yangsuli | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.