I've added php/mysql to a site with a load of personal profiles. Originally, I had to make a page for each one, and then set up a link for each profile on an index page. It was a hell of a lot of work 😉. So now I've condensed it into 2 files: profilelist.php, the index of all the profiles, and profile.php, which has an individual's profile on it.
This is the code I've used on the index page (all the html on either side taken out):
<?php
include("connect.php");
sql_connect();
sql_accessdb();
$result = @mysql_query("SELECT name, pid FROM profiles ORDER BY name");
if (! $result) {
print "Database Error: " . mysql_error();
exit();
}
print "<p align=\"center\"><font color=\"#FFFFFF\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">";
while ( $row = mysql_fetch_array($result)) {
print "<a href=\"profile.php\" onClick=\"MM_openBRWindow('profile.php?id=" . $row["pid"] . "','','resizable=yes,width=600,height=600')\">" . $row["name"] . "</a><br>";
}
?>
Now, when I go to the page and test it out: All the names show up nicely, so thats fine. However, when I click on of the names (which is supposed to open a pop-up window with the info in it), nothing happens.
However if I replace
print "<a href=\"profile.php\" onClick=\"MM_openBRWindow('profile.php?id=" . $row["pid"] . "','','resizable=yes,width=600,height=600')\">" . $row["name"] . "</a><br>";
with
print "<a href=\"profile.php?id=" . $row["pid"] . "\">" . $row["name"] . "</a><br>";
(causing it to open the profile page in the same window, rather than a pop-up) it works fine.
Is there some sort of incapatability with using pop-up windows in the way I have? Or have I (most likely) screwed up somewhere in the code? Any help appreciated,
Cheers,