Jump to content

Archived

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

darga333

is there a way to print through php without that window poping up that asks how many pages to print?

Recommended Posts

hi i want to print a page only once

is there a way to print directly through php without using that print dialog box that pops up?? because i only want the user to be able to print 1 page. not multiple pages

Share this post


Link to post
Share on other sites
nope. that's a client side thing. it's built into the OS. At least, you can't do that through php, anyways. You might possibly be able to do it with javascript or an applet or possibly some vbscript but I don't know. But not with php.

Share this post


Link to post
Share on other sites
[!--quoteo(post=370701:date=May 2 2006, 04:53 PM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ May 2 2006, 04:53 PM) [snapback]370701[/snapback][/div][div class=\'quotemain\'][!--quotec--]
nope. that's a client side thing. it's built into the OS. At least, you can't do that through php, anyways. You might possibly be able to do it with javascript or an applet or possibly some vbscript but I don't know. But not with php.
[/quote]

what would you recommend typing into google for a solution? is there any technical term that I should be using? see we have these certificates that we only want the user to print one of them. and then not the page will no longer be available to keep them from printing multiples

Share this post


Link to post
Share on other sites
Might take a look here, but pay attention to the caveats

[a href=\"http://www.tek-tips.com/viewthread.cfm?qid=568726\" target=\"_blank\"]http://www.tek-tips.com/viewthread.cfm?qid=568726[/a]

Lite...

Share this post


Link to post
Share on other sites
well... depending on what these certificates are used for...

for instance, do you mean it's a coupon for like 10% off a product or something?

you could always track keep info in the db along with the user's other information that says whether they've used one before or not.

you could also track their IP address and make your script not display the certificate at all to the same IP address. But people can get around this if they really wanted to, if they go through a proxy server.

I mean, I guess it just depends on what these certificates are used for. If you give some more details we might be able to find some other means for people to not necessarily print them, but USE them.

Share this post


Link to post
Share on other sites
Hey I am sorry I wasnt more specific. My appologies for that. These certificates are generated with php, they are certificates for free prizes. 1 certificate might be a free pizza, one might be a free oil change, etc. so we only want them printing the certificate once. currently we have a print button for them. when they click it, it allows them to select how many copies they want. This is not good because they can print the certificate multiple times. Any suggestions on how to make sure that the person that wins the certificate can only print it once?

[!--quoteo(post=370749:date=May 2 2006, 07:25 PM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ May 2 2006, 07:25 PM) [snapback]370749[/snapback][/div][div class=\'quotemain\'][!--quotec--]
well... depending on what these certificates are used for...

for instance, do you mean it's a coupon for like 10% off a product or something?

you could always track keep info in the db along with the user's other information that says whether they've used one before or not.

you could also track their IP address and make your script not display the certificate at all to the same IP address. But people can get around this if they really wanted to, if they go through a proxy server.

I mean, I guess it just depends on what these certificates are used for. If you give some more details we might be able to find some other means for people to not necessarily print them, but USE them.
[/quote]

Share this post


Link to post
Share on other sites
well the only thing i can think of is to make them register and login before allowing them access to the page where they can print the certificate, and then only allow them to go to the page one time. Of course, this won't stop people from registering bogus accounts for extra coupons, but you can do several things to minimize it.

you can do email validation in your registration script. the user must provide a valid email address so that the script can send them a validation code and they have to get the code to complete registration. And you can script it to where email addresses can only be registered once. This will make people HAVE to go through the the process of starting up a new email account they can access just so they can re-register.

On top of that, you can log their IP address when they register, and script it to where they cannot register from the same IP address again. Then they would have to do something like go through a proxy server AND get a new email just to register and access the page for another free coupon, which sounds like an aweful lot of time and effort for most people, just to get a free pizza (cuz it's a lot easier just to call up the pizza place with a bogus complaint to get a free pizza :) ) not to mention the fact that average joe doesn't even know what a proxy server is.

And then on top of that, you can build a unique tracking number that links the coupon to their account, and since (i'm assuming) that the other business will eventually return the coupon to you (if not, maybe you could implement it, or at least, have them report to you the tracking number), and put a big fat warning on the page and on the coupon about what kind of nasty actions you will take against the customer if you recieve duplicate tracking numbers.

Again, this will not totally illiminate the problem, but it should very drastically reduce the problem.

Share this post


Link to post
Share on other sites
hahahha I love what you wrote in the last paragraph!!!! haha

ok here is the deal.. we have them login to have access to the prize. the prize is ofcourse only for those that win it.. currently we give them 30 days to print the certificate, then after that the link disapears..

we have a tracking type number inplimented into the coupon, and we have a extra image placed over the current image to make sure noone just saved the image file..

i was thinking we can disable javascript rightclick, but its pretty easy to get by that... just disable javascript on your computer..

but what can we do to make them just print the coupon once... is there any function that says look here i am only going to print this coupon once i dont care if you want to print 5, too damn bad! ... what do you think? possible?

[!--quoteo(post=371151:date=May 4 2006, 12:43 AM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ May 4 2006, 12:43 AM) [snapback]371151[/snapback][/div][div class=\'quotemain\'][!--quotec--]
well the only thing i can think of is to make them register and login before allowing them access to the page where they can print the certificate, and then only allow them to go to the page one time. Of course, this won't stop people from registering bogus accounts for extra coupons, but you can do several things to minimize it.

you can do email validation in your registration script. the user must provide a valid email address so that the script can send them a validation code and they have to get the code to complete registration. And you can script it to where email addresses can only be registered once. This will make people HAVE to go through the the process of starting up a new email account they can access just so they can re-register.

On top of that, you can log their IP address when they register, and script it to where they cannot register from the same IP address again. Then they would have to do something like go through a proxy server AND get a new email just to register and access the page for another free coupon, which sounds like an aweful lot of time and effort for most people, just to get a free pizza (cuz it's a lot easier just to call up the pizza place with a bogus complaint to get a free pizza :) ) not to mention the fact that average joe doesn't even know what a proxy server is.

And then on top of that, you can build a unique tracking number that links the coupon to their account, and since (i'm assuming) that the other business will eventually return the coupon to you (if not, maybe you could implement it, or at least, have them report to you the tracking number), and put a big fat warning on the page and on the coupon about what kind of nasty actions you will take against the customer if you recieve duplicate tracking numbers.

Again, this will not totally illiminate the problem, but it should very drastically reduce the problem.
[/quote]

Share this post


Link to post
Share on other sites
hmm.

well i will have to think more on that, just for the sake of finding out if it's possible in some other language, just cuz you got me interested in finding out, lol. but it's definately not possible with PHP. i'm leaning towards active x control but i also wanted to point out something that makes this whole idea rather moot:

even if you do manage to keep the user from printing it more than once from the browser... all they need is a program that can do screen capture. Then they can capture the screen and crop it and print them out all day long.

And that's a pretty damn easy thing for someone to do. It mostly just takes a small degree of ingenuity to think of that solution, and virtually no technical skill. I'm by no means the brightest crayon in the box, and it only took me what, 2 days to figure it out? And it's not like i've been spending the last 2 days really focusing on it 24/7....so i think most any other person would go there with the intentions of gettingn more copies, and upon multi-print disabled failure, would sit back and think about it and come up with it fairly quickly.. especially if they are motivated to do so cuz they were miffed that you somehow managed to disable their multi-print!

and disabling 3rd party programs from the browser [i]is[/i] virtually impossible. You would have to make a program that the user would have to download and install, and the program would have to run everytime the user is logged into windows, and basically disable any image manipulation program(s) that are on the user's harddrive. And I'm sorry to say that a program like that would most likely be labeled as a trojan (read: illegal).

Share this post


Link to post
Share on other sites
haha so it looks like I am stuck with tracking codes, etc.

perhaps the business will have a peice of paper with them and they can mark down which certificates are used, and we could put 1 of 100, 2 of 100, 3 of 100 and so on.. that way if they receive a duplicate, they can just not honor it

but that doesnt prevent them from changin the code themselves... just save the webpage.. change 1 to 100, to 2 to 100 and change the name.. and then bring it in..

there has to be a better way to control this.

A barcode would be cool but each business would have to have a barcode reader, and well that is impossible.

Maybe we could just have the script disappear after the first time they click the print button. But then if they accidently click the print button without having their printer on, then they lose their prize.

[!--quoteo(post=371179:date=May 4 2006, 04:39 AM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ May 4 2006, 04:39 AM) [snapback]371179[/snapback][/div][div class=\'quotemain\'][!--quotec--]
hmm.

well i will have to think more on that, just for the sake of finding out if it's possible in some other language, just cuz you got me interested in finding out, lol. but it's definately not possible with PHP. i'm leaning towards active x control but i also wanted to point out something that makes this whole idea rather moot:

even if you do manage to keep the user from printing it more than once from the browser... all they need is a program that can do screen capture. Then they can capture the screen and crop it and print them out all day long.

And that's a pretty damn easy thing for someone to do. It mostly just takes a small degree of ingenuity to think of that solution, and virtually no technical skill. I'm by no means the brightest crayon in the box, and it only took me what, 2 days to figure it out? And it's not like i've been spending the last 2 days really focusing on it 24/7....so i think most any other person would go there with the intentions of gettingn more copies, and upon multi-print disabled failure, would sit back and think about it and come up with it fairly quickly.. especially if they are motivated to do so cuz they were miffed that you somehow managed to disable their multi-print!

and disabling 3rd party programs from the browser [i]is[/i] virtually impossible. You would have to make a program that the user would have to download and install, and the program would have to run everytime the user is logged into windows, and basically disable any image manipulation program(s) that are on the user's harddrive. And I'm sorry to say that a program like that would most likely be labeled as a trojan (read: illegal).
[/quote]

Share this post


Link to post
Share on other sites
does the business have the capability of going to your website to varify the coupon code on the spot? if so then they can check to see if it's a valid code before accepting it. you may not be able to stop them from printing the certificate more than once, but you can make the validation code unique so that it will only be accepted once. but like i said earlier, that doesn't prevent people from going through the trouble of re-registering on a proxy server to get a completely new certificate.

all i can think of for you to do to COMPLETELY illiminate the problem is to just ditch the whole "online certificate printing" idea and send them the coupon by mail on some not easily tampered with paper.

Share this post


Link to post
Share on other sites
Hey Crayon!

Actually the capability to verify would be great! but the problem relies in that a lot of businesses would not have the time to take away from their normal daily operations to quickly log in, and enter a coupon code just to make sure it is valid. It would be great if everyone had internet access.

Your tracking code idea is probably the best way.. that and only allowing them to print it once. So we will let them have access to the link for 30 days but once they click it.. they no longer get access.

Thanks for the great thread! Hopefully everyone learned something onthis topic!

[!--quoteo(post=371335:date=May 4 2006, 02:30 PM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ May 4 2006, 02:30 PM) [snapback]371335[/snapback][/div][div class=\'quotemain\'][!--quotec--]
does the business have the capability of going to your website to varify the coupon code on the spot? if so then they can check to see if it's a valid code before accepting it. you may not be able to stop them from printing the certificate more than once, but you can make the validation code unique so that it will only be accepted once. but like i said earlier, that doesn't prevent people from going through the trouble of re-registering on a proxy server to get a completely new certificate.

all i can think of for you to do to COMPLETELY illiminate the problem is to just ditch the whole "online certificate printing" idea and send them the coupon by mail on some not easily tampered with paper.
[/quote]

Share this post


Link to post
Share on other sites
Well i don't really see why their lack of time to check the code is YOUR problem... I assume that the way you have it setup is something like: customer gets certificate from you. they turn it into business. business gives them free/discounted product/service, and turns in the coupon to you to get compensated. Is that about right?

If so, then make it clear to those businesses that you have provided various ways to limit people from having more than one coupon (tracking number, one time access (which requires registration), limited time availability overall, etc...) and that you will not accept duplicate coupons.

Also, as far as the tracking number, you will probably want to make it unique, but based on a key word or code or logorythm, so that even if customers were to try to fabricate new tickets, they would have to somehow break down the number and figure out the keyword/logorythm in order to build a valid unique number.

so when you script to check the tracking number, it wouldn't be a simple "check if this number is in the database already. if it is, then it's duped. if not, then it MUST be good!" cuz if it's just totally unique, then i could just do like 0b32823490df1020 or whatever other random proper amount of digits.

BUT.. and i'm sure you are tired of hearing that word, lol... it's still not impossible to crack the logorythm you use for your tracking numbers. But we are talking some serious skill and time in doing it, if you pick a really nasty logorythm. I mean, the customer would have to have some kind of personal grudge against you or something; to hell with the free pizza, I just wanna do it as a slap in the face, sort of thing.

But the main point in all of this babble is the idea of putting the potential financial loss on the *other* business. Just make it clear to them that you've done your best to prevent it, but nothing is failsafe, and that you simply won't accept redemption of invalid tracking numbers. It's only fair. They are the ones who will see the customer in person. They can impliment things like signing for product/service or taking a picture of them and posting it on the wall of "previous coupon turn-iners, do not accept any more from them!" and other such stuff.

Share this post


Link to post
Share on other sites

×

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.