timmah1 Posted March 24, 2008 Share Posted March 24, 2008 I'm trying to print a page from a MySQL database using java and php. This is my code, but it keeps telling me that there is no order, what am I dong wrong? <script language="javascript" type="text/javascript"> <!-- function popitup(url) { newwindow=window.open(url,'name','height=300,width=300'); if (window.focus) {newwindow.focus()} return false; } // --> </script> And the print function here <a href="print.php&order=<?php echo $rand_str; ?>" onclick="return popitup('print.php')" >Print this record</a> || <a href="?cid=home">Continue</a> Any help would be greatly appreciated. Thanks in advance Link to comment https://forums.phpfreaks.com/topic/97680-java-and-php-doing-something-wrong/ Share on other sites More sharing options...
alexL Posted March 24, 2008 Share Posted March 24, 2008 So what you do is when the link is clicked the onclick() event is fired, a new popup window opens loading the print.php script ( return popitup('print.php') ), and the link never redirects the page to the actual print.php with correct print parameters, right? Why do you need a popup at all? Maybe I don't get it, but I think you should be fine with only of of them, either: <a href="#" onclick="return popitup('print.php&order=<?php echo $rand_str; ?>')">Print this record</a> || <a href="?cid=home">Continue</a> OR <a href="print.php&order=<?php echo $rand_str; ?>">Print this record</a> || <a href="?cid=home">Continue</a> Link to comment https://forums.phpfreaks.com/topic/97680-java-and-php-doing-something-wrong/#findComment-499865 Share on other sites More sharing options...
timmah1 Posted March 24, 2008 Author Share Posted March 24, 2008 The reason for the pop-up is so it only prints the record information, not the header, links, etc. When the pop-up comes up, it just pulls the information from the database associated with that id number, and that's it. That's why I need to have the pop-up Link to comment https://forums.phpfreaks.com/topic/97680-java-and-php-doing-something-wrong/#findComment-499873 Share on other sites More sharing options...
BlueSkyIS Posted March 24, 2008 Share Posted March 24, 2008 <a href="print.php?order=<?php echo $rand_str; ?>" onclick="return popitup('print.php?order=<?php echo $rand_str; ?>')">Print this record</a> p.s., it's Javascript, not Java. I almost didn't even click in seeing Java. Link to comment https://forums.phpfreaks.com/topic/97680-java-and-php-doing-something-wrong/#findComment-499883 Share on other sites More sharing options...
timmah1 Posted March 24, 2008 Author Share Posted March 24, 2008 Thank you BlueSkyIS. You've definitely been very helpful to me today!!! Link to comment https://forums.phpfreaks.com/topic/97680-java-and-php-doing-something-wrong/#findComment-499888 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.