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/97678-what-am-i-doing-wrong/ Share on other sites More sharing options...
haku Posted March 25, 2008 Share Posted March 25, 2008 This is my code, but it keeps telling me that there is no order, what am I dong wrong? Its always best to give us the actual error rather than your interpretation of it - "there is no order" could mean a number of different things. And for that matter, is the error a javascript error or a php error? Here are some potential problems: - $rand_str is an empty variable - You have set the href value of the link to print.php?order=________, but the URL you are passing to your function is only print.php. You haven't passed the order variable to print.php, so if the page print.php is looking for that variable, it wont find it - you are using the 'language' attribute in your script tag. Its deprecated and shouldnt be used. This almost definitely isn't your problem, but should still be fixed. - you didn't add the word 'var' before declaring the variable 'newwindow'. This also very likely isn't your problem, but should be fixed. Link to comment https://forums.phpfreaks.com/topic/97678-what-am-i-doing-wrong/#findComment-500109 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.