Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

HTML , open new page with content from database

Posted on 2013-01-16
2
Medium Priority
?
163 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

824 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