Jump to content

Java and PHP. Doing something wrong


timmah1

Recommended Posts

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

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>

 

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.