Please contact (802) 224 - 6525 for price quotes and programming support.
Follow this link for a resume of php and Mysql Programing experience
Digg This!

0 Members and 1 Guest are viewing this topic. « previous next »

Pages: [1] Go Down Print
Author Topic: Quick Syntax Question...  (Read 5265 times)
Web Designer in need of help
Full Member
***

Karma: 1
Offline Offline

Posts: 135


View Profile
« on: October 31, 2007, 07:07:07 PM »

Hey,

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


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

Logged
superwebdesigner
Full Member
***

Karma: 0
Offline Offline

Posts: 194


View Profile
« Reply #1 on: October 31, 2007, 07:09:33 PM »

Hey,

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


Code:

Code:
1 <td href='javascript:void(0);' onmouseover='return overlib(showRest('Property Results'), STICKY, MOUSEOFF, BACKGROUND, 'designs/popupbkground.png');' onmouseout='return nd();'>link</td>
Logged
Web Designer in need of help
Full Member
***

Karma: 1
Offline Offline

Posts: 135


View Profile
« Reply #2 on: October 31, 2007, 07:10:55 PM »

Thats the way I was trying it alright but I still cant get my pop up called. It works when the script is not in an echo statement but doesnt when it is like above.... strange 
Logged
superwebdesigner
Full Member
***

Karma: 0
Offline Offline

Posts: 194


View Profile
« Reply #3 on: October 31, 2007, 07:12:13 PM »

Well, there is no php issue there.
Logged
Web Designer in need of help
Full Member
***

Karma: 1
Offline Offline

Posts: 135


View Profile
« Reply #4 on: October 31, 2007, 07:14:03 PM »

Hey,

When I ran with this...



Code:
Code:
1 "<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?
Logged
superwebdesigner
Full Member
***

Karma: 0
Offline Offline

Posts: 194


View Profile
« Reply #5 on: October 31, 2007, 07:15:17 PM »

Can anyone help with this?
Logged
Web Designer in need of help
Full Member
***

Karma: 1
Offline Offline

Posts: 135


View Profile
« Reply #6 on: October 31, 2007, 07:17:17 PM »

try this


Code:
Code:
1 echo <<< HEREDOC
2 <td href='javascript:void(0);' onmouseover='return overlib(showRest('Property Results'), STICKY, MOUSEOFF, BACKGROUND, 'designs/popupbkground.png');' onmouseout='return nd();'>link</td>
3 HEREDOC;
Logged
superwebdesigner
Full Member
***

Karma: 0
Offline Offline

Posts: 194


View Profile
« Reply #7 on: October 31, 2007, 07:19:19 PM »

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


Code:

Code:
1 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;
Logged
Web Designer in need of help
Full Member
***

Karma: 1
Offline Offline

Posts: 135


View Profile
« Reply #8 on: October 31, 2007, 07:20:54 PM »

try this


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

7 
8 
Logged
superwebdesigner
Full Member
***

Karma: 0
Offline Offline

Posts: 194


View Profile
« Reply #9 on: October 31, 2007, 07:24:53 PM »

No, still no joy. Just seems to crash the page now. It works perfect when its not been echoed so I cant understand what the problem is
Logged
Web Designer in need of help
Full Member
***

Karma: 1
Offline Offline

Posts: 135


View Profile
« Reply #10 on: October 31, 2007, 07:29:11 PM »

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



Code:

Code:
1  function random_results()
2  {
3   dbconnect();
4  
5   $row2 = array();
6  
7   $sql = "SELECT * FROM property_info ORDER BY RAND() LIMIT 3";
8   $result = mysql_query($sql) or die(mysql_error());
9  
10  while(($row = mysql_fetch_row($result)) != false)
11  {
12  $location = $row[2]; $location = getlocationname($location);
13  $type = $row[3]; $type = gettypename($type);
14 
15      echo "<table width='140' id='random_results' border='0' cellpadding='0' cellspacing='0'>";
16      echo "<tr>";
17         echo "<td href='javascript:void(0);' onmouseover='return overlib(showRest2(" . $row[18] . " ," . $row[3] ."), MOUSEOFF, BACKGROUND);' onmouseout='return nd();'>link</td>";
18     echo "</tr>";
19  echo "<tr>";
20         echo "<td>€". $row[4] . ", " . $row[18] . " Bedrooms</td>";
21     echo "</tr>";
22 
23         }
24 
25     $table .= "</table>";
26     return $table;
27 
28 
29 }

 
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
TinyPortal v0.9.8 © Bloc
Christmas2006 design by Bloc
Page created in 0.27 seconds with 29 queries.