Jump to content

Emesh

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Everything posted by Emesh

  1. I found the cause, being <!DOCTYPE html> I'm not sure how or why its doing it though...
  2. I've recently had a problem with my admin site where PHP sessions, which are stored in a MySQL database, are duplicating and causing the page to return to the login screen. Usually the site works fine in Firefox, but stops working in IE and Safari. This problem suddenly appeared over night with no change to the files. Due to the amount of code, I'm reluctant to post it all, but does anyone have a suggestion on why this could be happening and how to solve it?
  3. The code is essentially as above. Originally my function was: function security($data) { if(is_array($data)) { foreach ($data as $key => $value){ $data[$key] = security($value); } return $data; }else{ return mysql_real_escape_string(addslashes($data)); } } And the PHP code: mysql_connect($dbserver, $dbusername, $dbpassword); mysql_select_db($dbname); $sitetitle = security($_POST[sitetitle]); $query = mysql_query("UPDATE site_settings SET sitetitle = '$sitetitle'"); echo("<b>Settings Updated!</b>"); I just want to be able to use proper punctuation in forms!
  4. Thanks for your reply. Using the function doesn't seem to help the problem, I still get the same SQL Syntax error... This is probably more my lack of php knowledge, because don't use php very often.
  5. This will have been posted before, but I can't find a solution that works. Most people say to try mysql_real_escape_string, I have tried lots of variations and it doesn't seem to work. Could anyone help with the below code? It is part of a form that returns a syntax error when adding a single quotation mark e.g. entering "Bryan's" into the form causes the error. I'd be really grateful for any assistance. Steven P.S. Before anyone mentions it, the mysql connect does work - I just haven't included the full page of code. mysql_connect($dbserver, $dbusername, $dbpassword); mysql_select_db($dbname); $sitetitle = htmlentities($_POST[sitetitle]); $query = mysql_query("UPDATE site_settings SET sitetitle = '$sitetitle'"); echo("<b>Settings Updated!</b>");
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.