Login Class-Logincontroller-dashboard page and mysql database The 2019 Stack Overflow...

Why didn't the Event Horizon Telescope team mention Sagittarius A*?

For what reasons would an animal species NOT cross a *horizontal* land bridge?

Why couldn't they take pictures of a closer black hole?

APIPA and LAN Broadcast Domain

Worn-tile Scrabble

How to notate time signature switching consistently every measure

Why don't hard Brexiteers insist on a hard border to prevent illegal immigration after Brexit?

What is preventing me from simply constructing a hash that's lower than the current target?

Why are there uneven bright areas in this photo of black hole?

Did Scotland spend $250,000 for the slogan "Welcome to Scotland"?

How do you keep chess fun when your opponent constantly beats you?

What is this sharp, curved notch on my knife for?

Can there be female White Walkers?

Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?

Is it safe to harvest rainwater that fell on solar panels?

How to support a colleague who finds meetings extremely tiring?

What information about me do stores get via my credit card?

Can you cast a spell on someone in the Ethereal Plane, if you are on the Material Plane and have the True Seeing spell active?

Keeping a retro style to sci-fi spaceships?

If a sorcerer casts the Banishment spell on a PC while in Avernus, does the PC return to their home plane?

What do I do when my TA workload is more than expected?

How to obtain a position of last non-zero element

Will it cause any balance problems to have PCs level up and gain the benefits of a long rest mid-fight?

Is it okay to consider publishing in my first year of PhD?



Login Class-Logincontroller-dashboard page and mysql database



The 2019 Stack Overflow Developer Survey Results Are InHow do I quickly rename a MySQL database (change schema name)?How do I connect to a MySQL Database in Python?PDO connection error when using symfony and MAMPHow to get the sizes of the tables of a MySQL database?php script echoing part of the php instead of what intended'Invalid parameter number' error using bindParam to create an mySQL queryBetter iteration to display Object properties PHPNeed help diagnosing php errorphp PDO sometimes not insert data into tableIssue creating a pdo connection to iis server





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I am new in php and would to build web site to accept username and password from login page and check them in database then return the name to dashboard



<?php
class LoginClass {
private $host = "localhost";
private $user = "root";
private $pass = "mysqlroot";
private $dataname = "test";
private $username;
private $password;
private $connect;
function __construct($username = null, $password = null)
{ $this->setLogin($username,$password);
$this->connecttodatabase();
if($this->getLogin() == 1)
{ return TRUE; }
else {return FALSE;}
$this->endDB();
}
private function connecttodatabase()
{ $this->connect = new PDO("mysql:host=$this->host;dbname=$this->dataname", $this->user, $this->pass);
//$this->connect->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
private function setLogin($username, $password)
{ $this->username = $username;
$this->password = $password;
}
private function getLogin()
{ $Q = $this->connect->prepare("SELECT name FROM person WHERE password = :password AND username = :username");
$Q->bindparam(':password',$this->password,PDO::PARAM_STR);
$Q->bindparam(':username',$this->username,PDO::PARAM_STR);
$qresult = $Q->execute();
return $qresult;
}
private function endDB()
{ $this->connect = null;
}

}
?>









share|improve this question













migrated from superuser.com yesterday


This question came from our site for computer enthusiasts and power users.














  • 1





    The question is not very specific, Can you please explain the problem you are facing?

    – Vijay
    yesterday


















0















I am new in php and would to build web site to accept username and password from login page and check them in database then return the name to dashboard



<?php
class LoginClass {
private $host = "localhost";
private $user = "root";
private $pass = "mysqlroot";
private $dataname = "test";
private $username;
private $password;
private $connect;
function __construct($username = null, $password = null)
{ $this->setLogin($username,$password);
$this->connecttodatabase();
if($this->getLogin() == 1)
{ return TRUE; }
else {return FALSE;}
$this->endDB();
}
private function connecttodatabase()
{ $this->connect = new PDO("mysql:host=$this->host;dbname=$this->dataname", $this->user, $this->pass);
//$this->connect->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
private function setLogin($username, $password)
{ $this->username = $username;
$this->password = $password;
}
private function getLogin()
{ $Q = $this->connect->prepare("SELECT name FROM person WHERE password = :password AND username = :username");
$Q->bindparam(':password',$this->password,PDO::PARAM_STR);
$Q->bindparam(':username',$this->username,PDO::PARAM_STR);
$qresult = $Q->execute();
return $qresult;
}
private function endDB()
{ $this->connect = null;
}

}
?>









share|improve this question













migrated from superuser.com yesterday


This question came from our site for computer enthusiasts and power users.














