html template (1 Viewer)

brsawvel

Registered User.
Local time
Yesterday, 18:44
Joined
Sep 19, 2007
Messages
256
hello all,

It may sound like a simple question, but I'm very new to this...I'm considering buying a web template and was wondering if an html page can have code (php?) written into it to retrieve information from a database?
How would that work? Can I just save the edited file with the new code or save the file as one other than .htm? Or would I have to start with a webpage that is already developed to take the necessary code? (Or what do I do?)
 

DanG

Registered User.
Local time
Yesterday, 16:44
Joined
Nov 4, 2004
Messages
477
Hello,

Yes you can insert php into any html page.
example..
<body>
<h1>Hello this is my webpage...</h1>
<p> Here is my content...</p>
<?PHP> INSERT PHP SCRIPT TO RUN BETWEEN THE "php" tags</PHP>
<p>And that is how you do it!</p>
</body>

Of course you need to have a server that supports PHP.

HTH.
DanG
 

maxmangion

AWF VIP
Local time
Today, 00:44
Joined
Feb 26, 2003
Messages
2,805
<?PHP> INSERT PHP SCRIPT TO RUN BETWEEN THE "php" tags</PHP>

The tags shouls be <?php (opening tag and ?> (closing tag)

Also you need to save the file in .php extension
 

DanG

Registered User.
Local time
Yesterday, 16:44
Joined
Nov 4, 2004
Messages
477
Oops!
I got so carried away with the HTML tags, I just kept it going :eek:
 
Local time
Yesterday, 18:44
Joined
Mar 4, 2008
Messages
3,856
I guess one important thing you should know is that PHP is processed on the Web Server, not on the presentation machine (i.e. client). It is like asp and jsp in that regard.

That means that your web server must have PHP installed and configured.
 

Users who are viewing this thread

Top Bottom