Jump to content

msafvati

Members
  • Posts

    43
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

msafvati's Achievements

Member

Member (2/5)

0

Reputation

  1. thank u, i do your tells but dont give any answer from Server,responseText from Server is true(Example if my Data Exist in Db Return 1)but if block have problem, plz guid me!!!
  2. hi my friends i want to use Ajax in php,but when i use from it i encounter with a problem. that is:"i send a request to server but it dont give me Response" please see this code and guide me, thank you <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="text/javascript"> function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { //Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } function checkUser() { xmlHttp=GetXmlHttpObject(); if (xmlHttp==null) { alert ("Browser does not support HTTP Request"); return; } url='http://127.0.0.1/mas/index.php?user='+document.getElementById('user').value; //alert(url); xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { if (xmlHttp.responseText==1) { document.getElementById("user").style.border="1px solid #FF0000"; } else{ document.getElementById("user").style.border="1px solid #00CC00"; } } } </script> </head> <body> <form action="http://127.0.0.1/mas/index.php" method="get"> <table width="300" border="0"> <tr> <td><label for="name">name </label></td> <td><input type="text" id="name" /></td> <td> </td> </tr> <tr> <td><label for="user">user </label></td> <td><input type="text" id="user" /></td> <td style="text-align:left"><input type="button" value="check" onclick="checkUser()"/></td> </tr> <tr> <td><label for="pass">password</label></td> <td><input type="password" id="pass" /></td> <td> </td> </tr> <tr> <td></td> <td colspan="2"><input type="submit" id="send" /></td> </tr> </table> </form> </body> </html> and PHP: <?php $con=mysql_connect('127.0.0.1','root','root'); if($con){ echo "Connection Successfuly \n"; } $db=mysql_select_db('Ajax',$con); $sql="SELECT * FROM `users` WHERE `user` ='".$_GET['user']."'"; $r=mysql_query($sql); $result=mysql_num_rows($r); echo( $result); ?>
  3. Hi my friend please Look this Script: i write it for Moving between Record.I want when Click on Next button, it show me only CONTENT of the First Record and the next Show me Second Record and 3 and ... but when i Click on Next botton it show me all of Records in DB. Please tell me do thease Script are Correct? Please Help me thank u <form action="http://127.0.0.1:8080/odbc_fetch_row.php" method="POST"> <input type="submit" value="next" name="next"><br><br> <?php $connection= odbc_connect("test", "", ""); $query = "SELECT username FROM tbltest"; $Res = odbc_do($connection, $query); if (isset($_POST['next'])){ $i=0; while (odbc_fetch_row($Res)){ $i = odbc_result($Res,'username'); echo "$i </br>"; } } $i++; odbc_close($connection); ?> and <form action="http://127.0.0.1:8080/TT.php" method="POST"> <input type="submit" value="next" name="next"><br><br> <?php $connection= odbc_connect("test", "", ""); $query = "SELECT username FROM tbltest"; $Res = odbc_do($connection, $query); if (isset($_POST['next'])){ $i=0; while(odbc_fetch_row($Res)){ $r=odbc_result($Res,$i); echo $r; } $i++; } odbc_close($connection);
  4. thank u my friend but i want to know that loop is correct for ODBC?
  5. Hi my friends How can I move between Records in Database such as move to next record or last record similar to (movenext). I use from Odbc function Please help me
  6. My problem is solved . I write this script and test it and it answer to me. Thanks my friend <?php $conn=odbc_connect("test","",""); $name=$_GET['txt']; $username=$_GET['un']; if (isset($_GET['txt'])){ $qu="select * from tblTest where username like '".$_GET['un']."'"; $res=odbc_do($conn,$qu); $a=odbc_result($res,'username'); if ($a == $_GET['un']){ echo "Duplicate Data"; } else { $query="insert into tblTest(name,username)"."values ('$name','$username')"; $res=odbc_do($conn,$query); if (odbc_num_rows($res) >= 1){ echo "user has benn registered"; } } odbc_close($conn); } ?>
  7. thanks but do imposible for u to more guide me? do that suorce is correct?
  8. Hi my friends I have a question! How can I prevent from REPETITIVE ENTRANCEs such as username that we want to don’t repititive in my database Please help me $a=odbc_result($res,'username'); if ($a==$_POST['t9']){ echo "Repititve!!!! in DB"; }
  9. i cant use from MYSQL because when i install mysql,it show me an error about Client if you help me about it,i install it on my Pc..Ok?Thank u
  10. hi I want to insert the address of picture in my DB (as for this script). but when is insert them , my DB (ms-access) dont show me anything about Adreess or size or type or...(empty Record) Please help me or if you know the better way for this operation tell me Thank u <?php if (isset ($_GET['upload'] )) { $name = $_FILES['picture']['name']; $tmp_name= $_FILES['picture']['tmp_name']; $type = $_FILES['picture']['type']; $size= $_FILES['picture']['size']; list($width,$height,$typeb,$attr)= getimagesize($tmp_name); if ($width>600 || $height>500) { echo $name."dimensions exceed the 600*500 Pixel Limited."; die(); } # if (!( # $type=='image/jpeg' || # $type=='image/png' || # $type=='image/gif' # )) # { # echo $type."is not an acceptable Format."; # } if ($size>'350000') { echo $name."is over 350KB. please make it smaller"; die(); } } if (! get_magic_quotes_gpc()){ $name= addslashes($name); $extract = fopen($tmp_name,'r'); $content = fread ($extract,$size); $content = addslashes($content); fclose ($extract); } $con=odbc_connect("Test","",""); $addfile = " insert into tblTest (name,size,type,content) ". " values ('$name','$size','$type','$content')"; $result = odbc_do ($con,$addfile); odbc_close($con); ?>
  11. Hi I have a problem in zend? How can I achieve the address action (url) for output in : <form action = method ="get"> When click on RUN AS WEB PAGE in zend url show me The page cannot Display.. Please help me.
  12. thnak you for help but i have this problem yet!!!
  13. thank u number of Columns that i want to insert are : 13
  14. thank u as for your tells please show me one example from my script!
  15. hi i have a warning when i want to insert data to my DB:please guide me!! script is : <?php if (!strlen(trim($_GET['txt12']))) { echo "áØÝÇ äÇã ˜ÇÑÈÑí ÎæÏ ÑÇ æÇÑÏ äãÇííÏ"; die(); } $connectionstring = odbc_connect("User", "", ""); $query ="insert into tblRegCo values("; $query = $query."'".$_GET['txt1']."',"; $query = $query."'".$_GET['txt2']."',"; $query = $query."'".$_GET['txt3']."',"; $query = $query."'".$_GET['txt4']."',"; $query = $query."'".$_GET['txt5']."',"; $query = $query."'".$_GET['txt6']."',"; $query = $query."'".$_GET['txt7']."',"; $query = $query."'".$_GET['txt8']."',"; $query = $query."'".$_GET['txt9']."',"; $query = $query."'".$_GET['txt10']."',"; $query = $query."'".$_GET['txt11']."',"; $query = $query."'".$_GET['txt12']."',"; $query = $query."'".$_GET['txt13']."')"; $result = odbc_do($connectionstring,$query); echo "ÔãÇ ÈÇ ãæÝÞíÊ ÏÑ ÓíÓÊã ßÇÑíÇÈí ßÔæÑí ËÈÊ ÔÏíÏ " ; odbc_close($connectionstring); ?> warning is : Warning: odbc_do() [function.odbc-do]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression., SQL state 22005 in SQLExecDirect in D:\MAS\Prj2\Local path\MASRegCodCo\RegCo.php on line 262 thank u
×
×
  • 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.