  • 1





    The question is not very specific, Can you please explain the problem you are facing?

    – Vijay
    yesterday














0












0








0








I am new in php and would to build web site to accept username and password from login page and check them in database then return the name to dashboard



<?php
class LoginClass {
private $host = "localhost";
private $user = "root";
private $pass = "mysqlroot";
private $dataname = "test";
private $username;
private $password;
private $connect;
function __construct($username = null, $password = null)
{ $this->setLogin($username,$password);
$this->connecttodatabase();
if($this->getLogin() == 1)
{ return TRUE; }
else {return FALSE;}
$this->endDB();
}
private function connecttodatabase()
{ $this->connect = new PDO("mysql:host=$this->host;dbname=$this->dataname", $this->user, $this->pass);
//$this->connect->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
private function setLogin($username, $password)
{ $this->username = $username;
$this->password = $password;
}
private function getLogin()
{ $Q = $this->connect->prepare("SELECT name FROM person WHERE password = :password AND username = :username");
$Q->bindparam(':password',$this->password,PDO::PARAM_STR);
$Q->bindparam(':username',$this->username,PDO::PARAM_STR);
$qresult = $Q->execute();
return $qresult;
}
private function endDB()
{ $this->connect = null;
}

}
?>









share|improve this question














I am new in php and would to build web site to accept username and password from login page and check them in database then return the name to dashboard



<?php
class LoginClass {
private $host = "localhost";
private $user = "root";
private $pass = "mysqlroot";
private $dataname = "test";
private $username;
private $password;
private $connect;
function __construct($username = null, $password = null)
{ $this->setLogin($username,$password);
$this->connecttodatabase();
if($this->getLogin() == 1)
{ return TRUE; }
else {return FALSE;}
$this->endDB();
}
private function connecttodatabase()
{ $this->connect = new PDO("mysql:host=$this->host;dbname=$this->dataname", $this->user, $this->pass);
//$this->connect->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
private function setLogin($username, $password)
{ $this->username = $username;
$this->password = $password;
}
private function getLogin()
{ $Q = $this->connect->prepare("SELECT name FROM person WHERE password = :password AND username = :username");
$Q->bindparam(':password',$this->password,PDO::PARAM_STR);
$Q->bindparam(':username',$this->username,PDO::PARAM_STR);
$qresult = $Q->execute();
return $qresult;
}
private function endDB()
{ $this->connect = null;
}

}
?>






php mysql






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked yesterday









Wael ElSayedWael ElSayed

1




1




migrated from superuser.com yesterday


This question came from our site for computer enthusiasts and power users.









migrated from superuser.com yesterday


This question came from our site for computer enthusiasts and power users.










  • 1





    The question is not very specific, Can you please explain the problem you are facing?

    – Vijay
    yesterday














  • 1





    The question is not very specific, Can you please explain the problem you are facing?

    – Vijay
    yesterday








1




1





The question is not very specific, Can you please explain the problem you are facing?

– Vijay
yesterday





The question is not very specific, Can you please explain the problem you are facing?

– Vijay
yesterday












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55611922%2flogin-class-logincontroller-dashboard-page-and-mysql-database%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55611922%2flogin-class-logincontroller-dashboard-page-and-mysql-database%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Cannot install PyQt5 The Next CEO of Stack OverflowCannot install tcpreplay 3.4.4cannot...

Kapp-Putsch Acontecimentos | Outros artigos | Menu de navegação

Why did early computer designers eschew integers? The Next CEO of Stack OverflowWhat register...