Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php/js] Polskie znaki w $_GET pod ie
lutador
post 9.03.2009, 09:35:14
Post #1





Grupa: Zarejestrowani
Postów: 183
Pomógł: 3
Dołączył: 5.03.2007
Skąd: Opole

Ostrzeżenie: (0%)
-----


Witam,

mam problem z przesylaniem getem polskich znakow. Pod firefox'em nie ma takiego problemu tylko pod IE.. do wyslania zmiennych uzywam ajax'a. W jaki sposob wyslac zmienna zeby ie nie robil krzakow?

index.php
  1. <?php
  2. <html>
  3. <head>
  4. <title>Edycja danych pracowników</title>
  5.    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6.      <link rel="stylesheet" href="include/style.css" type="text/css">
  7. <script type="text/javascript">
  8.  
  9. //***************// AJAX FUNCTION
  10.  
  11. function ajaxSzukaj(){
  12.    var ajaxRequest;      
  13.    try{
  14.        // Opera 8.0+, Firefox, Safari
  15.        ajaxRequest = new XMLHttpRequest();
  16.    } catch (e){
  17.        // Internet Explorer Browsers
  18.        try{
  19.            ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
  20.        } catch (e) {
  21.            try{
  22.                ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
  23.            } catch (e){
  24.                alert("Your browser broke!");
  25.                return false;
  26.            }
  27.        }
  28.    }
  29.  
  30.    ajaxRequest.onreadystatechange = function(){
  31.        if(ajaxRequest.readyState == 4){
  32.            var ajaxDisplay = document.getElementById('szukaj');
  33.            
  34.            ajaxDisplay.innerHTML = ajaxRequest.responseText;
  35.        }
  36.    }
  37.    var string = document.getElementById('string').value;
  38.    
  39.    var queryString = "?string=" + string;
  40.    ajaxRequest.open("GET", "function/form_szukaj.php" + queryString, true);
  41.    ajaxRequest.send(null);
  42. }
  43. </script>      
  44.      
  45. </head>
  46. <body>
  47.  
  48. <form
  49.    action="form_edycja.html"
  50.    name="basicform"
  51.    id="basicform"
  52.    method="post" >
  53. 1. Szukamy po nazwisku, oddziale, tel. stacjonarnym, komórkowym
  54. <fieldset>
  55.    <label for="username">Szukaj:</label>
  56.    <input
  57.        type="text"
  58.        id="string" />
  59. </fieldset>
  60. <input type='button' onclick='ajaxSzukaj()' value='Szukaj' />
  61.  
  62. </form>
  63.    <div id='szukaj'></div>
  64. </body>
  65. </html>
  66. ?>


form_szukaj.php

  1. <?php
  2. include('../include/connect.php');
  3.  
  4.        $szukaj = "SELECT * FROM Telefony WHERE nazwisko LIKE '%$_GET[string]%' OR telefons LIKE '%$_GET[string]%' OR oddzial LIKE '%$_GET[string]%' OR telefonk LIKE '%$_GET[string]%'";
  5.        
  6.        echo $szukaj;
  7. ?>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 07:22