//Sorry about the name, hit enter too early >.< Should be 'adding a link to PHP'
[indexphp.php]
<?php
if($_GET['act'] == "generate_quotes") {
$con = mysql_connect("*", "*", "*");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("quote", $con);
$result = mysql_query( " SELECT * FROM `quote` ORDER BY RAND() LIMIT 0,1 " );
while($row = mysql_fetch_array($result))
{
echo '<span class="pink">' . $row['q_quote'] . "</span>";
}
echo "</table>";
mysql_close($con);
echo '<a href="#lb1"><img src="1s.jpg" alt="LightBox" align="right" /></a>';
} else {
echo "<img src=\"img/vpbgt.png\">";
}
?>
</div>
<a href="indexphp.php?act=generate_quotes" class="style2">Generate</a>
Above is the php and link to generate it
<div id="lb1" class="lb"><a href="#top"><img src="1.jpg" alt="oh man" /></a></div>
And there is the div outside the wrap to make the screen dark.
What I'm trying to do is when the user click the generate the text, it ALSO dakrnes the screen, i thought this would work, which it does, but not exactly now I want it to.
What's happening is that it's using the link, because along with the echo'd content from the db is the little thumbnail image that the user can click to make a screen dark. But is there anyway to have it so when the user clicks the 'generate' link it darkens automatically?
SO when the user clicks:
<a href="indexphp.php?act=generate_quotes" class="style2">Generate</a>
the code acts as though:
<a href="#lb1"><img src="1s.jpg" alt="LightBox" align="right" /></a>
Has been clicked at the same time? So the screen darkens and the text is generated together?