Jump to content

What am I doing 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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.