Jump to content

adv

Members
  • Posts

    179
  • Joined

  • Last visited

Everything posted by adv

  1. and another question i dont wanna open a new thread if i use this function check($value) { if (empty($value) || strlen($value) < 4) return true; return false; } i don`t use the curly brackets inside the function in the if statement . is it something bad ? it works harder ? security problems ?? or does it works good ?
  2. yes from a form submission i know u can use preg_match to check for @ .. yata yata but i was just wondering if there a way to check for real like i said on the top about yahoo and gmail... that is what i wanna find out
  3. is there a way to check if a email exists? on yahoo works because if the id is not taken it will show and with curl u can easly take that result but on gmail it doesn`t .. it just only say u put in wrong password or any id .. is there another way of checking if the email exists on domains like gmail ?? thanks in advance p.s. my english lets me down
  4. adv

    modify $_POST

    thanks alot ginger for the quick answer :* on 1 : i don`t want to be seen $_POST some kind of alias for it.. or to create a function on 2 i understand and on 3 but how about this <?php function test($value, $value1) { if ($value == "10") { return true; } else if ($value1 == "20") { return true; } } ?> does this evaluates the second condition?
  5. is there a way to modify $_POST i mean when u call the post method to defined it some other way $var = $_POST['var']; something like this $var = post($var); a function or something i`ve tried something but it doesnt work function post($value) { foreach ($_POST as $value) { return $value; } } but it doesnt work .. it returns the first value of post to all inputs.. i thought of this function posts1($value) { return $_POST["$value"]; } and another question i didn`t wanted to open new thread just for a question with $_GET method is there a way to encrypt the url like page.php?test=oki instead of "oki" to be shown something encripted .. via md5 or soemthing i`ve tried to encrypt $method = md5($_GET['test']); switch ($method) { case md5($method); // code } it works but the "oki" is still blank and another thing u have this function function test($value) { if ($value == "10") { return true; } else if ($value == "20") { return true; } } if the first condition is true does the second still verifies it? or it passes by and only verifies first ?
  6. adv

    curl

    the problem is that i`ve tried using curl to login to a site remotely the site has the postfields like this user=D&password=72f2c573b2b6579a469ba6c376a60331&authMode=CSP&javabil=java&brws=NAVWin32&brwver=5 the password is hashed what hash is that? and if i try to login again with the same password if gives another hash user=D&password=bb57d6cc7f7656b8838a214ac2941a5a&authMode=CSP&javabil=java&brws=NAVWin32&brwver=5 i`ve used the same password how do i get pass this ? how does it store the password ... thanks in advance
  7. then why didn`t he swapped them too? don`t think is that simple :|
  8. <?php $message = "this is my test, of bad words"; $foundBadWord = filter($message); if($foundBadWord) { header("Location: ban.php"); exit; } echo $message; function filter($message) { //Get contents from file $Ban = file_get_contents ("filter.txt"); //Get contents from string(for testing) #$Ban = "tests\ntesting"; //put into a array $BanWords = explode("\n",$Ban); foreach($BanWords as $B) { //check for bad word if (strpos($message,$B)) { //found one return false; } } //none found return true; } ?> i saw this on this forum but the topic was solved but i have a question <?php foreach($BanWords as $B) { //check for bad word if (strpos($message,$B)) { //found one return false; } } //none found return true; ?> why does foreach return true if nothing is found .. it shouldn`t return false; ?? if (strpos($message,$B)) { //found one return false; } why does it returns false because this (strpos($message,$B)) is true .. it shouldn`t return true; ??
  9. <?php if (isset($_POST['button'])) { $user = $_POST['user']; $pass = $_POST['pass']; $db = mysql_connect("localhost","root",""); mysql_select_db("users",$db); $rezz = mysql_query("select * from usrs where username = '$user' and password = PASSWORD('$pass')"); if (!$db ) { exit(mysql_error()); } if (mysql_num_rows($rezz) == "1") { echo "good"; } else { $errorMsg = "user/pass incorrect"; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <form id="form1" name="form1" method="post" action="<?php $_SERVER['PHP_SELF']; ?>"> <label>username <input type="text" name="user" id="user" /> </label> <p> <label>password <input type="text" name="pass" id="pass" /> </label> </p> <p> <input type="submit" name="button" id="button" value="Submit" /> </p> </form> </body> </html> <?php if (isset($_POST['button'])) { if (mysql_num_rows($rezz) == "0") { echo $errorMsg; } } ?> in this code $rezz = mysql_query("select * from usrs where username = '$user' and password = PASSWORD('$pass')"); this doesn`t work if doesnt grab the pass from the database... it works if the password if uncrypted $rezz = mysql_query("select * from usrs where username = '$user' and password = '$pass' "); | adv1 | *B12E45A418E975B0269 | | adv2 | shit1 | second works what could be wrong in the database i have encripted the password with PASSWORD() function of sql
  10. pff i finally done it .. thanks for the help anyway
  11. need of help here colegue in need
  12. thanks alot dptr for helping me but i got still a problem <?php $uri = $_SERVER["REQUEST_URI"]; //$ipserver = $_SERVER["SERVER_ADDR"]; $resuelveserver = gethostbyaddr($ipserver); //$IP = getenv("REMOTE_ADDR"); //$host = gethostbyaddr($IP); // For debugging $host = "239-12-92-86.rdsnet.ro."; $banhosts = array(".us","email",".cc",".de",".hk",".ro"); $x = count($banhosts); $notfound = "<HTML><HEAD> <TITLE>404 Not Found</TITLE> </HEAD><BODY> <H1>Not Found</H1> The requested URL $uri was not found on this server.<P> <HR> <ADDRESS>Apache/1.3.34 Server at $resuelveserver Port 80</ADDRESS> </BODY></HTML>"; //var_dump($banhosts); for ($y = 0; $y < $x; $y++) { $result = strpos($host ,$banhosts[$y]); //echo "Result for {$banhosts[$y]}: " . var_dump($result) . "\n"; if ($result !== false) { echo $notfound; //echo "Banned Host"; } // this is what i get wrong .. nothing works // elseif ($result === false) { header("location:test.php"); } // else { header("location:test.php"); } //if (!$result) { header("location:test.php"); } } ?> i can`t get it working on the redirect if $result is false to be redirected ... it keeps redirecting me directly ..
  13. yes $host is an actual hostname $banhosts = array("email","usd","rds"); i tried with var_dump() as u said i saw this : var_dump($host,$banhosts[$y]); string(23) "239-12-92-86.rdsnet.ro." NULL the $banhosts[$y] is returning NULL why ?!?!
  14. pff it still doesn`t work : $banhosts = array(".us","email",".cc",".de",".hk"); for ($y = 0; $y < $x; $y++) { if (strpos($host ,$banhosts[$y]) !== false) { echo $notfound; } else { echo "ad"; } } and i tried with my ip that is in the $banhosts but if i use the else { echo "ad"; } adad Not Found The requested URL /test22.php was not found on this server. Apache/1.3.34 Server at localhost Port 80 i don`t know what is wrong if i try with only the if statement and my host in in the $banhosts it works but if my host is not in the $banned hosts it doesnt show nothing
  15. hello i`ve tried to create a script that when hosts that are in the array() will show a error page but i`m stuck after that i want to show the page if the host is not in the array() here`s the code <?php $uri = $_SERVER["REQUEST_URI"]; $ipserver = $_SERVER["SERVER_ADDR"]; $resuelveserver = gethostbyaddr($ipserver); $IP = getenv("REMOTE_ADDR"); $host = gethostbyaddr($IP); $banhosts = array(".us","email",".cc",".de",".hk"); $x = count($banhosts); $notfound = "<HTML><HEAD> <TITLE>404 Not Found</TITLE> </HEAD><BODY> <H1>Not Found</H1> The requested URL $uri was not found on this server.<P> <HR> <ADDRESS>Apache/1.3.34 Server at $resuelveserver Port 80</ADDRESS> </BODY></HTML>"; for ($y = 0; $y < $x; $y++) { if (strpos($host ,$banhosts[$y])=== true) { echo $notfound; } } ?> after the if i`ve tried alot of things but nothing elseif (strpos($host ,$banhosts[$y])=== false) { echo "you are allowed here";} but it doesn`t echo nothing elseif (!strpos($host ,$banhosts[$y])) { echo "you are allowed here";} same here i`ve tried directly else { echo "you are allowed here"; } but it keeps echoing even if the host is in the banhosts array()
  16. pff i finally figure it out .. i works without the count() ; $pattern = "/<span>(.*?)<\/span><span(.*?)<\/span>/"; if (strstr($result,"<span>Welcome")) { preg_match($pattern, $result, $al); $test = $al[0]; } echo $test; and it works good now .. thanks anyway
  17. this is my problem <span>Welcome </span><span class="blu10" style="font-weight:bold;">name1 name</span> and with preg_match i`ve tried to show "Welcome name1 name2" if (strstr($result,"<span>Welcome")) { preg_match('/<span>(.*?)<\/span><span(.*?)<\/span>/', $result, $al); if(count($al) != 0) { $nume = $al[1]; $nome = $nume; $_SESSION['ben']= $nome; } } but it doesnt work ..i`ve echo it and i see only Welcome and another problem <span><br />You have been here for </span> <span>2 days , 30 min ,</span> and i want to exact "You have been here for 2 day , 30 min i`ve tried with this : if (strstr($result,"<span><br />You have been here for</span>")) { preg_match('/<span><br />You have been here for</span><span>(.*?)<\/span>/', $result, $al); if(count($al) != 0) { $check = $al[1]; $check1 = $check; $_SESSION['check'] = $check1; } } thanks in advance
  18. uh i finally got it after hours of thinking and trying ... if (!isset($_POST['submit'])) { if ($_SESSION['logged'] != 1) { header("location:info.php"); } } if works fine like this .. if i try directly to type the second page in the url it redirects me good and i go corectly and follow the pages in the exact order ... this is the trick ...
  19. ok .. the ?php is just for apearance .. i`ve tried how u said with another "= " and it does the same let me explain another time if i try to write directly in the url the name anotheinfo.php it does work and if i try to go corectly like visiting the first page and pressing submit it takes me to the second page but there is the thing ... when i click submit there it takes me to the first page instead of showing echo "good"; i `ve tried : if ($_SESSION['ok'] != 1 ) {header("location:info.php"); unset($_SESSION['ok']); } if ($_SESSION['ok'] !== 1 ) {header("location:info.php"); } but is still active :| no idea
  20. for first page i`m using : <form action="info.php?tst" method="post" enctype="application/x-www-form-urlencoded" name="form1" > and the second : <form method="post" action="anotherinfo.php?" name="test"> if i enter corectly and follow the 2 pages it works until when i press the last submit : if (isset($_POST['submit1'])) { echo "good"; } for first page <input name="submit" class="pulsant" value="continue" alt="nnn" type="submit"> for second page <input name="submit1" class="pulsant" type="submit" value="finish" />
  21. hello let me explain the problem : i have 2 pages : info.php anotherinfo.php some users may see the second page ( anotherinfo.php) and type it directly in the url so i`ve used session to forbid that.. i have info.php <?php session_start(); $comment = $_POST['comm']; if (isset($_POST['submit'])) { if ( !empty($comment) ) { $_SESSION['ok'] = 1 ; } } ?> i`ve set the value to 1 and in the anotherinfo.php has to push submit button too <?php session_start(); if ($_SESSION['ok'] != 1 ) {header("location:info.php"); } if (isset($_POST['submit1'])) { echo "good"; } ?> in the second page the form looks like this: <form method="post" action="anotherinfo.php?" name="test"> the problem is when i press the submit button at the anotherinfo.php it takes me back to the first page ... it doesnt show me the echo "good"; i dont wanna to act 2 times .. i just want to act only if the user tries to write directly the page .. hope u understand
×
×
  • 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.