POST & GET не передают кириллицу

evolution

Новичок
POST & GET не передают кириллицу

Если в форму вбивать латиницу и цифры, то всё нормально работает.
Но стоит вбить кириллицу, и сразу в массиве POST эта переменная начинает косячить
Если в input`e вбито "33а", то массив array(1) { ["search_query"]=> string(2) "33" }

В чём косяк?
 

Гравицапа

elbirret elcno
evolution
PHP:
<?php
echo '<pre>';
print_r($_POST);
echo '</pre>';
?>
<html>
	<body>
		<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
			<input type="text" name="foo">
			<input type="submit">
		</form>
	</body>
</html>
 

Фанат

oncle terrible
Команда форума
я думаю, дело не в методике тестирования.
скорее, веб-сервер какой ретивый. мод секурити, русский апач с перекодировкой...

или с енктайпом перемудрил.
или препенд какой стоит левый
 

evolution

Новичок
Твой работает....

мой нет

<?php

if(isset($search_query)):


echo $_POST['search_query'];


endif;
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
</head>
<body>
<form method="post" action="">
<input type="text" name="search_query" value=" Поиск постеров" class="inputstyle">
<input type="image" src="images/index_06.jpg" alt="Поиск" name="search_done" value="search" style="width: 99%; height: 99%">
</form>
</body>
</html>
 

Фанат

oncle terrible
Команда форума
evolution
у тебя условие-то хоть выполняется, гений?
 

evolution

Новичок
Фанат
Да. =)

Вообщем если убрать
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">

то всё работает...
странно...

Более корректная версия кода
PHP:
<?php

    if(isset($_POST['search_query'])): 
    
    
    echo $_POST['search_query'];
    
    
    endif;  
?> 
<html> 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
</head>
    <body> 
        <form method="post" action="">
            <input type="text" name="search_query" value=" Поиск постеров" class="inputstyle">
            <input type="image" src="imag.jpg" alt="Поиск" name="search_done" value="search" style="width: 99%; height: 99%">
        </form> 
    </body> 
</html>
-~{}~ 18.04.07 14:22:

Как бы сделать чтобы и с кодировкой windows-1251 работало? =)
 

evolution

Новичок
Серверная часть
Apache/1.3.33 (Win32) PHP/5.1.6

Броузеры:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.11) Gecko/20070312 Firefox/1.5.0.11
и
IE 7.0.5700.6


Явно проблемы в серверной части... т.к. выложил на боевой сервер и всё работает ок.

На что лучше обратить внимание?
 

evolution

Новичок
Вообщем сидел вспоминал чего я последнее время меня в настройках на сервере...

Закаментил этот кусок

[mbstring]
; language for internal character representation.
; mbstring.language = Russian

; internal/script encoding.
; Some encoding cannot work as internal encoding.
; (e.g. SJIS, BIG5, ISO-2022-*)
; mbstring.internal_encoding = UTF-8

; http input encoding.
; mbstring.http_input = UTF-8,KOI8-R,CP1251

; http output encoding. mb_output_handler must be
; registered as output buffer to function
;mbstring.http_output = UTF-8

; enable automatic encoding translation accoding to
; mbstring.internal_encoding setting. Input chars are
; converted to internal encoding by setting this to On.
; Note: Do _not_ use automatic encoding translation for
; portable libs/applications.
;mbstring.encoding_translation = On

; automatic encoding detection order.
; auto means
;mbstring.detect_order = auto

; substitute_character used when character cannot be converted
; one from another
;mbstring.substitute_character = none;

; overload(replace) single byte functions by mbstring functions.
; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),
; etc. Possible values are 0,1,2,4 or combination of them.
; For example, 7 for overload everything.
; 0: No overload
; 1: Overload mail() function
; 2: Overload str*() functions
; 4: Overload ereg*() functions
;mbstring.func_overload = 0

и всё заработало.

Что в том куске косячного такого?
 
Сверху