Jump to content

cauca

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Posts posted by cauca

  1. Ok now I'll left the code more strong.

     

    You came to Rio de Janeiro, is a beautiful place to visit, but have a lot of beautiful beach in other states of Brasil , for exemple BOMBINHAS - Santa Catarina, or SALVADOR - Bahia, in NORDESTE'S beach in so beautiful too !

     

    Thank's for all,

    God Bless you and your wife !

    see you in the forum

    Paulo Cauca

  2. ok !!!

    here is the code:

    index.php

    <html>
    <head>
    <script language="javascript">
    
    var xmlHttp = false;
    
    try {
    xmlHttp = new ActiveXObject("Msxm12.XMLHTTP")
    }
    catch (e){
    try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
    }
    catch (E){
    xmlHttp = false
    }
    }
    
    if (!xmlHttp && typeof XMLHttpRequest != 'undefined')
    {
    	xmlHttp = new XMLHttpRequest ()
    
    }
    
    
    function teste(){
      document.getElementById('ret_teste').innerHTML = "<div align='center'><img src='./loader.gif'></div>";
      var inp_val = frm.inp_cont.value;
      var url="teste.php?action=users&teste="+inp_val;
      xmlHttp.open("GET",url,true);
      xmlHttp.onreadystatechange=stateChanged_r;
      xmlHttp.send(null);
      function stateChanged_r(){
        if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
          document.getElementById("ret_teste").innerHTML = xmlHttp.responseText;
        }
      }
    }
    
    function inserir(){
    
    var ins_name = insert_values.ins_name.value
    var ins_file = insert_values.ins_file.value
    
    var url="insert.php"
    url=url+"?ins_name="+ins_name+"?ins_file"+ins_file
    url=url+"&sid="+Math.random()
    xmlHttp.open("GET",url,true)
    xmlHttp.onreadystatechange=stateChanged_i
    xmlHttp.send(null)
    
    function stateChanged_i() 
    { 
    document.getElementById('ret_insert').innerHTML = "<img src='./loader.gif'>";
    
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
    { 
    document.getElementById("ret_insert").innerHTML=xmlHttp.responseXML('Content-Type',"text/xml") 
    
    } 
    }
    
    }
    
    </script>
    
    </head>	
    <body>
    
    <table align="center">
    <tr>
    <td>
    <form name="insert_values" action="up.php" method="post">
    Nome:<input type="text" name="ins_name">
    Arquivo:<input type="file" name="ins_file">
    <input type="submit" value="enviar"">
    </form>
    </td>
    </tr>
    
    <tr>
    <td><div id="ret_insert"</div>
    </td>	
    </tr>
    
    <tr>
    <td colspan="2" align="center">
    	<form name="frm">
    		Procurar:<input type="text" name="inp_cont" onkeyup="teste(this)"><br>
    	</form>
    </td>
    </tr>
    
    </table>
    
    <div id="ret_teste" align="center"></div>
    
    
    </body>
    
    </html>

     

    teste.php

     

    <?php
    include_once("conectadb.php");
    if ($_GET['action']=="img"){
      $query = "SELECT user_img WHERE user_id = '{$_GET['user_id']}'";
      $result = mysql_query($query);
      $row = mysql_fetch_assoc($result);
      echo $row['user_img'];
    }
    else{
      $teste = $_GET['teste'];
      $query="select user_id from user where user_name like '%$teste%'";
      $select = mysql_query($query);
      while ($linha = mysql_fetch_assoc($select)){
        $user = $linha['user_id'];
        echo "<image src='teste.php?action=img&user_id=$user'>";
      }
    }
    ?>
    
    

     

     

    Thank's

     

    God Bless man

    Paulo

  3. sorry for the large code, sorry too because I can´t find a #button !

     

    Thank´s for the help,

     

    I try you code and the result is ok !

    I take you code and put only this "<img src='"+url+"'>";

    the result was the same result.

     

    Both return only one image at a time!

    I have in the DataBase personals name. I call the DB with LIKE %user_name%

    I want return for example every images that name start with PA.

     

    God Bless

    Paulo Cauca

     

     

     

  4. Thank´s for read the topic !

     

    //Code php

     

    include_once("conectadb.php");

     

    $teste = $_GET['teste'];

     

    $query="select * from user where user_name like '%$teste%'";

     

    $select = mysql_query($query);

    while ($linha = mysql_fetch_array($select)){

     

    $img = $linha['user_img'];

     

    echo $img;

     

    }

     

    ?>

     

    //CODE AJAX

     

    function teste(){

     

    var inp_val = frm.inp_cont.value

     

    var url="teste.php"

    url=url+"?teste="+inp_val

    url=url+"&sid="+Math.random()

    xmlHttp.open("GET",url,true)

    xmlHttp.onreadystatechange=stateChanged_r

    xmlHttp.send(null)

     

    function stateChanged_r()

    {

    document.getElementById('ret_teste').innerHTML = "<div align='center'><img src='./loader.gif'></div>";

     

    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

    {

    document.getElementById("ret_teste").innerHTML = "<img src='teste.php'>";

    }

    }

     

    // the html code

     

     

     

    <form name="frm">

    Procurar:<input type="text" name="inp_cont" onkeyup="teste(this)"><br>

    </form>

     

    THANKS

     

    GOD BLESS

    PAULOCAUCA

     

     

  5. Hello,

    Fist i want introduce myself,

    My name´s Cauca I live in Brasil;

    I`m a student (Devoloped sistem to Internet).

    I want help this forum with ask and question !

    Thi first I have ask ;-) !

     

    I´m trying loader a image with code bellow:

    -> I have a image in BLOB format in MySQL;

    -> I recover this img in a variable with php and show it with echo !

    EX: I have a select ...

    echo $img;

    If I access this page direct by localhost , the img is showed with no error,

    But what I want is: thi img be showed by the innerHTML

    I tray

    document.getElementById("ret_teste").innerHTML = "<img src='teste.php'>";

    and

    document.getElementById("ret_teste").innerHTML = xmlHttp.responseText

    off course that I have a Ajax connection with all function ok,

    I´m having a problem to mount a img in this parameters;

     

    Thank´s for help me

     

    God Bless us

    Cauca

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.