Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's
Author Message
devo
New Member
New Member



Joined: Oct 02, 2003
Posts: 23

PostPosted: Thu Oct 02, 2003 9:00 pm Reply with quote

hi there I have a java script tp diable right clicking in all my site, what I would like to know where to inesrt it please?

Would I insert into mainfile.php??? if so is there a correct place to insert it please?

thank
Devo
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Thu Oct 02, 2003 9:26 pm Reply with quote

I would insert it into includes/my_header.php. That's what that file is for.
 
View user's profile Send private message
Savent
Regular
Regular



Joined: Jun 30, 2003
Posts: 81

PostPosted: Thu Oct 02, 2003 9:28 pm Reply with quote

Hi, In header.php

add this before the ?> at the bottom:

echo "<script language=JavaScript>\n";
echo "<!--\n";
echo "\n";
echo "//Disable right click script III- By Renigade (renigade@mediaone.net)\n";
echo "//For full source code, visit [ Only registered users can see links on this board! Get registered or login! ]";
echo "\n";
echo "var message=\"\";\n";

echo "///////////////////////////////////\n";
echo "function clickIE() {if (document.all) {(message);return false;}}\n";
echo "function clickNS(e) {if \n";
echo "(document.layers||(document.getElementById&&!document.all)) {\n";
echo "if (e.which==2||e.which==3) {(message);return false;}}}\n";
echo "if (document.layers) \n";
echo "{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}\n";
echo "else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}\n";
echo "\n";
echo "document.oncontextmenu=new Function(\"return false\")\n";
echo "// --> \n";
echo "</script>\n";

_________________
[ Only registered users can see links on this board! Get registered or login! ] [Online Arcade 340+ Games]
Image 
View user's profile Send private message Send e-mail Visit poster's website
Raven







PostPosted: Fri Oct 03, 2003 5:47 am Reply with quote

I didn't check the code, but yes on the placement. An easier (and better) way is to use the WHEREDOC syntax
Code:
$someVarName = <<<_JSCODE_ 

<script>alert('Hello World');</script>
_JSCODE_;

echo $someVarName;
See this post for more info [ Only registered users can see links on this board! Get registered or login! ]
 
devo







PostPosted: Fri Oct 03, 2003 8:40 pm Reply with quote

good work, thanks to all that replied!!! Smile appreciated Smile
 
Savent







PostPosted: Fri Oct 03, 2003 9:55 pm Reply with quote

no problem Smile I fiquired i would save Raven some time, cause I know he is always busy
 
Raven







PostPosted: Sat Oct 04, 2003 9:19 pm Reply with quote

And Raven needs all the help he can get (hint, hint) Smile
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©