Jump to content

Grande

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Grande's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Could be, but sometimes your lazy and you use the stuff you allready know ;) hehe
  2. Yess , it was a hell of a hassle but it was a challenge ;) I made it like this: A relocater to the same page [code]<meta http-equiv="refresh" content="5; url=http://localhost/rulesen/test.php" />[/code] And code that checks if the total number of rows changes, while logging the previous number of rows in a session variable (query: $query2 = "SELECT count(*) as number FROM phptest"; ) [code]    while($next_user = mysql_fetch_array($result2)){             global $user_count;             $user_count = $next_user["number"];                          if(isset($_SESSION['count'])){                 //echo "session count is set";                 if ($_SESSION['count'] != $user_count){                 //echo "session count and user_count are different";                 mail($to, $subject, $message);                 }             }                        //echo "Number of rows are: ".$user_count;           // Use $HTTP_SESSION_VARS with PHP 4.0.6 or less           $_SESSION['count']=$user_count;          }     //echo "variable session count is: ".$_SESSION['count'];[/code] Anyway, thx everybody for the help
  3. Ok' I'll look into it, Thx for the help !! Cheers
  4. Yess, that's true but the insert happens by a predefined package of Linux, Snort. So I'm not sure it's best to change that package, so for now I'm looking for a different solution . . .
  5. No, can't do that, have no Cpanel here and I have to write the script myself and implement it. I could realy need some help with this because I'm kinda stuck Cheers , Grande
  6. what is cronjob ? Never heard of that before ...
  7. Hello, I'm working on the following: I have to make a script that constantly checks if a certain table in a database changes. It's a table where alerts are logged, so when a new alert is logged into the table, a mail has to be sent to the admin. The sending of the mail itself will be no problem, I just don't know how to make sure that the table is constantly checked en when there's a new row in it, the e-mail with the data is sent.... Someone who knows what to do ? Thx Grande
  8. Awesome, You helped me solve a problem I was working on for two days in five minutes (or less ;) ) Thank you very much appreesh ! Grande
  9. [!--quoteo(post=357087:date=Mar 21 2006, 09:48 PM:name=craygo)--][div class=\'quotetop\']QUOTE(craygo @ Mar 21 2006, 09:48 PM) [snapback]357087[/snapback][/div][div class=\'quotemain\'][!--quotec--] Man you guys have been failing me lately :) I got it all set. Ray [/quote] Could you post your solution for your problem, seems like an interesting thing that I can probably use. Thx! Grande
  10. [!--quoteo(post=357305:date=Mar 22 2006, 03:59 PM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Mar 22 2006, 03:59 PM) [snapback]357305[/snapback][/div][div class=\'quotemain\'][!--quotec--] No, if you just do an "echo $var" to the screen the web browser will compress two or more adjacent spaces into one. In order to really see all the spaces either surround the variables with the '<pre></pre>' tags or replace all spaces with the special space "&nbsp;". I would compare the trimmed values. Ken [/quote] so this doesn't do the trick : [code]echo "\"".$breaker2."\"";[/code]
  11. [!--sizeo:2--][span style=\"font-size:10pt;line-height:100%\"][!--/sizeo--][code]<html> <head> <?php $test1="exploit.rules"; $test2="exploit.rules"; $lines = file("./snortconf.txt"); $count = count($lines); $i = 0; ?> </head> <body> <form name ="snort" method="get" action="<?=$_SERVER['PHP_SELF']?>"> <?php if(isset($_REQUEST['btnsubmit'])) {       //echo "entered submit request";              if(isset($_REQUEST['chk2'])) {           //echo "entered chkbox request";           $rule = $_REQUEST['chk2']." ";                      while($i<$count){               //echo $lines[$i]."<br>";               //echo "<br>Dit staat ier juist voor de if functie<br>";                              if(ereg("^include",$lines[$i])){                   //echo "jet gezien dat nen include is<br>";                   //$breaker = explode("/",$lines[$i]);                   //echo "<br>----------<br>";                   //echo "\"".$breaker[1]."\"<br>"                 $breaker2 = str_replace("include \$RULE_PATH/","",$lines[$i]);                 //echo "\"".$breaker2."\"";                                                         //echo "\"".$rule."\"";                   //echo "<br>----------<br>";                       if ($rule==$breaker2) {                       echo "TIS WERE GELUKT";                   }               }                          $i++;           }       } } echo "<input type='checkbox' name='chk2' value='".$test1."'>"; ?> <input type="submit" name="btnsubmit" value="Disable"> </form> </body> </html>[/code][!--sizec--][/span][!--/sizec--] This is my code above. I read a sentence that begins with include from a txt file(snortconf.txt) . Then I seperate the sentence and keep the last part of it with str_replace(). An other value, the value from a checkbox is submitted to its own page and the value is used for a Comparation with the value from the txt file. When I echo both the values between quotes, so invisible spaces are revealed if they're there, they are exactly the same. However, in the last if-loop where I compare $rule with $breaker2 I get false. How is this possible ????? I have no clue. snortconf.txt contains this: [code]TEST TEST TESTNUMMERDRIE include $RULE_PATH/exploit.rules TESTJE[/code] A little help would be great. PS: the comments are test-echo's, so I can see where the script goes and where it doesn't go, etc. So don't mind the language of the comments... Thx Grande
  12. [!--sizeo:2--][span style=\"font-size:10pt;line-height:100%\"][!--/sizeo--][code]<html> <head> <?php $test1="exploit.rules"; $test2="exploit.rules"; $lines = file("./snortconf.txt"); $count = count($lines); $i = 0; ?> </head> <body> <form name ="snort" method="get" action="<?=$_SERVER['PHP_SELF']?>"> <?php if(isset($_REQUEST['btnsubmit'])) {       //echo "entered submit request";              if(isset($_REQUEST['chk2'])) {           //echo "entered chkbox request";           $rule = $_REQUEST['chk2']." ";                      while($i<$count){               //echo $lines[$i]."<br>";               //echo "<br>Dit staat ier juist voor de if functie<br>";                              if(ereg("^include",$lines[$i])){                   //echo "jet gezien dat nen include is<br>";                   //$breaker = explode("/",$lines[$i]);                   //echo "<br>----------<br>";                   //echo "\"".$breaker[1]."\"<br>"                 $breaker2 = str_replace("include \$RULE_PATH/","",$lines[$i]);                 //echo "\"".$breaker2."\"";                                                         //echo "\"".$rule."\"";                   //echo "<br>----------<br>";                       if ($rule==$breaker2) {                       echo "TIS WERE GELUKT";                   }               }                          $i++;           }       } } echo "<input type='checkbox' name='chk2' value='".$test1."'>"; ?> <input type="submit" name="btnsubmit" value="Disable"> </form> </body> </html>[/code][!--sizec--][/span][!--/sizec--] This is my code above. I read a sentence that begins with include from a txt file(snortconf.txt) . Then I seperate the sentence and keep the last part of it with str_replace(). An other value, the value from a checkbox is submitted to its own page and the value is used for a Comparation with the value from the txt file. When I echo both the values between quotes, so invisible spaces are revealed if they're there, they are exactly the same. However, in the last if-loop where I compare $rule with $breaker2 I get false. How is this possible ????? I have no clue. snortconf.txt contains this: [code]TEST TEST TESTNUMMERDRIE include $RULE_PATH/exploit.rules TESTJE[/code] A little help would be great. PS: the comments are test-echo's, so I can see where the script goes and where it doesn't go, etc. Thx Grande
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.