php - mysql_real_escape_string() expects parameter 1 to be string, -
i have used mysql_real_escape_string
give following error:
warning: mysql_real_escape_string() expects parameter 1 string, array given in /applications/xampp/xamppfiles/htdocs/example/infostud.php on line 16 line 16
$department=mysql_real_escape_string(['department']);
hi if have on page html or form send values page.html
<html> <head><title>title</title> </head> <body> <hr> <form action="page_to_process.php" method="post"> name:<br> <input name="name" id="name" type="text" size=50> <br>addres:<br> <input name="addres" id="addres" type="text"size=50> <br>phone:<br> <input name="phone" id="phone" type="text" size=50> <br> <p> <input type="submit" value="send" id="send" name="send"> </p> </form> </body> </html>
then on page need receive values make 1 this:
page_to_process.php
<?php if (isset($_post['send'])) { $name = mysql_real_escape_string($_post['name']); $addres = mysql_real_escape_string($_post['addres']); $phone = mysql_real_escape_string($_post['phone']); }
then have values on $name , $addres, $phone
for have 1 methods post, prefer post
try , luck...!!!
Comments
Post a Comment