Jump to content

[SOLVED] Quick Syntax Question...


Solarpitch

Recommended Posts

Hey,

 

I am just trying to put the following into a php echo but it doesnt seem to work. How would I encapsulate this?

 


<td href='javascript:void(0);' onmouseover='return overlib(showRest('Property Results'), STICKY, MOUSEOFF, BACKGROUND, 'designs/popupbkground.png');' onmouseout='return nd();'>link</td>

Link to comment
https://forums.phpfreaks.com/topic/75426-solved-quick-syntax-question/
Share on other sites

Hey,

 

When I ran with this...

 

 

"<td href='javascript:void(0);' onmouseover='return overlib(showRest('Property Results'), STICKY, MOUSEOFF, BACKGROUND, 'designs/popupbkground.png');' onmouseout='return nd();'>link</td>";

 

it gave me...

 

syntax error

"return overlib(showRest("

 

Is there something missing?

Hi, I am not sure how thats supposed to be encapsulated? Not like this I take it...

 


echo <<< HEREDOC <td href='javascript:void(0);' onmouseover='return overlib(showRest('Property Results'), STICKY, MOUSEOFF, BACKGROUND, 'designs/popupbkground.png');' onmouseout='return nd();'>link</td> HEREDOC;

try this

 

<?php 

echo <<< HEREDOC
<td href='javascript:void(0);' onmouseover="return overlib(showRest('Property Results'), STICKY, MOUSEOFF, BACKGROUND, 'designs/popupbkground.png');" onmouseout="return nd();">link</td>
HEREDOC;
?>

Yes, here's the actual function in which its been called...

 

 


function random_results()
{
dbconnect();

$row2 = array();

$sql = "SELECT * FROM property_info ORDER BY RAND() LIMIT 3";
$result = mysql_query($sql) or die(mysql_error());

while(($row = mysql_fetch_row($result)) != false) 
	{
	$location = $row[2]; $location = getlocationname($location);
	$type = $row[3]; $type = gettypename($type);

	    echo "<table width='140' id='random_results' border='0' cellpadding='0' cellspacing='0'>";
		    echo "<tr>";
   		    echo "<td href='javascript:void(0);' onmouseover='return overlib(showRest2(" . $row[18] . " ," . $row[3] ."), MOUSEOFF, BACKGROUND);' onmouseout='return nd();'>link</td>";
    		echo "</tr>";
		echo "<tr>";
   		    echo "<td>€". $row[4] . ", " . $row[18] . " Bedrooms</td>";
    		echo "</tr>";

        }

    $table .= "</table>";
    return $table;


}


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.