Просмотр сообщений

В этом разделе можно просмотреть все сообщения, сделанные этим пользователем.


Сообщения - ramazian

Страницы: [1]
1
PHP / Ребята, сново нужна помощ в Search
« : 31 Мая 2003, 12:22:21 »
Ребята не дуйтесь :-)
Я в PHP полный чайник.
Скрипт из интернета скачан.
Просто помогите чем можете.

Спасибо.

2
PHP / Ребята, сново нужна помощ в Search
« : 30 Мая 2003, 10:36:43 »
Почему Search не работает?



Спасибо


######################################
Ето скрипт.
######################################

<form name="itemsform">

<?

if (
$option == "search"):

	
exec("grep -i $search dbase.txt",$execAr);

	
if (
$execAr[0] != ""):

	
	
while ( list(
$key,$val) = each$execAr ) ) {

	
	
$tok strtok($val,"|");
	
	
$categ $tok;
	
	
$tok strtok("|");
	
	
$name $tok;
	
	
$tok strtok("|");
	
	
$type $tok;
	
	
$tok strtok("|");
	
	
$id $tok;
	
	
$tok strtok("|");
	
	
$options $tok;
	
	
$tok strtok("|");
	
	
$price $tok;
	
	
$tok strtok("|");
	
	
$normpr $tok;
	
	
$tok strtok("|");
	
	
$img $tok;
	
	
$tok strtok("|");
	
	
$stockop $tok;
	
	
$tok strtok("|");
	
	
$advdate $tok;
	
	
$tok strtok("|");
	
	
$details $tok;
	
	
$tok strtok("|");
	
	
$desc $tok;

	
	
displayProd($categ,$type,$id,$name,$options,$price,$normpr,$img,$stockop,$advdate,$details,$desc);

	
	
}

	
else:

	
	
echo 
"There were no matches for your search query.
	
	
<P>



<hr width=\\"
100%\\" size=\\"1\\" noshade color=\\"black\\">";

	
endif;

else:

	
$cartFile File("dbase.txt");
	
$length sizeof($cartFile);
	
$i 1;
	
while (
$i $length):
	
$tok strtok($cartFile[$i],"|");
	
$categ $tok;
	
$tok strtok("|");
	
$name $tok;
	
$tok strtok("|");
	
$type $tok;
	
$tok strtok("|");
	
$id $tok;
	
$tok strtok("|");
	
$options $tok;
	
$tok strtok("|");
	
$price $tok;
	
$tok strtok("|");
	
$normpr $tok;
	
$tok strtok("|");
	
$img $tok;
	
$tok strtok("|");
	
$stockop $tok;
	
$tok strtok("|");
	
$advdate $tok;
	
$tok strtok("|");
	
$details $tok;
	
$tok strtok("|");
	
$desc $tok;
	


	
if (
$categ == "$cat|| $cat == ""):
	

	
	
displayProd($categ,$type,$id,$name,$options,$price,$normpr,$img,$stockop,$advdate,$details,$desc);

	
endif;

	
$i++;
endwhile;

endif;

?>

</form>

######################################
А это файл dbase.txt
######################################

Biblies|Classical Armenian (grabar)|single|dedehhccdffih| |30|30|1.jpg|instock| |#|Classical Armenian (grabar), reprint of Constantinople, 1895 edition, includes also the Deuterocanonical books taken from Zohrapian Bible, 1805. The footnotes introduce the variations from Hebrew and Greek texts. The Bible Society of Armenia, 1997
Biblies|New translation|single|dedehjffdefee| |25|25|2.jpg|instock| |#|New translation of the Bible published by Fr. Arsen Bagratouni (1860) into Eastern Armenian, classical spelling. The Mother See of Holy Etchmiadzin and the Bible Society of Armenia, 1994, 1999, 2001

3
PHP / Ребята, нужна помощ
« : 28 Мая 2003, 08:44:12 »
Ок спасибо.

4
PHP / Ребята, нужна помощ
« : 27 Мая 2003, 16:48:24 »
Что написать в полях: HTTP_X_FORWARDED_FOR и REMOTE_ADDR, что бы определялся IP ADDRESS?????


Спассибо.


_________________________________________________________________________________________
         $messmax=250;
   ?>
         if (getenv(\'HTTP_X_FORWARDED_FOR\'))
      {
      $ip=getenv(\'HTTP_X_FORWARDED_FOR\');
      }
      {
      $ip=getenv(\'REMOTE_ADDR\');
      }
   ?>
         $mailto="none@none.ru";
   ?>
         function display_form() {
   ?>
            Your Name:
         
   
      
         
         
      
            Your E-Mail:
         
   
      
         
         
         
   
            Your message:
         
   
      
         
         
   
         
      
      
            }
   ?>
   function process_form() {
global $im;
global $mail;
global $mess;
global $mailto;
   if (empty($im) and empty($mail) and empty($mess))
   {echo "All fields are empty.";exit;}
   if (empty($im))  
   {echo "Empty \'\'Your Name\'\' field.";exit;}
   if (empty($mail))  
   {echo "Empty \'\'Your E-mail\'\' field.";exit;}
   if(!preg_match("/^([a-z,0-9])+\\@([a-z,0-9])+(\\.([a-z,0-9])+)+$/", $mail))
   {echo "Wrong entry in \'\'Your E-mail\'\' field.";exit;}
   if (empty($mess))  
   {echo "Empty \'\'Your messege\'\' field.";exit;}
   
   $bannedemail=array("block@mail.ru","block2@mail.ru","block3@mail.ru");
   for ($i=0; $i   if ($mailto == $bannedemail[$i]){echo "Blocked mail-box.";exit;}}   
   
   $mess=trim($mess);
   $mail=trim($mail);
   $im=trim($im);
   
   $mess=substr($mess,0,$messmax);
   
   $subject="Question from $mail";
   $body="Name:\\n$im\\n\\nE-mail:\\n$mail\\n\\nMessege:\\n$mess\\n\\nIP:\\n$ip\\n\\nDesign by Me";

   $headers  = "From: $im <$mail> <$ip>\\n";  
   $suck = mail($mailto, $subject, $body, $headers);
   if ($suck)
   {echo "Thank you. Your massege has been sent.";}
   ?>
         }
   ?>
   if (empty($ok)) { display_form(); } else
{ process_form(); }
   ?>

5
PHP / пролема с IP
« : 15 Января 2003, 18:35:15 »
Как настроить этот PHP TAG, что бы он определял IP ADDRESS?
Что означает: HTTP_X_FORWARDED_FOR и REMOTE_ADDR
Спосибо.

########################################################
if (getenv(\'HTTP_X_FORWARDED_FOR\'))
{
$ip=getenv(\'HTTP_X_FORWARDED_FOR\');
}
{
$ip=getenv(\'REMOTE_ADDR\');
}
?>
########################################################

Страницы: [1]