Jump to content
Larry Ullman's Book Forums

Recommended Posts

I've looked over this code 20 times if not more and even have had someone else look it over but I keep getting a syntex erroe when I upload it to the URL. Here's the code and the URL-FireFox info:

CODE I WROTE:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="author" content="Susan C. Stilwell, Sue's Special Imagery"/>

<meta name="copyright" content="Susan C. Stilwell, Sue's Special Imagery"/>

<meta name="keywords" content="art, graphics, photography, logos, business cards, imagery, letterhead, web, web design, artist, visual, design, video"/>

<link rel="stylesheet"type="text/css" href="styles.css"/>

<title>Hello, World!</title>

</head>

 

<body>

<p>The following was created by PHP: <br />

<?php

/*

* Filename: hello3.php

* Book referance: Script 1.5

* Create by: Susan Stilwell

*/

//print "<span style=\"font-weight:

bold;\">Hello, world!</span>\n";

 

?>

<!-- This is an HTML comment. -->

</p>

</body>

</html>

ERROR MESSAGE FROM FIREFOX:

localhost/sue/Assignments/hello3.php

The following was created by PHP:

Hello, world!\n"; ?>

(WE SHOULD NOT SEE HELLO, WORLD! WITH THIS ASSIGNMENT)

My page source:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="author" content="Susan C. Stilwell, Sue's Special Imagery"/>

<meta name="copyright" content="Susan C. Stilwell, Sue's Special Imagery"/>

<meta name="keywords" content="art, graphics, photography, logos, business cards, imagery, letterhead, web, web design, artist, visual, design, video"/>

<link rel="stylesheet"type="text/css" href="styles.css"/>

<title>Hello, World!</title>

</head>

 

<body>

<p>The following was created by PHP: <br />

<?php

/*

* Filename: hello3.php

* Book referance: Script 1.5

* Create by: Susan Stilwell

*/

//print "<span style=\"font-weight:

bold;\">Hello, world!</span>\n";

 

?>

<!-- This is an HTML comment. -->

</p>

</body>

</html>

 

Thanks for any & all help in this assignment,

Sue Stilwell

sue@sparklingspirit.com

Link to post
Share on other sites

Try this:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="Susan C. Stilwell, Sue's Special Imagery"/>
<meta name="copyright" content="Susan C. Stilwell, Sue's Special Imagery"/>
<meta name="keywords" content="art, graphics, photography, logos, business cards, imagery, letterhead, web, web design, artist, visual, design, video"/>
<link rel="stylesheet"type="text/css" href="styles.css"/>
<title>Hello, World!</title>
</head>
<body>
<p>The following was created by PHP: <br />
<?php
/*
* Filename: hello3.php
* Book referance: Script 1.5
* Create by: Susan Stilwell
*/
//print "<span style=\"font-weight:bold;\">Hello, world!</span>\n";
?>
<!-- This is an HTML comment. -->
</p>
</body>
</html>

 

The problem is lying on line 17, you see in the book line 17 has two lines, one numbered 17 and the other below line is blank. These two lines are line 17.

 

//print "<span style=\"font-weight:

bold;\">Hello, world!</span>\n";

 

All of this statement needs to be on one single line:

 

//print "<span style=\"font-weight:bold;\">Hello, world!</span>\n";

 

For comments starting with // all the commented out text must proceed the // on the same line.

  • Upvote 2
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...