Форум: Форум PHPФорум ApacheФорум Регулярные ВыраженияФорум MySQLHTML+CSS+JavaScriptФорум FlashРазное
Новые темы: 0000000
PHP Puzzles. Авторы: Кузнецов М.В., Симдянов И.В. PHP 5. На примерах. Авторы: Кузнецов М.В., Симдянов И.В., Голышев С.В. Самоучитель PHP 5 / 6 (3 издание). Авторы: Кузнецов М.В., Симдянов И.В. Самоучитель MySQL 5. Авторы: Кузнецов М.В., Симдянов И.В. Социальная инженерия и социальные хакеры. Авторы: Кузнецов М.В., Симдянов И.В.
ВСЕ НАШИ КНИГИ
Консультационный центр SoftTime

Форум PHP

Выбрать другой форум

 

Здравствуйте, Посетитель!

вид форума:
Линейный форум (новые сообщения вниз) Структурный форум

тема: Call to undefined function

Сообщения:  [1-4] 

 
 автор: Shorr Kan   (31.03.2006 в 06:10)   письмо автору
 
   для: Бамси   (31.03.2006 в 05:39)
 


<?php 
include "config.php"
############################
function links($error

    echo 
"<p>".$error."</p>"
    echo 
"<p><a href=# onClick='history.back()'>&#194;&#229;&#240;&#237;&#243;&#242;&#252;&#241;&#255; &#234; &#240;&#229;&#227;&#232;&#241;&#242;&#240;&#224;&#246;&#232;&#232;</a></p>"
    echo 
"<p><a href=index.php>&#194;&#229;&#240;&#237;&#243;&#242;&#252;&#241;&#255; &#237;&#224; &#227;&#235;&#224;&#226;&#237;&#243;&#254; &#241;&#242;&#240;&#224;&#237;&#232;&#246;&#243;</a></p>"
    exit(); 

############################

  
$CharsNick trim($_POST['CharsNick']); 
  
$CharsWorld = ($_POST['CharsWorld']); 
  
$RealName = ($_POST['RealName']); 
  
$City trim($_POST['City']); 
  
$Email trim($_POST['Email']); 
  
$URL trim($_POST['URL']); 
  
$ICQ trim($_POST['ICQ']); 
  
$msg trim($_POST['msg']); 

  if(
trim($CharsNick)==""
  { 
  
links("&#194;&#251; &#237;&#229; &#226;&#226;&#229;&#235;&#232; &#226;&#224;&#248; &#237;&#232;&#234;.\n"); 
  } 
  
// &#194;&#251;&#255;&#241;&#237;&#255;&#229;&#236; &#237;&#229; &#231;&#224;&#240;&#229;&#227;&#232;&#241;&#242;&#240;&#232;&#240;&#238;&#226;&#224;&#237;&#238; &#235;&#232; &#243;&#230;&#229; &#253;&#242;&#238; &#232;&#236;&#255; 
  
$query 'select * from users where CharsNick ="'$CharsNick.'"'
  
$ath mysql_query($query); 
  if(
$ath
  { 
    
$auth mysql_fetch_array($ath); 
    if(
strtolower($auth['CharsNick'])==strtolower($CharsNick)) links("&#221;&#242;&#238; &#232;&#236;&#255; &#243;&#230;&#229; &#229;&#241;&#242;&#252; &#226; &#241;&#239;&#232;&#241;&#234;&#229;.\n"); 
  } 
  
$CharsNick substr($CharsNick,0,32); 
  
$CharsNick htmlspecialchars(stripslashes($CharsNick)); 
  if(
$CharsWorld=="nop"links("&#194;&#251; &#237;&#229; &#226;&#251;&#225;&#240;&#224;&#235;&#232; &#226;&#224;&#248; &#236;&#232;&#240;.\n"); 
  
$CharsWorld substr($CharsWorld,0,32); 
  
$CharsWorld htmlspecialchars(stripslashes($CharsWorld)); 
  if(
trim($Email)!=""
  { 
  if (!
preg_match("/[0-9a-z_]+@[0-9a-z_^\.]+\.[a-z]{2,3}/i"$Email)) links("&#194;&#226;&#229;&#228;&#232;&#242;&#229; e-mail &#226; &#226;&#232;&#228;&#229; <i>something@server.com.\n"); 
  } 
  
$Email substr($Email,0,32); 
  
$Email htmlspecialchars(stripslashes($Email)); 
  
$RealName substr($RealName,0,32); 
  
$RealName htmlspecialchars(stripslashes($RealName)); 
  
$City substr($City,0,32); 
  
$City htmlspecialchars(stripslashes($City)); 
  
$URL substr($URL,0,60); 
  
$URL htmlspecialchars(stripslashes($URL)); 
  
$ICQ substr($ICQ,0,32); 
  
$ICQ htmlspecialchars(stripslashes($ICQ)); 
  
$msg substr($msg,0,1024); 
  
$msg htmlspecialchars(stripslashes($msg)); 
   
  
$CharsNick str_replace("'","'",$CharsNick); 
  
$CharsWorld str_replace("'","'",$CharsWorld); 
  
$RealName str_replace("'","'",$RealName); 
  
$City str_replace("'","'",$City); 
  
$Email str_replace("'","'",$Email); 
  
$URL str_replace("'","'",$URL); 
  
$ICQ str_replace("'","'",$ICQ); 
  
$msg str_replace("'","'",$msg); 

  
$query_add "insert into authors values( 
           0, 
           '
$CharsNick', 
           '
$CharsWorld', 
           '
$RealName', 
           '
$ICQ', 
           NOW(), 
           '
$City', 
           '
$Email', 
           '
$URL', 
           '
$msg', 
           0 
           )"

            
    if(
mysql_query($query_add)) 
    { 
          echo 
"<HTML><HEAD> 
            <META HTTP-EQUIV='Refresh' CONTENT='0; URL=index.php'> 
            </HEAD></HTML>"

    } else { 
    
?> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> 
<title></title> 
<link rel="StyleSheet" type="text/css" href="perepis.css"> 
</head> 
<body bottommargin="0" marginheight="0" marginwidth="0" rightmargin="0" leftmargin="0" topmargin="0"> 
<table border="0" cellspacing="0" width="100%" cellpadding="0"> 
    <tr> 
        <td colspan="3" height="35"><p class="pcolor1"><nobr><b>&#207;&#229;&#240;&#229;&#239;&#232;&#241;&#252; &#240;&#243;&#241;&#241;&#234;&#238;&#227;&#238; &#237;&#224;&#241;&#229;&#235;&#229;&#237;&#232;&#255;</nobr></b></p></td> 
        <td width="100%" colspan="2"><nop></td> 
    </tr> 
    <tr align="center"> 
        <td width="150" colspan="2"><nop></td> 
        <td height="4" bgcolor="#EAEAEA"><nop></td> 
        <td bgcolor="silver"><nop></td> 
        <td bgcolor="gray"><nop></td> 
    </tr> 
</table> 
<table width="100%"> 
    <tr align="right"> 
        <td> 
            <a class=link href="index.php" title="&#194;&#229;&#240;&#237;&#243;&#242;&#252;&#241;&#255; &#234; &#241;&#239;&#232;&#241;&#234;&#243;.">&#209;&#239;&#232;&#241;&#238;&#234; &#240;&#243;&#241;&#241;&#234;&#238;&#227;&#238; &#237;&#224;&#241;&#229;&#235;&#229;&#237;&#232;&#255;.</a>&nbsp;&nbsp; 
        </td> 
        <td width="10%">&nbsp;</td> 
    </tr> 
</table> 

</body> 
</html> 
    <? 
    

?>

   
 
 автор: Бамси   (31.03.2006 в 05:39)   письмо автору
 
   для: Shorr Kan   (31.03.2006 в 03:53)
 

А куда я его еще засуну если не в else?
И каким образом перенесу выше? :/

   
 
 автор: Shorr Kan   (31.03.2006 в 03:53)   письмо автору
 
   для: Бамси   (31.03.2006 в 03:02)
 

Саму функцию перенесите выше, чем ее вызов. Или вытащите ее из if. Вернее, из else.

   
 
 автор: Бамси   (31.03.2006 в 03:02)   письмо автору
 
 

Что здесь не так?

<?php
include "config.php";

  
$CharsNick trim($_POST['CharsNick']);
  
$CharsWorld = ($_POST['CharsWorld']);
  
$RealName = ($_POST['RealName']);
  
$City trim($_POST['City']);
  
$Email trim($_POST['Email']);
  
$URL trim($_POST['URL']);
  
$ICQ trim($_POST['ICQ']);
  
$msg trim($_POST['msg']);

  if(
trim($CharsNick)=="")
  {
  
links("&#194;&#251; &#237;&#229; &#226;&#226;&#229;&#235;&#232; &#226;&#224;&#248; &#237;&#232;&#234;.\n");
  }
  
// &#194;&#251;&#255;&#241;&#237;&#255;&#229;&#236; &#237;&#229; &#231;&#224;&#240;&#229;&#227;&#232;&#241;&#242;&#240;&#232;&#240;&#238;&#226;&#224;&#237;&#238; &#235;&#232; &#243;&#230;&#229; &#253;&#242;&#238; &#232;&#236;&#255;
  
$query 'select * from users where CharsNick ="'$CharsNick.'"';
  
$ath mysql_query($query);
  if(
$ath)
  {
    
$auth mysql_fetch_array($ath);
    if(
strtolower($auth['CharsNick'])==strtolower($CharsNick)) links("&#221;&#242;&#238; &#232;&#236;&#255; &#243;&#230;&#229; &#229;&#241;&#242;&#252; &#226; &#241;&#239;&#232;&#241;&#234;&#229;.\n");
  }
  
$CharsNick substr($CharsNick,0,32);
  
$CharsNick htmlspecialchars(stripslashes($CharsNick));
  if(
$CharsWorld=="nop"links("&#194;&#251; &#237;&#229; &#226;&#251;&#225;&#240;&#224;&#235;&#232; &#226;&#224;&#248; &#236;&#232;&#240;.\n");
  
$CharsWorld substr($CharsWorld,0,32);
  
$CharsWorld htmlspecialchars(stripslashes($CharsWorld));
  if(
trim($Email)!="")
  {
  if (!
preg_match("/[0-9a-z_]+@[0-9a-z_^\.]+\.[a-z]{2,3}/i"$Email)) links("&#194;&#226;&#229;&#228;&#232;&#242;&#229; e-mail &#226; &#226;&#232;&#228;&#229; <i>something@server.com.\n");
  }
  
$Email substr($Email,0,32);
  
$Email htmlspecialchars(stripslashes($Email));
  
$RealName substr($RealName,0,32);
  
$RealName htmlspecialchars(stripslashes($RealName));
  
$City substr($City,0,32);
  
$City htmlspecialchars(stripslashes($City));
  
$URL substr($URL,0,60);
  
$URL htmlspecialchars(stripslashes($URL));
  
$ICQ substr($ICQ,0,32);
  
$ICQ htmlspecialchars(stripslashes($ICQ));
  
$msg substr($msg,0,1024);
  
$msg htmlspecialchars(stripslashes($msg));
  
  
$CharsNick str_replace("'","'",$CharsNick);
  
$CharsWorld str_replace("'","'",$CharsWorld);
  
$RealName str_replace("'","'",$RealName);
  
$City str_replace("'","'",$City);
  
$Email str_replace("'","'",$Email);
  
$URL str_replace("'","'",$URL);
  
$ICQ str_replace("'","'",$ICQ);
  
$msg str_replace("'","'",$msg);

  
$query_add "insert into authors values(
           0,
           '
$CharsNick',
           '
$CharsWorld',
           '
$RealName',
           '
$ICQ',
           NOW(),
           '
$City',
           '
$Email',
           '
$URL',
           '
$msg',
           0
           )"
;
           
    if(
mysql_query($query_add))
    {
          echo 
"<HTML><HEAD>
            <META HTTP-EQUIV='Refresh' CONTENT='0; URL=index.php'>
            </HEAD></HTML>"
;
    } else {
    
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title></title>
<link rel="StyleSheet" type="text/css" href="perepis.css">
</head>
<body bottommargin="0" marginheight="0" marginwidth="0" rightmargin="0" leftmargin="0" topmargin="0">
<table border="0" cellspacing="0" width="100%" cellpadding="0">
    <tr>
        <td colspan="3" height="35"><p class="pcolor1"><nobr><b>&#207;&#229;&#240;&#229;&#239;&#232;&#241;&#252; &#240;&#243;&#241;&#241;&#234;&#238;&#227;&#238; &#237;&#224;&#241;&#229;&#235;&#229;&#237;&#232;&#255;</nobr></b></p></td>
        <td width="100%" colspan="2"><nop></td>
    </tr>
    <tr align="center">
        <td width="150" colspan="2"><nop></td>
        <td height="4" bgcolor="#EAEAEA"><nop></td>
        <td bgcolor="silver"><nop></td>
        <td bgcolor="gray"><nop></td>
    </tr>
</table>
<table width="100%">
    <tr align="right">
        <td>
            <a class=link href="index.php" title="&#194;&#229;&#240;&#237;&#243;&#242;&#252;&#241;&#255; &#234; &#241;&#239;&#232;&#241;&#234;&#243;.">&#209;&#239;&#232;&#241;&#238;&#234; &#240;&#243;&#241;&#241;&#234;&#238;&#227;&#238; &#237;&#224;&#241;&#229;&#235;&#229;&#237;&#232;&#255;.</a>&nbsp;&nbsp;
        </td>
        <td width="10%">&nbsp;</td>
    </tr>
</table>

</body>
</html>
    <?
function links($error)
{
    echo 
"<p>".$error."</p>";
    echo 
"<p><a href=# onClick='history.back()'>&#194;&#229;&#240;&#237;&#243;&#242;&#252;&#241;&#255; &#234; &#240;&#229;&#227;&#232;&#241;&#242;&#240;&#224;&#246;&#232;&#232;</a></p>";
    echo 
"<p><a href=index.php>&#194;&#229;&#240;&#237;&#243;&#242;&#252;&#241;&#255; &#237;&#224; &#227;&#235;&#224;&#226;&#237;&#243;&#254; &#241;&#242;&#240;&#224;&#237;&#232;&#246;&#243;</a></p>";
    exit();
}
    }
?>


Пишет :

Fatal error: Call to undefined function links() in D:\WebServer\WWW\Perepis\add.php on line 15

   

Сообщения:  [1-4] 

Форум разработан IT-студией SoftTime
Rambler's Top100
вверх

Rambler's Top100 Яндекс.Метрика Яндекс цитирования