Forum Moderators: coopster

Message Too Old, No Replies

php and javascript

         

bysonary

7:59 pm on Feb 22, 2007 (gmt 0)

10+ Year Member



I have basic java script popup link function, here it is.

<script language="javascript" type="text/javascript">
function popitup(url)
{
newwindow=window.open(url,'name','height=200,width=150');
if (window.focus) {newwindow.focus()}
return false;
}
</script>

then later in the code i have this line.


echo '<a href="question.php?qid='.$row['qid'].' onClick="return popitup('viewpage.php?qid='.$row['qid'].'')">Click here</a> to start the quote calculator</b></center><br>';

I suspect that all the quotes in this line of code are messed up, could someone help me get this line of code right?

I would appreciate it

Thanks

eelixduppy

8:00 pm on Feb 22, 2007 (gmt 0)



Something like this should work correctly:

echo '<a href="question.php?qid='.$row['qid'].' onClick="return popitup(\'viewpage.php?qid='.$row['qid'].'\')">Click here</a> to start the quote calculator</b></center><br>';

Good luck! :)

bysonary

12:24 pm on Feb 23, 2007 (gmt 0)

10+ Year Member



cheers mate

I have a question, if i use a php page in a popup window created in the way i have done above, can i still pass sessionm variables between the popup pages? like if i open a popup and set a session variable to 0 then when i click next in the popup window it ads 1 to the session variable so it is remembered when it gets to the next page of the popup window?

eelixduppy

1:40 pm on Feb 23, 2007 (gmt 0)



As long as you are declaring and incrementing the session variable properly in viewpage.php, then sure, I don't see why not :)

bysonary

4:10 pm on Feb 23, 2007 (gmt 0)

10+ Year Member



cheers mate :-)