Solved

HTML , open new page with content from database

Posted on 2013-01-16
2
154 Views
Last Modified: 2013-01-16
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 "www.experts-exchange.com", it shows the content of $message


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

Your help is really appreciated.
Screen-Shot-2013-01-16-at-10.18..png
0
Comment
Question by:fparvini
  • 2
2 Comments
 

Author Comment

by:fparvini
ID: 38783901
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
0
 

Accepted Solution

by:
fparvini earned 0 total points
ID: 38784532
Hi,

Fixed it

$message = mysql_result($result,$i,"Message");
        $message = nl2br(preg_replace('#(\\r\\n|\\r|\\n)#', '<br/>', $message));
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now