<-- complete noob - Ques. on PHP and HTML integration

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Klavier
Forum Newbie
Posts: 7
Joined: Fri Jun 27, 2003 5:47 pm
Location: NJ

<-- complete noob - Ques. on PHP and HTML integration

Post by Klavier »

Here's my problem, i have created an HTML interface for a site, and there is also PHP code. my job is to put both together. i am a complete PHP noob, i've never worked with it. so basically what i was told, is to put the Interface and the PHP together. How would i go about doing that?
thanks!
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

it would help if i saw the two.. being a reative newb myself....

here's my suggestion:

<?php
/*php stuff you were given */
?> html stuff for the page

then look at what needs to cross.. ie: we get the page title fromthe php.. ok... then in the html, instead of <title>blahblahblah</title>
use <title><?php echo $php title info; ?>


i hope that helps some
Klavier
Forum Newbie
Posts: 7
Joined: Fri Jun 27, 2003 5:47 pm
Location: NJ

Post by Klavier »

thanks!
qartis
Forum Contributor
Posts: 271
Joined: Sat Dec 14, 2002 4:43 pm
Location: BC, Canada
Contact:

Post by qartis »

If you have a .php script that has HTML in it, and you need to basically fill in some sections of the HTML with variable values, cut out the old static text, and replace it with

Code: Select all

<?php
echo $variable;
?>
or

Code: Select all

<?=$variable?>
And then continue on with the HTML. Note that $variable has to be a real variable, containing the text you want to insert into the HTML at that point.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Where is the arrow pointing in the topic line? heh ;)
Post Reply