Don't know I have only tested on Xampp and IISHello, the cms compatible with Cpanel?
PM your SkypeI just have one problem with forget.php, whenever I enter my email address to reset it, it doesnt send anything to my email, why
You have to setup a SMTP server, otherwise you cannot send emails. This you would have to contact your server support for enabling it.I just have one problem with forget.php, whenever I enter my email address to reset it, it doesnt send anything to my email, why
And for gmail enable in your account Allow less secure appsYou have to setup a SMTP server, otherwise you cannot send emails. This you would have to contact your server support for enabling it.
If you want your server to receive emails too, you'd have to setup a POP3 server also.
You must be registered for see links
Sent from my SM-G928F using Tapatalk
For gmail you would have to add several CNAME records to your DNS configuration.And for gmail enable in your account Allow less secure apps
For setting up a gmail to work with your domain, then yes CNAME records must be provided. Read Googles instructions. Done this several times.No is not needed.
Have a look inside class.db.php, the db connection is made outside the class, instead of just making it as a __construct function inside?Sorry, but this code is really bad. For example, mixing lowerCamelCasing with UpperCamelCasing, mixing English functions names (errors) and Dutch functions names ("gelukt"). Besides that, it just looks horrible. Take a look at php-fig.org - I beg you.
if(!defined('IN_INDEX')) { exit(http_response_code(403)); };
class mysql {
public $db;
public $pdo;
private static $inst;
final public function __construct() {
global $_CONFIG;
try {
$this->pdo = new PDO(
'mysql:dbname='.$_CONFIG['mysql']['database'].';host='.$_CONFIG['mysql']['hostname'].';charset='.$_CONFIG['mysql']['charset'],
$_CONFIG['mysql']['username'],
$_CONFIG['mysql']['password']
);
$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$this->pdo->exec("SET `time_zone` = '{$this->timeZone()}';");
} catch(PDOException $e) {
die($e->getMessage());
}
}
final public function __destruct() {
// Destruct the connection to DB once finished
try {
$this->pdo = null;
} catch(PDOException $e) {
die($e->getMessage());
}
}
final public static function PDO() {
if(!isset(self::$inst)) {
$class = __CLASS__;
self::$inst = new $class;
}
return self::$inst;
}
final public function query($sql) {
$conn = $this->PDO();
return $conn->pdo->prepare($sql);
}
final public function lastId() {
return $this->pdo->lastInsertId();
}
final public function timeZone() {
if(!isset($_SESSION['user']['time_zone'])) {
$now = new \DateTime();
$mins = $now->getOffset() / 60;
$sgn = ($mins < 0 ? -1 : 1);
$mins = abs($mins);
$hrs = floor($mins / 60);
$mins -= ($hrs * 60);
$_SESSION['user']['time_zone'] = sprintf('%+d:%02d', ($hrs * $sgn), $mins);
}
return $_SESSION['user']['time_zone'];
}
}
Thanks for your message! I made this CMS to learn from it. Can you give an example how I can improve it?Sorry, but this code is really bad. For example, mixing lowerCamelCasing with UpperCamelCasing, mixing English functions names (errors) and Dutch functions names ("gelukt"). Besides that, it just looks horrible. Take a look at php-fig.org - I beg you.
Thank you I'm going to improveHave a look inside class.db.php, the db connection is made outside the class, instead of just making it as a __construct function inside?
Here's my example for what I use in my CMS:
PHP:if(!defined('IN_INDEX')) { exit(http_response_code(403)); }; class mysql { public $db; public $pdo; private static $inst; final public function __construct() { global $_CONFIG; try { $this->pdo = new PDO( 'mysql:dbname='.$_CONFIG['mysql']['database'].';host='.$_CONFIG['mysql']['hostname'].';charset='.$_CONFIG['mysql']['charset'], $_CONFIG['mysql']['username'], $_CONFIG['mysql']['password'] ); $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $this->pdo->exec("SET `time_zone` = '{$this->timeZone()}';"); } catch(PDOException $e) { die($e->getMessage()); } } final public function __destruct() { // Destruct the connection to DB once finished try { $this->pdo = null; } catch(PDOException $e) { die($e->getMessage()); } } final public static function PDO() { if(!isset(self::$inst)) { $class = __CLASS__; self::$inst = new $class; } return self::$inst; } final public function query($sql) { $conn = $this->PDO(); return $conn->pdo->prepare($sql); } final public function lastId() { return $this->pdo->lastInsertId(); } final public function timeZone() { if(!isset($_SESSION['user']['time_zone'])) { $now = new \DateTime(); $mins = $now->getOffset() / 60; $sgn = ($mins < 0 ? -1 : 1); $mins = abs($mins); $hrs = floor($mins / 60); $mins -= ($hrs * 60); $_SESSION['user']['time_zone'] = sprintf('%+d:%02d', ($hrs * $sgn), $mins); } return $_SESSION['user']['time_zone']; } }
Check out php-fig.orgThanks for your message! I made this CMS to learn from it. Can you give an example how I can improve it?
Thank you I'm going to improve
You do realize it's PDO?TAKE DOWN THIS CMS TO MANY EXPLOITS PEOPLE JUST CAN STEAL DATABASE INFORMATION JUST HAPPEND TO MANY I REPEAT DO NOT USE THIS CMS IF YOU WANNA GO BIG !!!
Have a look inside class.db.php, the db connection is made outside the class, instead of just making it as a __construct function inside?
Here's my example for what I use in my CMS: