PHP coding?

Discussion in 'Programming' started by JackyRock, Feb 26, 2010.

  1. #1
    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>
     
    JackyRock, Feb 26, 2010 IP
  2. Mail Propeller

    Mail Propeller Peon

    Messages:
    44
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <html>
    <head>
    </head>
    <body>
    <div class="border">
    <?php

    echo "This needs to go into the class border"

    ?>
    </div>



    </body>
    </html>
     
    Mail Propeller, Feb 26, 2010 IP
  3. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #3
    <html>
    <head>
    </head>
    <body>
    <div class="<?php
    echo "This needs to go into the class border";
    ?>">
    </div>
    
    </body>
    </html> 
    PHP:
     
    danx10, Feb 26, 2010 IP
  4. Narrator

    Narrator Active Member

    Messages:
    392
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    80
    #4
    Do you mean with ajax?
     
    Narrator, Feb 26, 2010 IP
  5. jimmy4feb

    jimmy4feb Peon

    Messages:
    56
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    <html>
    <head>
    </head>
    <body>
    <div class="<?php echo "This needs to go into the class border";?>">
    </div>
    </body>
    </html>

    if you are getting a value from any php variable then

    <html>
    <head>
    </head>
    <body>
    <div class="<?php $variable_name;?>">
    </div>
    </body>
    </html>

    Thanks,

    Jimmy
     
    jimmy4feb, Feb 26, 2010 IP
  6. HostingProvider

    HostingProvider Active Member

    Messages:
    1,480
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    95
    #6
    Actually, the 2nd example is wrong. It should read;

    <html>
    <head>
    </head>
    <body>
    <div class="<?php echo $variable_name;?>">
    </div>
    </body>
    </html>
    
    PHP:
     
    HostingProvider, Feb 27, 2010 IP