How to add contents of file to MySQL query inside php -


i'm using following php query install tables in cms system:

$q=new mysql(" insert `adm` (`id`, `login`, `adm`, `passwd`, `czas`, `logged`, `ip`, `email`) values (0, 'admin', 1, password('admin'), 0, 0, '0.0.0.0', 'admin@domain.com'); "); 

however instead of e-mail admin@domain.com use e-mail stored inside /settings/contact.inc.php file is:

    <?php     $emailaddress='admin@domain.com';     ?> 

you can use like,

$query = "insert `adm` (`id`, `login`, `adm`, `passwd`, `czas`, `logged`, `ip`, `email`)            values (0, 'admin', 1, password('admin'), 0, 0, '0.0.0.0', '$emailaddress')"; 

note: need include /settings/contact.inc.php file.

do read: sql injection attacks! learn prepared statements instead, , use pdo or mysqli - this article decide which.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -