Jump to content
php.lv forumi

magic quotes


vitao.web

Recommended Posts

Varbūt "zaļa" kluda, bet kas lietas laba darams?

 

Fatal error: Call to undefined function get_magic_quotes_gpc() in C:\AppServ\www\point\lib\functions.php on line 170

 

============================

 

 

; Magic quotes for incoming GET/POST/Cookie data.

magic_quotes_gpc = On vai OFF

 

Ta pat radas tas errors :S

Link to comment
Share on other sites

to pašu var izdarīt ar

ini_get('magic_quotes_gpc')

nevaru iebraukt... iedosu sava koda gabalu un tu varetu paradit, ka domajis esi, tad maybe sapratisu :)

 

 

function smartQuotes($value)
{
  if (get_magic_quotes_gpc()) {
      $value = stripslashes($value);
  }
  if (!is_numeric($value)) {
      $value = mysql_real_escape_string($value);
  }
  return $value;
}

Link to comment
Share on other sites

Emm, vispār tur ar novecošanu nav nekāda sakara, tā funkcija ir nepieciešama gadījumos, ja tie magic quoti ir ieslēgti uz servera. Parasti es tādu funkciju atstāju. Kāpēc viņa Tev nestrādā nav ne jausmas, pamēģini darīt kā 2easy teica:

 

function smartQuotes($value)
{
  if (ini_get('magic_quotes_gpc')) {
      $value = stripslashes($value);
  }
  if (!is_numeric($value)) {
      $value = mysql_real_escape_string($value);
  }
  return $value;
}

Edited by Maris-S
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...