sihl Posted February 24, 2010 Share Posted February 24, 2010 I am trying to put a table in an array, that shows up using javascript when you mouse over it. Here is the function calling for the arrays. function show_rewards() { global $langs, $language, $reward_texts, $set_lang, $tab_rewards; echo "<script type=\"text/javascript\" src=\"http://wow-covenant.org/power.js\"></script> <table border=\"1\" cellspacing=\"1\" cellpadding=\"3\" align=\"center\"> <tr> <th colspan=\"3\">",$language["available_rewards"],"</th> </tr>"; foreach($tab_rewards as $key => $value) { if($value[2] > $_SESSION["points"]) $disabled = " disabled=\"disabled\""; else $disabled = ""; echo "<form action=\"index.php\" method=\"post\"><input type=\"hidden\" name=\"reward\" value=\"",$key,"\" /> <tr><td align=\"left\">"; if($value[0] && $value[3] >= 0) ---This is line 196--- echo $value[1]," x <a class=\"q",$value[3],"\" href=\"javascript:;","\" onmouseover=\"$WowheadPower.showTooltip(event, '$value[4],', '$value[5],')","\" onmousemove=\"$WowheadPower.moveTooltip(event)","\" onmouseout=\"$WowheadPower.hideTooltip();""\">",$reward_texts[$langs[$set_lang][2]][$key],"</a>"; else echo $reward_texts[$langs[$set_lang][2]][$key]; echo "</td> <td>",$value[2]," ",$language["points_2"],"</td> <td><input type=\"submit\" name=\"submit\" value=\"",$language["choose"],"\"",$disabled," /></td></tr></form>"; } echo "</table>"; } But using this I get the error "Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in C:\xampp\xampp\htdocs\vote\functions.php on line 196" I have indicated where line 196 is. Any help is greatly appreciated. Also, here is an example of the array of have set: 5 => array(92005,1,800,5,<table><tr><td><b class=q4>X-51 Nether-Rocket X-TREME</b><br />Unique<br />Mount<br />Requires Level 70<br />Requires <span class=q1>Riding</span> (300)<br />Item Level 70</td></tr></table><table><tr><td><span class=q2>Use: Teaches you how to summon this mount. Can only be summoned in Outland or Northrend. This is a very fast mount.</span></td></tr></table>,INV_Misc_MissileSmall_Red), Thanks, Avalon Link to comment https://forums.phpfreaks.com/topic/193187-help/ Share on other sites More sharing options...
xcandiottix Posted February 24, 2010 Share Posted February 24, 2010 It looks like the problem is that you are confusing the script with " and ' es. echo $value[1],' x <a class=\"q"',$value[3],"\" 'href=\"javascript:;"',"\" onmouseover=\"$WowheadPower.showTooltip(event, '$value[4],', '$value[5],')","\" onmousemove=\"$WowheadPower.moveTooltip(event)","\" onmouseout=\"$WowheadPower.hideTooltip();""\">",$reward_texts[$langs[$set_lang][2]][$key],"</a>'; maybe? Here's some code I recently did where I had a similiar error code and it ended up that my opening and closing of " and 's were wrong. while($result = mysql_fetch_array( $data )) { echo '<table width="100%" border="0">'; echo "<tr>"; echo '<th width="11%" scope="col">' . $result['Name'] . '</th>'; echo '<th width="11%" scope="col">' . $result["Engine"] . '</th>'; echo '<th width="11%" scope="col">' . $result["Model"] . '</th>'; echo '<th width="11%" scope="col">' . $result["About"] . '</th>'; echo '<th width="11%" scope="col">' . $result["Horsepower"] . '</th>'; echo '<th width="11%" scope="col">' . $result["Torque"] . '</th>'; echo '<th width="11%" scope="col">','<img src="http://www.dyno-charts.com/upload/' . $result["Chart"] . '"', 'width="140" height="115" />','</th>'; echo "</tr>"; echo "</table>"; } Hope that leads you in the right direction. K.Candiotti Link to comment https://forums.phpfreaks.com/topic/193187-help/#findComment-1017306 Share on other sites More sharing options...
sihl Posted February 24, 2010 Author Share Posted February 24, 2010 Thank you for your reply. I am sure that my problem is what you said, but I am stumped on where it's going wrong. Can anyone further help me in fixing this? Link to comment https://forums.phpfreaks.com/topic/193187-help/#findComment-1017319 Share on other sites More sharing options...
jl5501 Posted February 24, 2010 Share Posted February 24, 2010 I think you will find, you have commas, where you mean to have dots, to concatanate your strings for echo Link to comment https://forums.phpfreaks.com/topic/193187-help/#findComment-1017320 Share on other sites More sharing options...
sihl Posted February 24, 2010 Author Share Posted February 24, 2010 Do you mean like this? echo $value[1]." x <a class=\"q".$value[3]."\" href=\"javascript:;",onmouseover="$WowheadPower.showTooltip(event, '.$value[4].', '.$value[5].')" onmousemove="$WowheadPower.moveTooltip(event)" onmouseout="$WowheadPower.hideTooltip();""\">".$reward_texts[$langs[$set_lang][2]][$key]."</a>"; Link to comment https://forums.phpfreaks.com/topic/193187-help/#findComment-1017321 Share on other sites More sharing options...
jl5501 Posted February 24, 2010 Share Posted February 24, 2010 yes Link to comment https://forums.phpfreaks.com/topic/193187-help/#findComment-1017324 Share on other sites More sharing options...
sihl Posted February 24, 2010 Author Share Posted February 24, 2010 Hmm by doing this I still get this error " Parse error: syntax error, unexpected '=', expecting ',' or ';' in C:\xampp\xampp\htdocs\vote\functions.php on line 197" Link to comment https://forums.phpfreaks.com/topic/193187-help/#findComment-1017337 Share on other sites More sharing options...
sihl Posted February 24, 2010 Author Share Posted February 24, 2010 Bump Link to comment https://forums.phpfreaks.com/topic/193187-help/#findComment-1017359 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.