Hi all,
I use a database to extract the title of a url. I want to take save this title in a variable and then check if it is url1 or url2.
If it is url1 call url1 javascript function else if url2 call url2 function.
My code is :
Code: $query = "SELECT url FROM info";
$row = mysql_fetch_array($result);
if ($row['url']=='http://....')
{
echo '<A HREF="';
echo '<script LANGUAGE="javascript">';
//http://www.infysolutions.com
echo 'popUp("url1.php")';
echo "</SCRIPT>";
echo '">';
}
if($row['url']=='http://...')
{
echo '<A HREF="';
echo '<script LANGUAGE="javascript">';
echo 'popUp("url2.php")';
echo "</SCRIPT>";
echo '">';
}
What is the error??
Thanking you in advance
----------------------------------------------
Outsourcing software development
Simple question for PHPSimple question for PHP
Page 1 of 1
3 Replies - 1082 Views - Last Post: 17 December 2008 - 06:03 AM
Replies To: Simple question for PHP
#2
Re: Simple question for PHP
Posted 17 December 2008 - 03:43 AM
Ok,
I don't think that the javascript code is correct. I am assuming that you have a function defined by the name of popUp?
Your html code is incorrect which is why it isn't popping up
Try making the code output something like this
See if that works
Danny
I don't think that the javascript code is correct. I am assuming that you have a function defined by the name of popUp?
Your html code is incorrect which is why it isn't popping up
Try making the code output something like this
<a href='' onclick="java script:popUp('http://www.google.co.uk')">Test Link</a>
See if that works
Danny
#3
Re: Simple question for PHP
Posted 17 December 2008 - 05:56 AM
This is a great ad for your Outsourcing Company!
#4
Re: Simple question for PHP
Posted 17 December 2008 - 06:03 AM
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|