Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
firedemon666
Hangin' Around


Joined: Apr 28, 2006
Posts: 31

PostPosted: Fri Apr 28, 2006 12:42 am Reply with quote

Hello all. Nice site you got here. LOADS of forums. Your SQL database must be the size of the grand canyon. Anyways let's cut to the chase.

As a way to hide the soure code from a few custom modifications we have done to our site and in the hopes to at least help in prevention against SQL injections, I have added to the site a javascript which encrypts the source code of the site. The way I have done it, which is to slap the PHP file into the root directory and insert the line, "Include("Script_Here.php");" into the theme.php file of the theme I am currently using which would encrypt the source code of every page on the site (or at least the pages that have the PHP theme tied to them which is 99% of the site). The problem is, is that this script completely FUBARS select modules and blocks. Right now the only module I am having trouble with is the arcade. While the source encryption script is installed. The problem I am having is that the arcade will not record new scores. Whether the problem is with the arcade module itself or newscore.php I am not sure but that can be determined easily.

The problem here I am having is how to exclude the source encryption script from just slect modules, whil still leaving the line in my theme.php and allowing it to load up with the rest of the site. Is there a simple line I can insert into a .php file that will halt this script from loading up with it?

Thanks a bunch in advance.
 
View user's profile Send private message
hitwalker
Sells PC To Pay For Divorce


Joined:
Posts: 5661

PostPosted: Fri Apr 28, 2006 2:55 am Reply with quote

did it record before you started using the encryption ?
 
View user's profile Send private message
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6792
Location: Ha Noi, Viet Nam

PostPosted: Fri Apr 28, 2006 5:57 am Reply with quote

Quote:
I have added to the site a javascript which encrypts the source code of the site

Just curious but what heppens when a browser is used that does not support JS?
 
View user's profile Send private message Send e-mail
evaders99
Former Moderator in Good Standing


Joined: Apr 30, 2004
Posts: 3221

PostPosted: Fri Apr 28, 2006 7:43 am Reply with quote

So its a Javascript that encodes the HTML? What happens when the Javascript is encrypting Javascript code?

_________________
- Only registered users can see links on this board! Get registered or login! -

Need help? Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
firedemon666
PostPosted: Fri Apr 28, 2006 1:34 pm Reply with quote

Quote:
did it record before you started using the encryption ?


Yes it did.

And it doesn't matter whether the browser supports java or not. Just go to,
Only registered users can see links on this board! Get registered or login!

and try viewing the source.
 
Guardian2003
PostPosted: Fri Apr 28, 2006 11:53 pm Reply with quote

It took so long to load I gave up!
 
firedemon666
PostPosted: Sat Apr 29, 2006 1:25 am Reply with quote

Thats because the swat 4 block was on the fritz and was lagging the site. Try it again now. Should come right up.
 
firedemon666
PostPosted: Wed May 03, 2006 9:36 pm Reply with quote

Well guys is there a way?
 
evaders99
PostPosted: Wed May 03, 2006 10:28 pm Reply with quote

I assume you have the include line that you posted in there

You could do something like
Code:


if (($name == "Arcade) OR ($name == "Forums")) {
} else {
  Include("Script_Here.php");
}


Add the names of the modules with conditionals as needed
 
firedemon666
PostPosted: Wed May 03, 2006 11:23 pm Reply with quote

Tried that, thinking it would work. No go. Tried the Forums line so that the source of anything forum related (IE the arcade) would not be encrypted. The problem I discovered, is that the score recording does not lie within the forums or arcade itself. It is a seperate file that handles this. Around in the root folder of my website, you would find a file called "arcade.php". I became suspicious of this file after the script mod failed so I removed the csource lines so that it would not load on any page, and deleted arcade.php from my root directory. The arcade still loaded up fine, all the games played, but hey! When I go to submit a high score, NOTHING HAPPENS! I put the file back and this dissapeared. And since the file is not identified by "$file" or "$name", I cannot exclude it with this specific script. So, is it still possible? It is just this one file we need to keep the csource from loading with.
 
evaders99
PostPosted: Sat May 06, 2006 3:54 pm Reply with quote

Try this then

Code:


if (stristr($_SERVER['PHP_SELF'], "arcade.php")) {
} else {
  Include("Script_Here.php");
}
 
firedemon666
PostPosted: Sat May 06, 2006 4:09 pm Reply with quote

How do I add a conditional? I discovered the file newscore.php also plays a role in writing the tables for games that have no previous score recorded. As it is now, Games that have previous scores will record fine. Games that have no previous scores will flunk out. We are in the home stretch!

Thanks a bunch for the help.
 
evaders99
PostPosted: Sat May 06, 2006 5:16 pm Reply with quote

Code:


if (stristr($_SERVER['PHP_SELF'], "arcade.php") OR stristr($_SERVER['PHP_SELF'],"newscore.php') ) {


Hope that helps
You should be able to figure out how to keep extending that with the necessary OR statements Smile
 
firedemon666
PostPosted: Sat May 06, 2006 5:23 pm Reply with quote

Code:


<?php
if (stristr($_SERVER['PHP_SELF'], "arcade.php") OR

stristr($_SERVER['PHP_SELF'],"newscore.php') ) {
} else {
  Include("scripts/csource.php");
}


Tried it like that. The site is a dud with that script in place. When you try loading it all you get is a blank page. Also tried<

Code:


<?php
if (stristr($_SERVER['PHP_SELF'], "arcade.php") OR

(stristr($_SERVER['PHP_SELF'],"newscore.php') ) {
} else {
  Include("scripts/csource.php");
}


In case you had made a type since im relatively new to scripting. Still no go.

However with the script:

Code:


<?php
if (stristr($_SERVER['PHP_SELF'], "arcade.php")) {
} else {
  Include("scripts/csource.php");
}


The site loads just fine. WTH is going on?
 
evaders99
PostPosted: Sat May 06, 2006 11:20 pm Reply with quote

Sorry.. it was a typo, the last quote should have been a double quote
Code:


if (stristr($_SERVER['PHP_SELF'], "arcade.php") OR stristr($_SERVER['PHP_SELF'],"newscore.php") ) {
 
firedemon666
PostPosted: Sat May 06, 2006 11:28 pm Reply with quote

Even with my low level scripting skills Id've recognized that if I had seen it. How could I have been so blind... Lol

Anyways the arcade works flawlessly now. Thanksa bunch man, I owe ya one =D
 
firedemon666
PostPosted: Mon May 08, 2006 12:37 am Reply with quote

Ahhh alas this problem is not through repeating itself. I have found an MSN messenger block for my site that allows people to log onto MSN without having the messenger installed. But csource FUBARS it and causes it to be displayed at the bottomof the page. I'm not sure if the above script only works on files in the root folder but I tried

Code:


stristr($_SERVER['PHP_SELF'],"blocks/block_name_here")


And failed horribly. The block was still disfigured at the bottom of the page. Whats up with it this time?
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

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 ©