Dynamic Button Generation
Results 1 to 3 of 3

Thread: Dynamic Button Generation

  1. #1
    Senior Member
    Join Date
    Jan 2006
    Posts
    125

    Dynamic Button Generation

    Hi everyone

    I am trying to develop a table that displays all of the members of my site row by row with their first and last names and a button to delete them. On line 20 where I am trying to generate a form I get a parse error, unexpected T_STRING. I can not see why this is occuring, can anyone help me?

    PHP Code:
    <tr>
           <td width="780" colspan="4" border="1" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">  
            
        <?PHP
           
    $query 
    "select * from members";
         
    $rs mysql_query($query);    
             
    $list "<table width=\"760\" colspan=\"4\" border=\"0\" cellpadding=\"2\" bgcolor=\"#FFFFFF\">";
         
    $list .= "<tr><th>First Name</th>";
         
    $list .= "<th>Last Name</tr>";
         
    $list .= "<th>Delete</th></tr>";

    while ( 
    $row mysql_fetch_array($rs))
    {
        
    $list .= "<tr>";
        
    $list .= "<td>".$row["fname"]."</td>";    
        
    $list .= "<td>".$row["sname"]."</td>";
        
    $list .= "<td> <form action="viewmembers.php" method="post"> 
    <input type="
    submit" name="submit"> <input type="hidden" name="user"
     value="
    .echo $row['memid']."> </form> </td>";      
    $list .= "</tr>";
    }

    $list .= "</table>";

    echo (
    $list); 

            
    ?>
           </td> 
    </tr>

  2. #2
    Senior Member
    Join Date
    Apr 2005
    Posts
    490
    You didn't escape your quotes on one of the lines!

    try:
    PHP Code:
    <tr> 
           <td width="780" colspan="4" border="1" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">   
             
        <?PHP 
            
    $query 
    "select * from members"
         
    $rs mysql_query($query);     
             
    $list "<table width=\"760\" colspan=\"4\" border=\"0\" cellpadding=\"2\" bgcolor=\"#FFFFFF\">"
         
    $list .= "<tr><th>First Name</th>"
         
    $list .= "<th>Last Name</tr>"
         
    $list .= "<th>Delete</th></tr>"

    while ( 
    $row mysql_fetch_array($rs)) 

        
    $list .= "<tr>"
        
    $list .= "<td>".$row["fname"]."</td>";     
        
    $list .= "<td>".$row["sname"]."</td>"
        
    $list .= "<td> <form action=\"viewmembers.php\" method=\"post\"> 
    <input type=\"submit\" name=\"submit\"> <input type=\"hidden\" name=\"user\" 
    value=\".echo 
    $row['memid'].\"> </form> </td>";       
    $list .= "</tr>"


    $list .= "</table>"

    echo (
    $list); 

            
    ?> 
           </td> 
    </tr>

  3. #3
    Senior Member
    Join Date
    Jan 2006
    Posts
    125
    Thank you very much as you might have guessed im still new to this but wont make the same mistake again.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •