Results 1 to 1 of 1

Thread: simple syntax error here?

  1. #1
    Join Date
    Jun 2008
    Posts
    16
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default simple syntax error here?

    SOLVED, THANK YOU

    I put together a small php script within an HTML page, and I'm getting a bunch of the PHP code showing up on the HTML page, which makes me assume I have a syntax error or stray quotes somewhere. But I can't seem to figure out my mistake. Attached is a screenshot of the HTML output, below is the code. Thanks for any suggestions.

    PHP Code:
        <?php
        
            
    if (isset($_POST['createTable'])) {
                
    //create initial table    
                
    echo "<table>";
                
    //set variables from form input
                
    $rows $_POST['rows'];
                
    $columns $_POST['columns'];
                
    //loop to create rows
                
    for ($r 1$r <= $rows$r++) {
                    echo 
    "<tr>";
                    
    //loop to create columns
                    
    for ($c 1$c <= $columns$c++) {
                        echo 
    "<td>&nbsp;</td>";
                    }
                    echo 
    "</tr>";
                }
                echo 
    "</table>";
            }
            
        
    ?>
    Last edited by tk403; 10-05-2009 at 09:19 PM.

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
  •