SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Addict
    Join Date
    Oct 2005
    Posts
    288
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Echo display end of command line

    Attempting to regain php literacy. (and my first venture into HTML5) Can't even get my "Hello World" to work. Here's my code
    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title></title>
    <meta name="" content="">
    </head>
    <body>
    <?php echo ("<p>Why is this happening?</p>"); ?>
    </body>
    </html>
    What displays is
    Why is this happening?
    "); ?>
    i.e. the statement excerpt following the </p>

    I'm running under windows 8. Same result in chrome 29.0, Firefox 24.0, IE 10.0

    Not a good omen.

    grNadpa

  2. #2
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,233
    Mentioned
    154 Post(s)
    Tagged
    0 Thread(s)
    Hmm... Not sure.
    PHP Code:
    <?php echo ("<p>Why is this happening?</p>"); ?>
    <?php 
    echo "<p>Why is this happening?</p>"?>
    <?=
    "<p>Why is this happening?</p>"?>
    Produces the following output for me
    Code:
    Why is this happening?
    
    Why is this happening?
    
    Why is this happening?

  3. #3
    SitePoint Addict
    Join Date
    Oct 2005
    Posts
    288
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Apparently has to do with my configuration because, after copy pasting your code, I get
    Why is this happening?
    "); ?> Why is this happening?
    "; ?> Why is this happening?
    "; ?>
    just to confirm, here's the script
    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title></title>
    <meta name="" content="">
    </head>
    <body>
     <?php echo ("<p>Why is this happening?</p>"); ?>
    <?php echo "<p>Why is this happening?</p>"; ?>
    <?="<p>Why is this happening?</p>"; ?> 
    </body>
    </html>

  4. #4
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,233
    Mentioned
    154 Post(s)
    Tagged
    0 Thread(s)
    So it seems. Silly question (I'm sure), but you are using a .php extension to your file right?

  5. #5
    SitePoint Addict
    Join Date
    Oct 2005
    Posts
    288
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thank you for the silly question.

    'nuf said.

  6. #6

  7. #7
    SitePoint Addict
    Join Date
    Oct 2005
    Posts
    288
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cpradio View Post
    Was that the issue? ...
    Yes. Quite embarrassing.

  8. #8
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,233
    Mentioned
    154 Post(s)
    Tagged
    0 Thread(s)
    Ah, no biggie, at least we got to the bottom of it


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •