What ever i type in this file in HTML ITS SHWOING ERROR

i dont know what happened after typing doctype in line 52 its start showing error on almost each and every line although code are correct but it still showing error, in line 53 to 63, and in line 69. although code are correct than why its showing mistake i changed the color of the line to where its showing error

thanks


1.<?php
2.  session_start ();
3. include ("include/connect.php");
4. include ("include/html_codes.php");

5. $x=$_GET ['x'];
6. function createMessage ($x) {
7. if (is_numeric ($x)) {
8.    switch ($x) {

9. case 0:
10. $message= "your account is now active, you may now <a href=\\"login.php\\"Log In!</a>
11. break;

12. case 1:
13. $message='thank you for registering! a confermatioin e mail has been sent to your 
14    email account please clkick on the antivation link to activate our account.';
15. break;
16. case 2:

17. $message ='that e mail adress or username has already been registered.';
18   break;

19   case 3:
20   $message= 'sorry, that item has already been traded!';
21   break;

22  case4:
23  $message = 'item successfully updated!';
24 break;

25    case 5:
26        $message = 'item successfully deleted';
27        break;

28    case 6:
29        $message ='message has been sent';
30        break;

31    case 7: 
32        $message = 'thank you for leaving feedback';
33       break;

33   case 8:
34       $message = 'item added successfully';
35       break;

36   case 9:
37       $message ='that is not your item';
38    break;

39    }

40    echo $message;
41 endfor;

42            break;
43
44        default:
45            break;
46    }
47. }
48.
49.
50. ?>
51.    

52. <!DOCTYPE html>
[COLOR=#000080]53. <html lang ="en">
54. <head>
55. <title>Prompt </title>
56. <link rel="stylesheet" href="main.css">
57. <link rel="stylesheet" href="prompt.php">
58. </head>

59. <body>
60    <div id="wrapper>"
61         <?php headerAndSearchCode ();?>
62         <div id="outer">

63             <div id="inner">[/COLOR]

64 <?php createMessage ($x); ?>
65                 </div>
66         <?php footercode ();?>
67. </div>

68. </body>
[COLOR=#0000CD][COLOR=#0000CD]69. </html>[/COLOR][/COLOR]

Do you have a live link? That would make it easier to see what’s going on.

Looks like a PHP issue!
Moved to the right forum!

The coloring in your post should give you a clue. (You’ve forgotten to close your string in Case 0)

what link? sorry i did not understand, thanks

Look at the code coloring in line 9: it’s yellow, unlike the lines below. StarLion is saying you need to add closing quotes to the message in line 10.

now i closed the my first case 0: on line 10, but now its showing the error

on line 41. the line is … endfor; and the error is Parse error: syntax error, unexpected T_ENDFOR, thanks, and more things how can change my post, like now i close my line case 0: on line 10, after you mentioned, but in here i dont know how to change it, i want to change it,

thanks i changed it already, but now its showing me the error on line 41… and the line is endfor: and the error is Parse error: syntax error, unexpected T_ENDFOR, thanks and can i ask you how can i get the clue from coloring of the line, yah you are right, the line 9 is yellow. can you explain please

Can you show the code you now have?

[COLOR=“#000000”]this is my new code and the error is on line 41 and the error is Parse error: syntax error, unexpected T_ENDFOR,

and one more thing i was able to edit my post, but can you tell me how can i edit my orignal thread, thanks

1.<?php
2. session_start ();
3. include (“include/connect.php”);
4. include (“include/html_codes.php”);

  1. $x=$_GET [‘x’];

  2. function createMessage ($x) {

  3. if (is_numeric ($x)) {

  4. switch ($x) {

  5. case 0:

  6. $message= ‘your account is now active, you may now <a href=\"login.php\"Log In!</a>’

  7. break;

  8. case 1:

  9. $message=‘thank you for registering! a confermatioin e mail has been sent to your
    14 email account please clkick on the antivation link to activate our account.’;

  10. break;

  11. case 2:

  12. $message =‘that e mail adress or username has already been registered.’;
    18 break;

19 case 3:
20 $message= ‘sorry, that item has already been traded!’;
21 break;

22 case4:
23 $message = ‘item successfully updated!’;
24 break;

25 case 5:
26 $message = ‘item successfully deleted’;
27 break;

28 case 6:
29 $message =‘message has been sent’;
30 break;

31 case 7:
32 $message = ‘thank you for leaving feedback’;
33 break;

33 case 8:
34 $message = ‘item added successfully’;
35 break;

36 case 9:
37 $message =‘that is not your item’;
38 break;

39 }

40 echo $message;
41 endfor; (in this line it is showing the error and the error is Parse error: syntax error, unexpected T_ENDFOR)

42 break;
43
44 default:
45 break;
46 }
47. }
48.
49.
50. ?>
51.

  1. <!DOCTYPE html>
    [COLOR=#000080]53. <html lang =“en”>

  2. <head>

  3. <title>Prompt </title>

  4. <link rel=“stylesheet” href=“main.css”>

  5. <link rel=“stylesheet” href=“prompt.php”>

  6. </head>

  7. <body>
    60 <div id=“wrapper>”
    61 <?php headerAndSearchCode ();?>
    62 <div id=“outer”>

63 <div id=“inner”>[/COLOR]

64 <?php createMessage ($x); ?>
65 </div>
66 <?php footercode ();?>
67. </div>

  1. </body>
    69. </html>[/COLOR]

I reformatted your last posted code so it was easier for me to read.

I found you had “case4:” instead of “case 4:”

I don’t know if that will fix your problem or not, but it can’t hurt. Also, you were missing your closing </div> for the wrapper…

<?php
session_start ();
include ("include/connect.php");
include ("include/html_codes.php");

$x=$_GET ['x'];
function createMessage ($x) {
     if (is_numeric ($x)) {
          switch ($x) {

               case 0:
                    $message= 'your account is now active, you may now <a href=\\"login.php\\"Log In!</a>'
                    break;

               case 1:
                    $message='thank you for registering! a confermatioin e mail has been sent to your email account please clkick on the antivation link to activate our account.';
                    break;

               case 2:
                    $message ='that e mail adress or username has already been registered.';
                    break;

               case 3:
                    $message= 'sorry, that item has already been traded!';
                    break;

               case 4:
                    $message = 'item successfully updated!';
                    break;

               case 5:
                    $message = 'item successfully deleted';
                    break;

               case 6:
                    $message ='message has been sent';
                    break;

               case 7:
                    $message = 'thank you for leaving feedback';
                    break;

               case 8:
                    $message = 'item added successfully';
                    break;

               case 9:
                    $message ='that is not your item';
                    break;

          }

     echo $message;
     endfor; (in this line it is showing the error and the error is Parse error: syntax error, unexpected T_ENDFOR)
     break;

     default:
     break;
     }
}
?>
<!DOCTYPE html>
<html lang ="en">
     <head>
          <title>Prompt </title>
          <link rel="stylesheet" href="main.css">
          <link rel="stylesheet" href="prompt.php">
     </head>
     <body>
          <div id="wrapper>"
                         <?php headerAndSearchCode ();?>
               <div id="outer">
                    <div id="inner">
                         <?php createMessage ($x); ?>
                    </div>
                         <?php footercode ();?>
               </div>
          </div>
     </body>
</html>


thanks i corrected i closed my div as u said, and also i was using the wrong function endfor; thats why it was showing the error thanks, so now i am not using it anymore so its showing any error, thanks