| Author |
Message |
devo New Member


Joined: Oct 02, 2003 Posts: 23
|
Posted:
Thu Oct 02, 2003 9:00 pm |
|
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 |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
|
Posted:
Thu Oct 02, 2003 9:26 pm |
|
I would insert it into includes/my_header.php. That's what that file is for. |
|
|
|
 |
Savent Regular


Joined: Jun 30, 2003 Posts: 81
|
Posted:
Thu Oct 02, 2003 9:28 pm |
|
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 ";
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"; |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
|
Posted:
Fri Oct 03, 2003 5:47 am |
|
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 |
|
|
|
 |
devo New Member


Joined: Oct 02, 2003 Posts: 23
|
Posted:
Fri Oct 03, 2003 8:40 pm |
|
good work, thanks to all that replied!!! appreciated  |
|
|
|
 |
Savent Regular


Joined: Jun 30, 2003 Posts: 81
|
Posted:
Fri Oct 03, 2003 9:55 pm |
|
no problem I fiquired i would save Raven some time, cause I know he is always busy |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
|
Posted:
Sat Oct 04, 2003 9:19 pm |
|
And Raven needs all the help he can get (hint, hint)  |
|
|
|
 |
|
|
|
|