473,378 Members | 1,688 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 3854
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: JoeK | last post by:
Hey all, I am automating a web page from Visual Foxpro. I can control all the textboxes, radio buttons, and command buttons using syntax such as: ...
2
by: shree | last post by:
Hi all, I'm trying to call javascript function via onLoad but running into a problem. I would appreciate any help and suggestion. My application is as follows. When a page loads, I want to check...
2
by: Alani | last post by:
Hello All, I'm a new ASP.NET programmer and I want to create a custom control consist of two properties (Number1) and (Number2) and both of them are integers and default value = 0, now I'm...
4
by: dennise9 | last post by:
My exeternal JS works fine when the call is placed in the page head or body. But if I call the same javascript from a (clicked) text link on the page, the script throws a JS error when it...
3
by: Marshall | last post by:
Hello, I am wondering if it is possible to call a remote web service using ATLAS and if so, how. I have read several docs which show how to call a web service that is within the same project as...
19
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function myFunc(val1ok, val2ok) ' do something ok myFunc = " return something ok" End Function </script>
11
by: yangsuli | last post by:
i want to creat a link when somebody click the link the php script calls a function,then display itself :) i have tried <a href=<? funtion(); echo=$_server ?>text</a> but it will call the...
3
by: Angus | last post by:
I have a web page with a toolbar containing a Save button. The Save button can change contextually to be a Search button in some cases. Hence the button name searchsavechanges. The snippet of...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.