Link to home
Start Free TrialLog in
Avatar of fparvini
fparvini

asked on

HTML , open new page with content from database

Hi ,
I am getting the some data from my database using this

       $date_  =mysql_result($result,$i,"Date");
       ...
        $message =mysql_result($result,$i,"Message");

When displaying , I want by clicking on date, a new window opens and its content is the $message ,
so instead of displaying the content of "https://www.experts-exchange.com", it shows the content of $message


<td><a href="https://www.experts-exchange.com" target="_blank"><?echo $date_ ?></a></td>

Your help is really appreciated.
Screen-Shot-2013-01-16-at-10.18..png
Avatar of fparvini
fparvini

ASKER

Hi,
I tried this

<script>
function openWin(content)
{
myWindow=window.open('','','width=600,height=600');
myWindow.document.write(content);
myWindow.focus();
}
</script>

<td><a href="#" onclick='openWin("<?php echo $message?>")';return false"><?echo $date_ ?></a></td>


but get error message
ASKER CERTIFIED SOLUTION
Avatar of fparvini
fparvini

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial