yami007 Posted March 19, 2009 Share Posted March 19, 2009 i did a little code verification and i dont want them to copy and paste it please help.. Quote Link to comment Share on other sites More sharing options...
Psycho Posted March 19, 2009 Share Posted March 19, 2009 Not sure what you are asking (either you don't want them to copy a paragraph displayed on the page or you have some verification code that you don't want copied). But, the solution is the same, which is there is nothing you can do. Yes, there are "right-click" hacks that attempt to prevent a user from usign features such as "view-source", but they do not work in that they are easily circumvented. If it is text displayed on the page you are trying to "protect" the best option, IMHO, is to make the text an image and use a watermark. It doesn't prevent anyone from using that image, but they won't be able to do so without people seeing your watermark and knowing it wasn't theirs. But, since it's text they could simply rekey that text into a text editor. And, again, if we are talking about the code, there is really nothign you can do except obfuscate the code, which only makes it more difficult for someone to assemble into a readable format. Besides, have you not benefited from other's code? Why are you being stingy? Quote Link to comment Share on other sites More sharing options...
yami007 Posted March 19, 2009 Author Share Posted March 19, 2009 it's not like that, i'm beginner at programming and i made myself this verification code: <?php $Confirm = mt_rand(); ?> <tr> <td valign="top" width="100" >Verification :</td> <td valign="top" ><input type="text" name="verification" size="10" value="" /> <label for="verification"> << <?php echo $Confirm; ?></label> </td> </tr> I only want to prevent them to not copy and paste the code directly but to type, and that's the best i could do i know spams are smarter than my code but i wanted to do something though.. Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted March 19, 2009 Share Posted March 19, 2009 like Maj said you could use Jquery no right click hacks but those only work on the page you still could go to edit=>view source and rip the code easily but as he stated even with the no right click just makes it harder to rip the source code unless your smart enough to go edi=>view source No Right Click <script language="JavaScript"> <!-- // No rightclick script v.2.5 // (c) 1998 barts1000 // barts1000@aol.com // Don't delete this header! var message="Sorry, that function is disabled.\n\nContents & Graphics Copyright ©your name\nOur work is not Public Domain, and should NOT be taken from this site."; // Message for the alert box // Don't edit below! function click(e) { if (document.all) { if (event.button == 2) { alert(message); return false; } } if (document.layers) { if (e.which == 3) { alert(message); return false; } } } if (document.layers) { document.captureEvents(Event.MOUSEDOWN); } document.onmousedown=click; // --> </script> Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted March 19, 2009 Share Posted March 19, 2009 also you could use the following site to encrypt your html code but that like Maj said only goes so far Encrypt HTML Using JS: http://www.designerwiz.com/mf.htm?http&&&www.designerwiz.com/generator/encryptHTML.htm Quote Link to comment Share on other sites More sharing options...
Psycho Posted March 19, 2009 Share Posted March 19, 2009 @darkfreaks: I think the OP is echoing a random number to the screen and then expecting the user to enter that random number into the field as a verification that the user is a human and not a spambot. So, he is not trying to prevent the user from seeing source code, just want to enforce the user to type the random number in rather than copy and paste. By the way, who is "Maj" ??? @yami007 : You could probably do something where an onkeydown has to be registered on the field, but I don't beleive spambots would even have JS enabled. I'd suggest making the field disabled by default and then enabling it onclick(). Of course anyone without JS enabled will be out of luck. Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted March 19, 2009 Share Posted March 19, 2009 sorry i just woke up and i read your username wrong Quote Link to comment Share on other sites More sharing options...
yami007 Posted March 19, 2009 Author Share Posted March 19, 2009 well thanks for the help mjdamato and darkfreaks however i ddnt want the no right click function it is bad anyway and u know what? i resolved it with flash i used flashvars to display the random key in flash and so i prevented the user from copying and pasting or what do u think about my thought? is it secured ? thanks again..^^ Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted March 19, 2009 Share Posted March 19, 2009 got a link where we could check ??? other than that it needs to be marked as solved Quote Link to comment Share on other sites More sharing options...
yami007 Posted March 20, 2009 Author Share Posted March 20, 2009 hehe ok ^^ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.