PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi
Im trying to pass encoded stuff though a array, that then goes to preg match(should had been decoded somewere on the way) to see if there is a match or not. I have simple examples below, im only a beginer and i hope you can understand what im trying to do
This code is fine, it is what i need to add the decoding to. With info what it does below
$lines= array();
// All this does is get word list that is encoded(pre encoded eg czo3OiJlbmNvZGVkIjs=, ready to be only decoded)
$lines=file('myfile.txt') or problem('<b>System error code 2.</b>');
foreach($lines as $word){
//grab the footer to be compaired with our encoded word list that should had been decoded by now or it will try and match encoded stuff that dont exist
$html = @file_get_contents('footer.php') or problem('<b>System error code 3.</b>');
$html = strtolower($html);
if (preg_match("/".trim($word)."/i", "$html") == 1) {
//if all is well the header well go and load the page
require_once('images/header.php'); }
//else if we get to here words were not matched and we are not going to display the page at all and go to error page
else { problem($settings['sys-variables']); } }
// START problem()
function problem($myproblem) {
//html or what ever here
echo($myproblem);
exit();
}
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
That's not one array serialized and then base64 encoded but threee strings each serialized and base 64 encoded.
What are you trying to achieve?
Why do you use serialze?
Why do you use base4_encode?
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Thank you for your reply, I though i explained everything in the code ok, i'll try again a bit better hopefully
I speak plain english, with orig example code followed below that works in detecting content being removed from the footer, with a word list not encoded.
This checks the page from the wordfile, of keywords that must exist in the footer, eg "mod version 0,1". If it exists the header is passed and continues on else it means they have removed my link back to my home page which in turn they will not have the index page but the error page.
So the word list i want it to be encode so it is not recognised or understood, so it cant be easily removed by the average webmasters out there
/* Simple check that all is ok before we get going*/
$lines= array();
$lines=file($settings['site_admin'] . '/' . $settings['sys-var']) or problem('<b>System error code 2.</b><br><br> Please check that you have your settings.php setup correctly other wise it means you have modified critical files and reinstall may be needed.');
foreach($lines as $word){
$html = @file_get_contents($settings['site_url'] . '/' . $settings['site_folder'] . '/' . $settings['sys-linker']) or problem('<b>System error code 3.</b><br><br> Please check that you have your settings.php setup correctly other wise it means you have modified critical files and reinstall may be needed.');
$html = strtolower($html);
if (preg_match("/".trim($word)."/i", "$html") == 1) {
#############################
# Start-up
#############################
require_once('images/header.php'); }
else { problem($settings['sys-variables']); } }
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]