Jump to content

papaface

Members
  • Posts

    1,437
  • Joined

  • Last visited

    Never

Posts posted by papaface

  1. Yes, on the login page when retrieving the MD5'ed password you simple convert the password they entered into md5 and compare it against the one you have in the db. If they match then they got the correct password.

    As for registering, you just insert the MD5'ed password into the db.

  2. thanks, but now im getting

    unexpected T_STRING

    On line 21

    <?php
    $host['name'] = '86.92.129.3';
    $host['username'] = 'root';
    $host['password'] = '';
    $host['databasename'] = 'odinms';
    
    $db = mysql_connect($host['name'], $host['username'], $host['password']) OR die ('Cant connect to MySQL!');
    mysql_select_db($host['databasename'], $db);
    
    $name = $_POST['name'];
    $age = $_POST['age'];
    $accountname = $_POST['accountname'];
    $experience = $_POST['experience'];
    $why = $_POST['why'];
    $sel = "SELECT * FROM accounts WHERE name='$name'";
    
    if ($accountname == '');
    {
    echo "Please enter a accountname!";
    }
    $d = INSERT INTO `gmapps` (`name`, `age`, `accountname`, `experience`, `why`) VALUES ($name, $age, $accountname, $experience, $why); // Line 21
    mysql_query($d) OR die (mysql_error());
    echo "Your GM Application has been send!";
    ?>

     

    -AlmarM-

    You didnt use my modified version. Copy it again.

    P.S This extremely easy stuff, you should look into the basics of PHP.

  3. Should be:

    <?php
    $host['name'] = '86.92.129.3';
    $host['username'] = 'root';
    $host['password'] = '';
    $host['databasename'] = 'odinms';
    $db = mysql_connect($host['name'], $host['username'], $host['password']) OR die ('Cant connect to MySQL!');
    mysql_select_db($host['databasename'], $db);
    $name = $_POST['name'];
    $age = $_POST['age'];
    $accountname = $_POST['accountname'];
    $experience = $_POST['experience'];
    $why = $_POST['why'];
    $sel = "SELECT * FROM accounts WHERE name='$name'";
    if ($accountname == '');
    {
    echo "Please enter a accountname!";
    }
    $d = "INSERT INTO `gmapps` (`name`, `age`, `accountname`, `experience`, `why`) VALUES ($name, $age, $accountname, $experience, $why)";
    mysql_query($d) OR die (mysql_error());
    echo "Your GM Application has been send!";
    ?>

  4. Do you want:

    	
    <table width="860px" align="center" cellpadding="0" cellspacing="0" border="0" class="randimg">
    <?php
    $sql = mysql_query("SELECT * FROM pics ORDER BY id DESC");
    $i = 0;
    while($pics = mysql_fetch_array($sql)) {
    echo "<tr>";
    $id = $pics['id'];
    $cat = $pics['cat'];
    $pic = $pics['pic'];
    echo "<td></td>
    </tr>";
    }
    ?>
    </table>

    You're not explaining yourself very well.

  5. <?php
    require_once("dbFunctions.php");
    dbConnect();
    
    if(isset($_POST['Submit']))
    {
    
    if (isset($_POST['txtname']))
    $name =  $_POST['txtname']  
    else
    $name = "";
    if (isset($_POST['checkbox']))
    $opt1 = $_POST['checkbox'];
    else
    $opt1 = "";
    if (isset($_POST['checkbox2']))
    $opt2 = $_POST['checkbox2'];
    else
    $opt2 = "";
    if (isset($_POST['checkbox3']))
    $opt3 = $_POST['checkbox3'];
    else
    $opt3 = "";
    
    		$query="INSERT INTO alloyd (name, option1, option2, option3) VALUES ('$name', '$opt1', '$opt2', '$opt3');";
    		$result = dbQuery($query);
    
    		echo "Results Added!";
    
    }
    
    ?>

    Very bad way to do it, but it utilizes your current code.

    Technically, you might aswell just do:

    <?php
    require_once("dbFunctions.php");
    dbConnect();
    
    if(isset($_POST['Submit']))
    {
    
    		$query="INSERT INTO alloyd (name, option1, option2, option3) VALUES ('".$_POST['txtname']."', '".$_POST['checkbox']."', '".$_POST['checkbox2']."', '".$_POST['checkbox3']."');";
    		$result = dbQuery($query);
    
    		echo "Results Added!";
    
    }
    
    ?>

  6. <?php
    $after = "thanks.html"; 
    $oops = "oops.html";
    
    if (!isset($_POST['submit']) || $_SERVER['REQUEST_METHOD'] != "POST") {
        exit("<p>You did not press the submit button; this page should not be accessed directly.</p>");
    } else {
        $exploits = "/(content-type|bcc:|cc:|document.cookie|onclick|onload|javascript|alert)/i";
        $profanity = "/(beastial|bestial|blowjob|clit|cock|cum|cunilingus|cunillingus|cunnilingus|cunt|ejaculate|fag|felatio|fellatio|****|fuk|fuks|gangbang|gangbanged|gangbangs|hotsex|jism|jiz|kock|kondum|kum|kunilingus|orgasim|orgasims|orgasm|orgasms|phonesex|phuk|phuq|porn|pussies|pussy|spunk|xxx)/i";
        $spamwords = "/(viagra|phentermine|tramadol|adipex|advai|alprazolam|ambien|ambian|amoxicillin|antivert|blackjack|backgammon|texas|holdem|poker|carisoprodol|ciara|ciprofloxacin|debt|dating|porn)/i";
        $bots = "/(Indy|Blaiz|Java|libwww-perl|Python|OutfoxBot|User-Agent|PycURL|AlphaServer)/i";
    
        if (preg_match($bots, $_SERVER['HTTP_USER_AGENT'])) {
            exit("<p>Known spam bots are not allowed.</p>");
        }
        foreach ($_POST as $key => $value) {
            $value = trim($value);
    
            if (empty($value)) {
            	if ($key != "email")  
            		{
                exit("<p>Empty fields are not allowed. Please go back and fill in the form properly.</p>");      
                	}
            } elseif (preg_match($exploits, $value)) {
                exit("<p>Exploits/malicious scripting attributes aren't allowed.</p>");
            } elseif (preg_match($profanity, $value) || preg_match($spamwords, $value)) {
                exit("<p>That kind of language is not allowed through our form.</p>");
            }
    
            $_POST[$key] = stripslashes(strip_tags($value));
        }
    
        if (!ereg("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,6})$",strtolower($_POST['email']))) {
            exit("<p>That e-mail address is not valid, please use another.</p>");
        }
    
        $recipient = "07932234312@text.aql.com, jasonhutchinson32@btinternet.com";
        $subject = "Web Site Enquiry";
        
        $message .= "Name: {$_POST['name']} \n";
        $message .= "Email: {$_POST['email']} \n";
        $message .= "Contact: {$_POST['contact']} \n";
        $message .= "Address: {$_POST['address']} \n";
        $message .= "Postcode: {$_POST['postcode']} \n";
        $message .= "Vehicle: {$_POST['vehicle']} \n";
        $message .= "Damage: {$_POST['damage']} \n";
    
    
    
    
        $headers .= "Reply-To: <{$_POST['email']}>";
    
        if (mail($recipient,$subject,$message,$headers)) {
            echo "<meta HTTP-EQUIV=\"REFRESH\" content=\"0; url=$after\">"; 
        } else {
            echo "<meta HTTP-EQUIV=\"REFRESH\" content=\"0; url=$oops\">";
        }
    }
    ?>

    Try that.

  7. I think it should be:

    <?php
    
    
    function unset_required_fields(&$array){
    
      foreach( $array as $key=>$value)
      {
        echo '#KEY being looked at: ['.$key.']<br/>';
    
    
    	echo '$array be4:<pre>'.htmlspecialchars(print_r($array, true)).'</pre><br/>';
    
      	if( is_array($value) )
      		{	
    		echo 'RECURSE, look at array under ['. $key .']...'.'<br/>';
    		unset_required_fields($value);
    	}
    	else if( $key == 'required')
    	{
    		echo 'CHANGED array,  value for this "required" key should now be 0!!!'.'<br/>';
    		$array[$key] = 0; //'#required'
    	}
    	else
    	{
    	echo 'Nothing cool happens since not an array or required field'.'<br/>';		
    	}
    
    	echo '$array AFTER:<pre>'.htmlspecialchars(print_r($array, true)).'</pre><br/>';
    	}
    }
    
    $thearray =
    array(
        'title' => "Here are some radio button questions",
        'required' => 1,
        'weight' => 2, 
        'child 1' =>
        array(
          'title' => "Radio button 1 question: blah blah?",
          'required' => 1,
          'weight' => -1 
        ),
       'someotherparameters0' => 0,
       'child 2' => 
       array(
          'title' => "Radio button 2 question: blah blah?",
          'required' => 1,
          'weight' => -1 
       ), 
       'someotherparameters1' => 0,
       'someotherparameters2' => "bleh"  
    );   
    
    unset_required_fields($thearray);
    
    ?>

  8. Try:

    If you're using $_POST vars use:

    mysql_query ("Insert into `userinfo` (`username`,`email`,`password`,`location`) VALUES ( $_POST['userid'] , $_POST['email'], $_POST['password'], $_POST['location'])" );

    If you're using $_GET vars use:

    mysql_query ("Insert into `userinfo` (`username`,`email`,`password`,`location`) VALUES ( $_GET['userid'] , $_GET['email'], $_GET['password'], $_GET['location'])" );

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