Jump to content

href error in table


rocky48

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/263446-href-error-in-table/
Share on other sites

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>';

Link to comment
https://forums.phpfreaks.com/topic/263446-href-error-in-table/#findComment-1351062
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.