Using html in php

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
cy
Forum Newbie
Posts: 5
Joined: Fri May 16, 2003 5:56 pm

Using html in php

Post by cy »

Hello, i m new to this whole php thing. I m just wondering that whether I can put html codes/page in php?
TThanks in advance
User avatar
mikusan
Forum Contributor
Posts: 247
Joined: Thu May 01, 2003 1:48 pm

Post by mikusan »

Very simple... if you choose to write html with php modules in it... all you do is insert

Code: Select all

<?  function foo()
{
   echo('HI!);
}
?>
if you prefer (i do) to write all php and have html modular you insert html into strings and you echo them or print them to the browser.

Code: Select all

//this is a *.php file
$output = '<B>Hello</B>';
echo($output);
cy
Forum Newbie
Posts: 5
Joined: Fri May 16, 2003 5:56 pm

Post by cy »

Thank you, i got it.

Another question...I m using phpnuke and trying to make a new php page with html code inside to display some information..however i wasn't able to change the size or the type of font. My guess is that phpnuke had set a default type of font for all modules/pages already, is there any ways to override it? Or if my guess is wrong, what is the problem?
thanks.
User avatar
mikusan
Forum Contributor
Posts: 247
Joined: Thu May 01, 2003 1:48 pm

Post by mikusan »

Actually that was one of the trillions of reasons i fell in love with php... people that are blind cannot resize your text so that your tables do't just die on you. What you are asking applies to geeklog too (i like geeklog better :)

However, it is something i woud like to find out too so that i can apply it to my new website...

hence... *bump*

;)
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

I'm not sure wether writing the html-output directly is the propery way, but e.g. for postNuke there are output functions that have to be used. Take a closer at the documentation wether echo 'my output'; is feasable for phpNuke (may be, may be not ;) )
How do you try to change the layout?
cy
Forum Newbie
Posts: 5
Joined: Fri May 16, 2003 5:56 pm

Post by cy »

I still haven't figure out this html thing yet but here i have another question.
How can i make my article into pages just like this:
http://www.howardchui.com/modules.php?n ... e&artid=13

Thanks.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

The $_GET method.
cy
Forum Newbie
Posts: 5
Joined: Fri May 16, 2003 5:56 pm

Post by cy »

Do you mind giving me more information on how to do it? I m new to php. THanks in advance
[]InTeR[]
Forum Regular
Posts: 416
Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands

Post by []InTeR[] »

cy
Forum Newbie
Posts: 5
Joined: Fri May 16, 2003 5:56 pm

Post by cy »

THanks i'll look into them.
User avatar
mikusan
Forum Contributor
Posts: 247
Joined: Thu May 01, 2003 1:48 pm

Post by mikusan »

Well i use a similar technique myself (regarding 4 posts above) but I didn't quite catch what is it that makes sure one cannot resize the text
Post Reply