cauca
-
Posts
11 -
Joined
-
Last visited
Never
Posts posted by cauca
-
-
yessss I fund where are wrong :
The select was missing this
$query = "SELECT user_img [b]from user[/b] WHERE user_id = '{$_GET['user_id']}'";
yess
Thank's man for all
I'm lunch now srsrs
God Bless
Paulo Cauca
-
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
-
ok ! I changed de code ...
But now don't show de image ...
Thank's
God Bless
Paulo
-
Hello, good morning ...
I put the code online in de web visit please:
www.barahinformatica.com.br/testimgfile/
Try type in "Procurar:" the names above:
Paulo Roberto
Patricia Renata
Patrick Teste
Cristina Oliveira
Margarida Flor
If you starting type letter "P" the function need return Paulo's image, Patricia's image and Patrick's image.
Than´k
God Bless
PauloCauca
Corin Falador
-
Ok thank´s F1Fan!
I tried it but didn´t have success !!!
when I call the function the php don´t return the image !
God Bless
Paulo Cauca
-
The table :
user_id int(11) Não auto complet
user_name varchar(30) Não
user_img longblob Não
Is this?
God Bless
Paulo Cauca
-
I found the # button
in the next code I´ll put it
Paulo Cauca
-
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
-
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
-
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
[SOLVED] I can´t load image !
in Javascript Help
Posted
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