Jump to content

href error in table


Go to solution Solved by HDFilmMaker2112,

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

  • Solution

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.