rocky48 Posted May 31, 2012 Share Posted May 31, 2012 I have rewritten a script to include a link in a table, but it comes up with a parse error: unexpected T_STRING //create the display string $display_block = " <p> The Event Type is <b> '".$Event_Name."'</b> </p> <table width=\"70%\" cellpadding=\"3\" cellspacing=\"1\" border=\"1\" BGCOLOR=\"#87CEEB\" > <tr> <th>ID</th> <th>VERSE</th> <th>MOOD/SUB TYPE</th> <th>Link</th> </tr>"; while ($Verse_info = mysqli_fetch_array($get_Event_res)) { $Verse_id = $Verse_info['versesID']; $Verse_text = nl2br(stripslashes($Verse_info['Verse'])); $Mood_info = $Verse_info['Event_Sub_Type']; //add to display $display_block .= " <tr> <td width=\"1%\" valign=\"top\">".$Verse_id."<br/></td> <td width=\"55%\" valign=\"top\">".$Verse_text."<br/></td> <td width=\"35%\" valign=\"top\">" .$Mood_info."<br/></td> <td width=\"9%\" valign=\"top\"> <a href="Size_Menu.html">Click here to choose</a> </td> </tr>"; } Can't see what is wrong! Am I missing something? Quote Link to comment https://forums.phpfreaks.com/topic/263446-href-error-in-table/ Share on other sites More sharing options...
requinix Posted May 31, 2012 Share Posted May 31, 2012 You didn't escape the quotes in the link HTML. Quote Link to comment https://forums.phpfreaks.com/topic/263446-href-error-in-table/#findComment-1350138 Share on other sites More sharing options...
rocky48 Posted June 4, 2012 Author Share Posted June 4, 2012 I put a quote after > (near top), but still get the same error? Am I being really thick! Quote Link to comment https://forums.phpfreaks.com/topic/263446-href-error-in-table/#findComment-1351055 Share on other sites More sharing options...
Solution HDFilmMaker2112 Posted June 4, 2012 Solution Share Posted June 4, 2012 This: <a href="Size_Menu.html">Click here to choose</a> </td> Should be this: <a href=\"Size_Menu.html\">Click here to choose</a> </td> Or use single quotes around everything: $display_block .=' <tr> <td width="1%" valign="top">'.$Verse_id.'<br/></td> <td width="55%" valign="top">'.$Verse_text.'<br/></td> <td width="35%" valign="top">'.$Mood_info.'<br/></td> <td width="9%" valign="top"><a href="Size_Menu.html">Click here to choose</a></td> </tr>'; Quote Link to comment https://forums.phpfreaks.com/topic/263446-href-error-in-table/#findComment-1351062 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.