Welcome to WebmasterWorld Guest from 54.160.131.144

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

resizable browser window code snippet within php doesn't work

     

KatrinR

12:02 am on Nov 17, 2007 (gmt 0)

5+ Year Member



Hello all,

I am a php/mysql beginner.

My design: a box with one FAQ gives the option to read "more", upon clicking "more" a new resized (smaller) browser window opens to display all FAQ.
I found some code that does the resizing. It works well outside the php code, yet upon integrating it into the php code it doesn't work. "more" displays fine, yet nothing happen after clicking it. Is it maybe the ";" within the resizing code snippet? Your help is so very much appreciated.

...
$query = "SELECT question,answer FROM faq WHERE faqid=1";

$result = mysql_query($query) or die('Sorry, could not get faq at this time');
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$question= $row['question'];
$answer=$row['answer'];

echo"<p class=\"head\">Q.:$question</p>\n";
echo"<p class=\"last\"><span>A.:</span> $answer<br>
<a href=\"content/faq.php\" onClick=\"popup = window.open('content/faq.php', 'PopupPage', 'height=200,width=500,scrollbars=yes,resizeable=no'); return false\" target=\"_blank\">more >></a></p>\n";
}

?>

Thank you,
Katrin

PHP_Chimp

5:56 pm on Nov 17, 2007 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



Dont you just need -
onClick=\"window.open('content/faq.php', 'PopupPage', 'height=200,width=500,scrollbars=yes,resizeable=no'); return false\"
Remove the popup = bit.

KatrinR

9:16 pm on Nov 19, 2007 (gmt 0)

5+ Year Member



That was it! Thank you so much, PHP_Chimp!

Katrin