Solved

HTML , open new page with content from database

Posted on 2013-01-16
2
158 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
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…

749 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