Php syntax error?
Posted: Tue Apr 28, 2009 11:30 am
I have no idea where to post it because this issue involves php, html and javascript.
Anyway im trying to hide a content returned from the MySQL db.
But it wont work, either its a syntax error or crappy javascript.
Firstly picture will be displayed. Then its links. My goal is to hide the links by default and display em on IMAGE mouse over:
(Bold not working, look for the tags). Thanks for any help.
Anyway im trying to hide a content returned from the MySQL db.
But it wont work, either its a syntax error or crappy javascript.
Firstly picture will be displayed. Then its links. My goal is to hide the links by default and display em on IMAGE mouse over:
(Bold not working, look for the tags).
Code: Select all
[b]<script type="text/javascript" src="javascripts/showhide.js"></script>[/b]
<?php
session_start();
require_once "globalconfig.php";
$result = mysql_query("SELECT * FROM defaultbooks ORDER BY ID");
while($r=mysql_fetch_array($result)){
$filename=$r["filename"];
$url=$r["url"];
echo "<a href='http://$url' target='_blank'><img src='images/bookmarks/default/$filename' [b]onMousehover='showHide(/'hidden_div/'); return false;'[/b] border='0' width='130'></a>
<br><a href='user_bookmarks_href_add.php?filename=$filename' target='contentframe'>
<img src='images/main/link.png' border='0'></a><br>";
if(isset($_COOKIE['user1'])){ ?>
[b]<div id="hidden_div" style="display: none;">[/b]
<?php $ename = $_COOKIE['user1'];
$getlinks = mysql_query("SELECT * FROM booklinks WHERE ename = '$ename' AND filename = '$filename' ORDER BY ID");
while($linkdata=mysql_fetch_array($getlinks)){
$lurl=$linkdata["url"];
echo "<a href='http://$lurl' target='_blank'>$lurl</a><br>"; [b]?></div><?php[/b]
}}}
if(isset($_COOKIE['user1'])){ ?>
<?php $ename = $_COOKIE['user1'];
$userbooks = mysql_query("SELECT * FROM userbooks WHERE ename = '$ename' ORDER BY ID");
while($data=mysql_fetch_array($userbooks)){
$ufilename=$data["filename"];
$uurl=$data["url"];
echo "<a href='http://$uurl' target='_blank'>
<img src='images/bookmarks/users/$ufilename' border='0' vspace='2' width='130'></a>
<br><a href='user_bookmarks_href_add.php?filename=$ufilename' target='contentframe'>
<img src='images/main/link.png' border='0'></a><br>";
$ename = $_COOKIE['user1'];
$getlinks = mysql_query("SELECT * FROM booklinks WHERE ename = '$ename' AND filename = '$ufilename' ORDER BY ID");
while($linkdata=mysql_fetch_array($getlinks)){
$lurl=$linkdata["url"];
echo "<a href='http://$lurl' target='_blank'>$lurl</a><br>";
}}} ?>