Jump to content

PHP coding?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
20 replies to this topic

#1
JackyRock

JackyRock

    Newbie

  • Members
  • Pip
  • 3 posts
Hi Friends,

How do you use div class' in php such that you can attach html generated by php into that div class. Example
<html>
<head>
</head>
<body>
<div class="border">
</div>

<?php

echo "This needs to go into the class border"

?>

</body>
</html>

Edited by Jaan, 09 February 2010 - 02:00 AM.
Please use code tags when you are posting your codes!


#2
chad

chad

    Learning Programmer

  • Members
  • PipPipPip
  • 68 posts
i dont quite get you.
what exactly is that you want?

is it like this?

<div class="<?php echo $class; ?>"></div>

#3
JackyRock

JackyRock

    Newbie

  • Members
  • Pip
  • 3 posts
i m not ask the question. i m only some php relates information . so pls dont mind my friends.

#4
chad

chad

    Learning Programmer

  • Members
  • PipPipPip
  • 68 posts
huh?

#5
Guest_Jaan_*

Guest_Jaan_*
  • Guests
Well I guess your code have to be like this:

<html>
<head>
<title>Your website's title!</title>
</head>
<body>

<div class="border">
<?php

echo "Here's my text inside my div!";

?>
</div>

</body>
</html>


#6
chad

chad

    Learning Programmer

  • Members
  • PipPipPip
  • 68 posts
is that how it is?
coz i understood a different thing from the question

#7
Guest_Jaan_*

Guest_Jaan_*
  • Guests
Lol, well.. yes but this is how it goes if you want to print php inside a div :D

#8
chad

chad

    Learning Programmer

  • Members
  • PipPipPip
  • 68 posts
yah well what i had in mind is like calling css class from "somewhere" like maybe in the database or it was posted in a different page..

but i havent actually seen something like that before
well just an idea.

might as well try it :P

#9
Guest_Jaan_*

Guest_Jaan_*
  • Guests
Um do you know CSS ?

#10
chad

chad

    Learning Programmer

  • Members
  • PipPipPip
  • 68 posts
yeah sure i do :)

#11
Guest_Jaan_*

Guest_Jaan_*
  • Guests
Then you should know how to make classes in CSS

#12
chad

chad

    Learning Programmer

  • Members
  • PipPipPip
  • 68 posts
if you are talking about OOP in css
i believe there is nothing like that

are you trying to say something like this?
<div class="class"></div>