Web Analytics Made Easy -
StatCounter Simple question about PHP(/HTML) (I'm a newb) - CodingForum

Announcement

Collapse
No announcement yet.

Simple question about PHP(/HTML) (I'm a newb)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Simple question about PHP(/HTML) (I'm a newb)

    I've got this..

    PHP Code:
    <?php
    $first_name 
    "name";
    $middle_name "middle name";
    $last_name "last name";
    ?>

    <html>
        <head>
            <title>Address</title>
            <style type="text/css">
                .big {
                    text-transform: uppercase;
                }

                span.capped {
                    text-transform: capitalized;
                }
            </style>
        </head>

        <body>
            <h2><span class="capped"><?php echo $first_name; echo " "; echo $middle_name; echo " "; echo $last_name ?></span>'s address:</h2>
        </body>
    </html>
    but when I upload it, it doesn't get capitalized...

    Here's a link: http://darklighta.100webspace.net/testing.php (excuse the banners)
    Always Use a DOCTYPE!
    Always Use * {margin: 0; border: none; padding: 0;} in the top of your CSS stylesheet.
    Always Use only CSS for layout; never (X)HTML.
    Always Have fun while coding!

  • #2
    its capitalize not capitalized. Try changing it for that. Since your using php you could always use that to do the transformation. ucfirst is the function for uppercase first letter which is the equivalent to capitalize

    PHP Code:
    <?php
    $first_name 
    ucfirst("name");
    $middle_name ucfirst("middle name");
    $last_name ucfirst("last name");
    ?>

    <html>
        <head>
            <title>Address</title>
            <style type="text/css">
                .big {
                    text-transform: uppercase;
                }
        </head>

        <body>
            <h2><span><?php echo $first_name " " $middle_name " " $last_name?></span>'s address:</h2>
        </body>
    </html>
    i have change your echo line to echo a single string seperating the parts with dots.
    You can not say you know how to do something, until you can teach it to someone else.

    Comment


    • #3
      Thank you very much!

      I'm going to stick to just plain, old, boring CSS changes now, as I'm just starting PHP
      Always Use a DOCTYPE!
      Always Use * {margin: 0; border: none; padding: 0;} in the top of your CSS stylesheet.
      Always Use only CSS for layout; never (X)HTML.
      Always Have fun while coding!

      Comment


      • #4
        To be honest i didn't even know you could do it that way until this morning. So thankyou!
        You can not say you know how to do something, until you can teach it to someone else.

        Comment


        • #5
          Nice find!!

          Comment

          Working...
          X