Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Another PHP question!

  • 04-04-2005 12:29pm
    #1
    Registered Users, Registered Users 2 Posts: 23,641 ✭✭✭✭


    New to PHP and I am trying to print out a form, with multiple checkboxes. I have successfully used PHP to run options in a drop down menu. However I am still having problems in print to the screen any kind of form through php.

    print "<tr>
    <td>
    <input type="submit" name="Delete" value="Submit" />
    </td>
    <td>
    <b>Product ID</b>
    </td>
    <td>
    <b>Name</b>
    </td>
    <td>
    <b>Description</b>
    </td>
    <td>
    <b>Picture</b>
    </td>
    <td>
    <b>Category</b>
    </td>
    <td>
    <b>Supplier</b>
    </td>
    <td>
    <b>AdminID</b>
    </td>
    </tr>";

    if($r = mysql_query($query)){
    while($row = mysql_fetch_array($r)){

    print "<tr>
    <td><input type="checkbox" name="delete[{$row}]" value="{$row}" />
    </td>
    <td>{$row}</td>
    <td>{$row}</td>
    <td>{$row}</td>
    <td>{$row}</td>
    <td>{$row}</td>
    <td>{$row}</td>
    <td>{$row}</td>
    </tr>";

    The form and table opening tags lie outside the php code. I have seperated the code for easy reading.


Comments

  • Registered Users, Registered Users 2 Posts: 68,317 ✭✭✭✭seamus


    What happens when you run it?


  • Moderators, Politics Moderators Posts: 41,235 Mod ✭✭✭✭Seth Brundle


    print "<tr>
    <td><input type="checkbox" name="delete[{$row['ProductID']}]" value="{$row...
    
    you say that you have stripped some of the tags etc. but are you sure that before stripping you have not accidentally left it like it is above - where the quotes in type="checkbox" isn't escaped into type=\"checkbox\"


  • Registered Users, Registered Users 2 Posts: 23,641 ✭✭✭✭Elmo


    Parse error: parse error, unexpected T_STRING in /hsphere/local/home/madraci/mad-racing.com/delete.php on line 23


    BLA BLA BLA going insance :D

    Line 23 = the first print statement. If I take away the form tag complete in both print statement the table run fine.


  • Registered Users, Registered Users 2 Posts: 23,641 ✭✭✭✭Elmo


    you say that you have stripped some of the tags etc. but are you sure that before stripping you have not accidentally left it like it is above - where the quotes in type="checkbox" isn't escaped into type=\"checkbox\"

    Thank you! It always the simple things. :D


Advertisement