Re: [PHP] PHP Command line script
- From: lists@xxxxxxxxxxxxxxxxxxx (Nathaniel Hall)
- Date: Tue, 01 May 2007 17:20:18 -0500
Daniel Brown wrote:
I changed the user I was connecting as in order to post. I don't use root in the real code.
First and foremost, it's a VERY BAD idea to use root for MySQL. If your code isn't perfect (and even sometimes if it is), arbitrary commands and SQL injection attacks could lead to migraines that no Tylenol will ever be able to alleviate.
It doesn't give an error. The only thing it does is continue on through the IF statement, which goes nowhere. I have added an ELSE to the script and run it. It ends up running the code in the ELSE.
Secondly, what error is the CLI kicking out when you run it from the command line?
--
$login = date('m\-d\-Y');
if ($logout = $mysqli->prepare("UPDATE `mydb`.`authlog` SET
`logout` = ? WHERE `login` LIKE '$login%'")) { // <--- Will not
go any further than here, even when hard coding the information.
$logout->bind_param("s", date('m\-d\-Y\TH\:i\:s'));
$logout->execute();
$logout->close();
}
Nathaniel Hall, GSEC GCFW GCIA GCIH GCFA
Spider Security
.
- References:
- PHP Command line script
- From: Nathaniel Hall
- Re: [PHP] PHP Command line script
- From: "Daniel Brown"
- PHP Command line script
- Prev by Date: Re: [PHP] Deviation? Distribution? OT?
- Next by Date: Re: [PHP] PHP Command line script
- Previous by thread: Re: [PHP] PHP Command line script
- Next by thread: Re: [PHP] PHP Command line script
- Index(es):