473,569 Members | 2,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTML call

Pat
Hello,

I have a question in regards to the use of php and html. The question
is: can someone write a script separate from the html page and then call
the script in like in a css style and use the values in the html page?
If so how?

I am just learning php and am not ignorant to programming, but I would
use a function or created class in the separate file but how would you
call the php file into the html file is what's killing me.

I hope that makes sense and I hope someone can at least point me in the
right direction to find the answer; because, to me putting all the code
in an html document is redundant especially on the oop side.

Thank you,
Patrick
Jul 24 '06 #1
5 15683

Pat wrote:
Hello,

I have a question in regards to the use of php and html. The question
is: can someone write a script separate from the html page and then call
the script in like in a css style and use the values in the html page?
If so how?

I am just learning php and am not ignorant to programming, but I would
use a function or created class in the separate file but how would you
call the php file into the html file is what's killing me.

I hope that makes sense and I hope someone can at least point me in the
right direction to find the answer; because, to me putting all the code
in an html document is redundant especially on the oop side.

Thank you,
Patrick
You can include an html page into you php file, just by doing
include("file.e xt"); you can't call php into html, im not sure exactly
what you mean by use the values in the html.. you can set a variable in
php, include an html page and within that html page have <input
type='name' value=' <?php echo $something; ?>'>

Flamer.

Jul 24 '06 #2
Pat wrote:
Hello,

I have a question in regards to the use of php and html. The question
is: can someone write a script separate from the html page and then call
the script in like in a css style and use the values in the html page?
If so how?

I am just learning php and am not ignorant to programming, but I would
use a function or created class in the separate file but how would you
call the php file into the html file is what's killing me.

I hope that makes sense and I hope someone can at least point me in the
right direction to find the answer; because, to me putting all the code
in an html document is redundant especially on the oop side.

Thank you,
Patrick
Easy way:
Write all your php code and require the html file
# test.php
<?php
$test = "Hi there";
require_once( 'test.html' );
exit(); // stop execution of script
?>

#test.html
<html>
<body>
<?php echo $test ?>
</body>
</html>

Little more complicated, but worth it if you want to get into
professional PHP development.
Smarty - PHP templating engine
http://smarty.php.net

1. Allows for logic in the template - Seperation of template logic and
business logic
2. Template caching
3. Many more benefits, check out the documentation

Jul 24 '06 #3
Pat wrote:
Hello,

I have a question in regards to the use of php and html. The question
is: can someone write a script separate from the html page and then call
the script in like in a css style and use the values in the html page?
If so how?

I am just learning php and am not ignorant to programming, but I would
use a function or created class in the separate file but how would you
call the php file into the html file is what's killing me.

I hope that makes sense and I hope someone can at least point me in the
right direction to find the answer; because, to me putting all the code
in an html document is redundant especially on the oop side.

Thank you,
Patrick
From HTML you can include a PHP file with SSI - Server Side Includes, i..e

<!-- include file="myfile.ph p" -->

See SSI documentation for your server for more information and/or follow
up in alt.html.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jul 25 '06 #4
reb


Le 24/07/2006 23:43, Pat a écrit :
I have a question in regards to the use of php and html. The question
is: can someone write a script separate from the html page and then call
the script in like in a css style and use the values in the html page?
If so how?

I am just learning php and am not ignorant to programming, but I would
use a function or created class in the separate file but how would you
call the php file into the html file is what's killing me.

I hope that makes sense and I hope someone can at least point me in the
right direction to find the answer; because, to me putting all the code
in an html document is redundant especially on the oop side.
You can call a php script from your HTML with an inline frame ; you'll
get the generated content of the php file :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test</title>
</head>
<body>
<p>Lorem ipsum...
<iframe src="test.php"> </iframe>
</body>
</html>
Jul 26 '06 #5
Pat
Pat wrote:
Hello,

I have a question in regards to the use of php and html. The question
is: can someone write a script separate from the html page and then call
the script in like in a css style and use the values in the html page?
If so how?

I am just learning php and am not ignorant to programming, but I would
use a function or created class in the separate file but how would you
call the php file into the html file is what's killing me.

I hope that makes sense and I hope someone can at least point me in the
right direction to find the answer; because, to me putting all the code
in an html document is redundant especially on the oop side.

Thank you,
Patrick
Thank you everyone this helps me a lot.

Thank you again,
Patrick
Jul 26 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
3869
by: deko | last post by:
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>
4
4718
by: Fergus O'Shea | last post by:
I have some text that appears in a Database. This text includes HTML(e.g. <br> tags). I also have a Webpage that makes an XML call to that database. But when the text is displayed on the page, the HTML isn't used, just printed out as normal text. Is there some way I can change the text in the Database, so that when it is called in the...
4
359
by: CLEAR-RCIC | last post by:
A person in a different division where I work asked for some help. He has an HTML website and wants to use some functionality in a .Net .dll that I've developed. I currently use this functionality on my ASP.Net website. I could easily port his HTML website into ASP.Net in about 5 minutes. The problem is that if anything on his site ever...
9
2867
by: Robby Bankston | last post by:
I'm working on some code and am running into brick walls. I'm trying to write out Javascript with Javascript and I've read the clj Meta FAQ and didn't see the answer, read many similar posts (with no luck though), and searched through the IRT.ORG Faqs (www.irt.org/script/script.htm). The Javascript is designed to open an popup window and...
3
1428
by: Epetruk | last post by:
Hi, I'm looking for samples of ASP.NET projects where the programming has been done almost entirely using codebehind and classes with very little code in the aspx files themselves. I would like to be able to write ASP.NET pages where I represented the elements on the page entirely with classes in codebehind (let's call them...
5
1234
by: Andy G | last post by:
I have many html pages that I need to put a button on. When this button is clicked I need to call a stored procedure that updates a record. -How do I add a button to html page that will call a .vbs or .js file (if that what I should even call, I would rather call a .vb class I have created but don't know if that is possible)? Thanks for...
0
1601
by: bp_jobemail | last post by:
I'm trying to use PHP to wrap the output of an HTML form before it goes into a precompiled C cgi script. Essentially, the company that I work for uses a purchased precompiled c program for their shopping cart. This C program stores order information, and when an order is processed and approved, records the transaction and sends a template...
3
2616
by: Chuck Renner | last post by:
Please help! This MIGHT even be a bug in PHP! I'll provide version numbers and site specific information (browser, OS, and kernel versions) if others cannot reproduce this problem. I'm running into some PHP behavior that I do not understand in PHP 5.1.2. I need to parse the HTML from the following carefully constructed URI:
19
3815
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>
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5223
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3657
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2117
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
946
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.