• I have run into a simple problem that I simply don’t understand.
    This code:

    <!DOCTYPE html>
    <html><head><h1>TESTING<h1/>
    </head><body>
    <? php
    
    function foo ($s) {
    	printf("You said %s<br/>", $s);
    }
    foo("bar");
    ?>
    </body></html>

    And it generates this this wonderful page of clarity:
    TESTING
    “, $s); } foo(“bar”); ?>

    I know that I am simply not seeing the problem, but I am also getting old and going blind… literally. So if you wouldn’t mind helping an old guy out, I can get on with my project. This issue is real. I have extracted it down t its essence and still don’t see why it is failing.

    • This topic was modified 1 year, 11 months ago by bcworkz. Reason: code format fixed
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @rhj4,

    There is an extra space in your php tag (between ‘?’ and ‘php’) which the browser doesn’t recognise.

    Here is the working code:

    <!DOCTYPE html>
    <html>
    	<head>
        	<h1>TESTING<h1/>
    	</head>
    <body>
      <?php
      function foo ($s) {
        printf("You said %s<br/>", $s);
      }
      foo("bar");
      ?>
    </body>
    </html>

    I hope this helps! Good luck!

    Just a quick heads-up on the HTML markup: H1 cannot be in the head.

    It must be inside the body instead.

    For the title that appears in the browser’s tab (and search engine results), use the title tag instead, like <title>TESTING</title>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘I must be goig blind’ is closed to new replies.