Jump to content

Recommended Posts

hi,

i have a mysql table called footers.it's fields are as follows
id--caption--content
1--aboutus--some company info
2--privacy--privacy info
3--copyright--copyright info

here i retrieved all the captions from table and print in the footer position on my form as footer menu.what i want to do actually is when i click aboutus,it should open small window and display the aboutus content from mysql table,similarly when i click privacy,it should open a small window and should display privacy info like that.everything i did,but when i click aboutus,it shows all the three records from table.i want to display uniquely.means if i click aboutus it should display only aboutus info in small window like that..any of your help will be greatly appreciated

here is my code
<?php
$conn4=mysql_connect("localhost","","");
mysql_select_db("jrm",$conn4);
$sql="SELECT * FROM footers";
$result=mysql_query($sql,$conn4) or die (mysql_error());
echo "<center><table border='0' style='text-align:left;'><tr>";
while($newarray=mysql_fetch_array($result))
{
$caption=$newarray['caption'];


echo "<center><a style='text-decoration:underline;'
href onclick=window.open('xyz.php','','top=200,left=350,screenY=0,screenX=0,width=400,height=300,scrollbars=yes');>
<td><font color='white'><b>".$caption. "&nbsp;&nbsp;</b></font></td></a></center>";
}
echo "</tr></table></center>";
?>


xyz.php
------
<?php


$conn4=mysql_connect("localhost","","");
mysql_select_db("jrm",$conn4);
$sql="SELECT * FROM footers";
$result=mysql_query($sql,$conn4) or die (mysql_error());
while($newarray=mysql_fetch_array($result))
{
$caption=$newarray['caption'];
$content=$newarray['content'];

echo "<center><b><u><font color='navy'>".$caption."</font></b></u><br><font color='green'>".$content."</font></center>";
}

?>

is it possible without using xyz.php file,i will display the $content in small window directly

thanks
mrjameer
Link to comment
https://forums.phpfreaks.com/topic/33202-handling-onclick-windowopen/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.