473,700 Members | 2,823 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 15690

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
3887
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
4721
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 XML call, that it displays as HTML?
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 breaks in the future, I would own the problem because he isn't a programmer. I figured that if I...
9
2891
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 then inside that window call another script which will resize that window. There may be another...
3
1433
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 RenderClasses). The idea would be that each of these classes would have a Render method which would cause the...
5
1237
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 the help, hopefully this is enough to go off of. I just need to get pointed in the right direction.
0
1614
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 email to the customer with an invoice describing their purchase. Since we're going to be selling a...
3
2634
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
3823
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
8709
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8638
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9058
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8909
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6555
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5894
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4395
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2371
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2018
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.