Why do i get a syntax error when i try to run this code?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • scott dieken
    New Member
    • Sep 2010
    • 5

    #1

    Why do i get a syntax error when i try to run this code?

    Code:
    x=3
    title = "PHP Programing"
    author = "LERDORF"
    publisher = "oreily"
    major = "cent"
    outfile = open("book.html","w")
    outfile.write ('<html>\n')
    outfile.write ('     <body>\n')
    while ( x > 1 ):
        outfile.write('     <p class= "title">' + title +'</p>\n')
        outfile.write('     <p class= "author">' + author +'</p>\n')
        outfile.write('     <p class= "publisher">' + publisher '</p>\n')
        x = x - 1
    outfile.write ('     </body>\n')
    outfile.write ('     </body>\n')
    outfile.close()
  • scott dieken
    New Member
    • Sep 2010
    • 5

    #2
    I found the missing plus sign.
    thanks
    scott

    Comment

    Working...