Jump to content

adv

Members
  • Posts

    179
  • Joined

  • Last visited

Posts posted by adv

  1. is just the same

    $s=trim($_POST['textfield']);
    $s1=trim($_POST['textfield2']);
    

     

    if the 2 fields are not empty will set errLog not to 1 and will show the first form

    and same for

    $s=isset($_POST['textfield']) && trim($_POST['textfield']) != ""?$_POST['textfield']:"";
    $s1=isset($_POST['textfield2']) && trim($_POST['textfield2']) != ""?$_POST['textfield2']:"";
    

  2. the problem is this  :

    <?php
    $s=$_POST['textfiled'];
    $s1=$_POST['textfield2'];
    if (isset($_POST['button'])) {
    if (empty($s)||empty($s1)) {
    	$errLog=1;	
    }
    }
    
    ?>
    <?php if ($errLog !=1) { ?> 
    <form name="firstForm" method="post" action="">
      <p>
        <input type="text" name="textfield" id="textfield">
    </p>
      <p>
        <label>
        <input type="text" name="textfield2" id="textfield2">
        </label>
    </p>
      <p>
        <input type="submit" name="button" id="button" value="Submit">
      </p>
    </form>
    <p> </p>
    
    <?php } else { ?>
    <form name="secondForm" method="post" action="">
      <p>
        <input type="text" name="textfield" id="textfield">
    </p>
      <p>
        <label>
        <input type="text" name="textfield2" id="textfield2">
        </label>
    </p>
      <p>
        <input type="text" name="textfield3" id="textfield3">
      </p>
      <p>
        <input type="submit" name="button" id="button" value="Submit">
      </p>
    </form>
    <p> </p>
    <?php } ?>
    

     

    the problem is when i submit the page and is empty one of the values is shows the second form

    but if i submit the second form and the inputs are not empty it redirects me to the first form

    i`ve tried with $_SESSION and it works ... but i wanna know is there is a way just with variables

     

    when i submit the second form and the values are not empty i just wanna show lets say

    thanks in advance

    echo 'good';

     

  3. i dont think there is a need to open another tread ...

    the problem is this  :

    <?php
    $s=$_POST['textfiled'];
    $s1=$_POST['textfield2'];
    if (isset($_POST['button'])) {
    if (empty($s)||empty($s1)) {
    	$errLog=1;	
    }
    }
    
    ?>
    <?php if ($errLog !=1) { ?> 
    <form name="firstForm" method="post" action="">
      <p>
        <input type="text" name="textfield" id="textfield">
    </p>
      <p>
        <label>
        <input type="text" name="textfield2" id="textfield2">
        </label>
    </p>
      <p>
        <input type="submit" name="button" id="button" value="Submit">
      </p>
    </form>
    <p> </p>
    
    <?php } else { ?>
    <form name="secondForm" method="post" action="">
      <p>
        <input type="text" name="textfield" id="textfield">
    </p>
      <p>
        <label>
        <input type="text" name="textfield2" id="textfield2">
        </label>
    </p>
      <p>
        <input type="text" name="textfield3" id="textfield3">
      </p>
      <p>
        <input type="submit" name="button" id="button" value="Submit">
      </p>
    </form>
    <p> </p>
    <?php } ?>
    

     

    the problem is when i submit the page and is empty one of the values is shows the second form

    but if i submit the second form and the inputs are not empty it redirects me to the first form

    i`ve tried with $_SESSION and it works ... but i wanna know is there is a way just with variables

     

    when i submit the second form and the values are not empty i just wanna show lets say

    thanks in advance

    echo 'good';

  4. <?php 
    if(isset($_POST['sub'])){
    $ss=$_POST['test'];
    $ss1=$_POST['test1'];
    echo '<pre>';
    print_r($_POST);
    echo '</pre>';
    }
    ?>
    <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" name="form1">
    <input type="hidden" name="first" value="<?php echo $ss; ?>" />
    <input type="hidden" name="second" value="<?php echo $ss1; ?> " />
    
    <br /><br />
    <input type="text" name="test" value="" />
    <input type="text" name="test1" value="" />
    <br /><br />
    
    <input type="submit" name="sub" value="login" />
    </form>
    

     

     

     

    the problem is that when i submit the page it shows like this

    Array
    (
        [first] => 
        [second] =>  
        [test] => asdasdas
        [test1] => adasdassa
        [sub] => login
    )
    

    and when i submit with empty values in the 2 inputs it shows like this

    Array
    (
        [first] => asdasdas
        [second] => adasdassa 
        [test] => 
        [test1] => 
        [sub] => login
    )
    

     

    why doesnt when i submit the page first time shows all the values

    like this

     

    Array
    (
        [first] => asdasdas
        [second] => adasdassa 
        [test] => asdasdas
        [test1] => adasdassa
        [sub] => login
    )

     

     

  5. pff :( another problem

     

    $ff=file_get_contents('file.txt');
    $ss=explode("\n",$ff);
    //print_r($ss);
    $x=count($ss);
    for($y=0;$y<$x;$y++){
    $rss=$ss[$y];
    $rss1=explode(":",$rss);
            //echo $rss1[0];
    }
    echo $rss1[0];
    

     

    it echoes $rss1[0] inside for() but outside it doesnt echo nothing ... why`s that? :(

  6. good good

    but now how do i separate the line

     

    user:password:question

     

    $var1='user';  $var2='password'; $var3='question';  something like this

     

    2)

    and a question that keeps bothering me

    in php functions lets say strpos

    you have strpos($str,"value");

    does it counts the double quotes  is the same as strpos($str,'value');  ?

    and not only in this function all php functions that uses string directly ...

     

    3)

    and another one

    why does some people use $var = "helllo {$name}";

    when they still use double quotes

     

  7. pff kinda hard

    and i get the url with file_get_contents()

    but how do i read through it and to try line by line... and extract each line in a variable or something .. and divide them to user pass and question...

    or if there is a better way just tell me :D any help apreciated.

     

    and a question that keeps bothering me

    in php functions lets say strpos

    you have strpos($str,"value");

    does it counts the double quotes   is the same as strpos($str,'value');  ?

    and not only in this function all php functions that uses string directly ...

  8. hello

    i have "file.txt"

     

    in  the file.txt i have

    user:password:question

    user1:password1:question1

    user2:password2:question2

    $hand=fopen("file.txt","r")

    and with curl i want to try multiple users at a time

    $url='http://domain.com/file.php?go=&usr='.$usr.'&pass='.$pass.'question'.$question;
    $ch=curl_init();
    curl_setopt($ch,CURLOPT_URL,$url);
    curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
    $res=curl_exec($ch);
    curl_close($ch);
    

     

    i`m stuck at fopen :|

     

  9. hello i have a question

    i have this

     

    $str= "user1,pass1,question1,user2,pass2,question2";
    $res=explode(',',$str);
    //print_r($explode); debug

     

    i`m using curl to login

    but in the content of the site

    $vars="username=".$res[0]."&password=".$res[1]."&question=".$res[2];

    and i  made an input

    <input type="text" name="test" value="" size="100">

    and in the input i can put the $str and using curl to check

    but i dont know how to do after $res[0] $res[1] $res[2] to continue to $res[3] $res[4] $res[5]

     

    my main goal is to check 2 users ..

    the only thing i dont know how to automatically go after $res[3]  to $res[4] $res[5] $res[6]

     

  10. hello

     

    input {
    -moz-appearance:textfield;
    -moz-binding:url(chrome://global/content/platformHTMLBindings.xml#inputFields);
    -moz-user-select:text;
    background-color:-moz-field;

     

    how does this works ? and where can i find a tut on this -moz- thing .. how does aplies ?

    i have dreamweaver and it doesnt have have this in the css panel

  11. hello i have a question

    <?php
    function test($day,$month,$year){
       if($day<01||$day>31){
    return false;
    }
      if(!is_numeric($month)){
    	return false;
    }
      if($year<07){
    return false;
    }
    return true;
    }
    ?>

     

    and the html

     

    <input type="text" name="day" value="" size="2" maxlength="2"><br />
    <input type="text" name="month" value=""><br />
    <input type="text" name="year" value="" maxlength="2" size="2"><br />

     

    and if i try this

     

    <?php
    $day=$_POST['day'];
    $month=$_POST['month'];
    $year=$_POST['year'];
    test($day,$month,$year);
    ?>

     

    1 -does it workes how it seens its takes the $day and check within the function if less then 01 and higher then 31.. etc

    2 -and if i put test("",$month,$year);  does it leaves the first to nothing and check the other two

    3- does it have any flaws or bugs ??

    Also this is just a practical question :D

    thanks in advance

     

  12. hello i have tribox installed and recently i found out that there is an exploit with connect-back that u can get access to the server

    the problem is in the /user/index.php

    i found out the exploit and its made in perl

     

    usage() unless @ARGV;
    my $url = "http://$ARGV[0]/user/index.php";
    my $ua = LWP::UserAgent->new;
    my $cookie_jar = HTTP::Cookies->new;
    $ua->cookie_jar($cookie_jar);
    
    menu();
    
    sub execScript{
        my $scriptCode = shift;
        post($scriptCode);
        my $phpsessionid = extractPHPSID($cookie_jar->as_string);
        post("langChoice=../../../../../../../../../../tmp/sess_$phpsessionid%00");
    }
    

     

    its getting access to /tmp .. ive tried to chmod 755 /tmp but the index doesnt work it gives an error

     

    <?php
    
    apache_setenv('QUERY_STRING',$_SERVER["QUERY_STRING"] = addslashes(strip_tags(urldecode($_SERVER["QUERY_STRING"]))));
    apache_setenv('REQUEST_URI',$_SERVER["REQUEST_URI"] = addslashes(strip_tags(urldecode($_SERVER["REQUEST_URI"]))));
    ini_set("error_reporting","E_ALL & ~E_NOTICE");
            //session_start();
            require 'includes/smartysetup.php';
     require_once("includes/xajax.inc.php");
            include "includes/tbversion.php"; // Grabs version of TrixBox from file /etc/trixbox/trixbox-version
            $smarty->assign("tbversion",tbversion());
            $smarty->assign("title","trixbox - User Mode");
    ...
    ?>
    

     

    ive tried to to comment sesion_start(); it works but does it gives any problems?

    how to i secure it to keep hackers out?

  13. when i put the mouse in the input box it will change color and border

    the problem is that when i put the mouse right on the border it keeps showing the hover form and the initial form .. very fast

    what can i do to solve it ??

    u can try and see for yourself if u don`t understand what i`m saying :|

    thanks in advance

     

     

     

    <input type="password" name="password" size="40"/>
    

     

    input:hover {
    border:1px solid #000000;
    color:black;
    
    }
    

     

×
×
  • 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.