Click here to Skip to main content
15,393,050 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
AnswerRe: Call to a member function prepare() on a non-object Pin
Richard MacCutchan28-Aug-17 21:36
mveRichard MacCutchan28-Aug-17 21:36 
Questionhow to get hard disk Serial Number using php on server side Pin
Lakshmanan Duraisamy26-Jul-17 23:15
MemberLakshmanan Duraisamy26-Jul-17 23:15 
AnswerRe: how to get hard disk Serial Number using php on server side Pin
Richard MacCutchan26-Jul-17 23:35
mveRichard MacCutchan26-Jul-17 23:35 
AnswerRe: how to get hard disk Serial Number using php on server side Pin
Jochen Arndt27-Jul-17 0:09
professionalJochen Arndt27-Jul-17 0:09 
SuggestionRe: how to get hard disk Serial Number using php on server side Pin
Richard Deeming27-Jul-17 1:31
mveRichard Deeming27-Jul-17 1:31 
QuestionPHP connecting to vb.Net Pin
Member 1296881918-Jul-17 19:48
MemberMember 1296881918-Jul-17 19:48 
AnswerRe: PHP connecting to vb.Net Pin
Richard MacCutchan18-Jul-17 20:49
mveRichard MacCutchan18-Jul-17 20:49 
QuestionTrying to create a secure login script, just have a few questions. Pin
BlackMagix14-May-17 4:40
MemberBlackMagix14-May-17 4:40 
I'm trying to create a secure login script, but my code doesn't seem optimal. It seems to work but I'd like to know if there is a way I could optimize things and make it more secure.

<pre lang="PHP">

<pre><?php
include 'dbconnect.php';
//Database information

if (isset($_POST['submit'])){ //Was the form submitted?

  $error = array();//Declare An Array to store any error message

 if (filter_var($_POST['Email'], FILTER_VALIDATE_EMAIL)) { //Check to see if email is valid.

    $validatedemail = $_POST['Email'];

    //Now we know that the email is valid. Let's run some Queries
    $sql           = "SELECT * FROM users WHERE email = '$validatedemail'";
    $result        = mysql_query($sql);
    $num_result    = mysql_numrows($result);

    $row           = mysql_fetch_row($result);

    if ($num_result== 1) { //Is there a matching email in the database.

      if ($row[2] == sha1($_POST['Password'])) { //Check if the passwords match

         echo "MEGA SUCCESS";

      }
      else {$error[] = "Passwords do not match";}

    }
    else {$error[] = "No user found";}

  }
  else {$error[] = "Not a valid Email";}
}
echo
 "<div class=\"errormsgbox\"> <ol>";
            foreach ($error as $key => $values) {

                echo "<li>".$values."</li>";
            }

echo "<form class=\"login\" action=\"login.php\" method=\"post\">
        <p class=\"title\">Log in</p>
        <input type=\"text\" name=\"Email\" placeholder=\"Email\" autofocus/>
        "fa">
        <input type=\"Password\" name=\"Password\" placeholder=\"Password\" />

        <button>
          ^__i class=\"spinner\">
          <input type=\"submit\" name=\"submit\" value=\"Login!\">
        </button>

      </form>";


?>





Thanks guys Big Grin | :-D
AnswerRe: Trying to create a secure login script, just have a few questions. Pin
Superolmo10-Jul-17 9:09
MemberSuperolmo10-Jul-17 9:09 
QuestionSorting array and adding position numbers while/after sorting Pin
Member 131868238-May-17 4:15
MemberMember 131868238-May-17 4:15 
QuestionHelp Pin
Member 1302311826-Apr-17 3:40
MemberMember 1302311826-Apr-17 3:40 
AnswerRe: Help Pin
Jochen Arndt26-Apr-17 3:58
professionalJochen Arndt26-Apr-17 3:58 
GeneralRe: Help Pin
Member 1302311826-Apr-17 4:14
MemberMember 1302311826-Apr-17 4:14 
GeneralRe: Help Pin
Jochen Arndt26-Apr-17 4:43
professionalJochen Arndt26-Apr-17 4:43 
GeneralRe: Help Pin
Member 1302311826-Apr-17 4:55
MemberMember 1302311826-Apr-17 4:55 
GeneralRe: Help Pin
Jochen Arndt26-Apr-17 5:01
professionalJochen Arndt26-Apr-17 5:01 
QuestionHow To Add More Than One Entry On A Single Cell/Array ? Pin
Member 129567898-Apr-17 14:17
MemberMember 129567898-Apr-17 14:17 
AnswerRe: What is the difference between web development and Web designing? Pin
ZurdoDev21-Mar-17 1:48
professionalZurdoDev21-Mar-17 1:48 
QuestionWhere do I put my jquery and AngularJS libraries in wordpress? Pin
samflex17-Feb-17 8:14
Membersamflex17-Feb-17 8:14 
QuestionTrying to connect categories and users through pivot table i Laravel Pin
Duško Oljača3-Feb-17 1:21
MemberDuško Oljača3-Feb-17 1:21 
AnswerRe: Trying to connect categories and users through pivot table i Laravel Pin
Afzaal Ahmad Zeeshan3-Feb-17 2:10
mveAfzaal Ahmad Zeeshan3-Feb-17 2:10 
QuestionOutputting ROW QUERY result to main program Pin
ELMAGLAYA16-Jan-17 21:19
MemberELMAGLAYA16-Jan-17 21:19 
AnswerRe: Outputting ROW QUERY result to main program Pin
Richard MacCutchan16-Jan-17 21:53
mveRichard MacCutchan16-Jan-17 21:53 
QuestionHow to fix this error $_SESSION:Notice: Undefined offset: 0 Pin
ELMAGLAYA4-Jan-17 18:45
MemberELMAGLAYA4-Jan-17 18:45 
AnswerRe: How to fix this error $_SESSION:Notice: Undefined offset: 0 Pin
Jochen Arndt4-Jan-17 22:16
professionalJochen Arndt4-Jan-17 22:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.