Jump to content

msafvati

Members
  • Posts

    43
  • Joined

  • Last visited

    Never

Everything posted by msafvati

  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
  16. hi i have a problem!!! when i insert Data To DB PHP Compiler Show me a warning. please guide me for this warning Warning: odbc_do() [function.odbc-do]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement., SQL state 37000 in SQLExecDirect in E:\MAS\Prj2\Local path\MASRegCod\MASReg.php on line 119 Script is : <?php $connectionstring = odbc_connect("User", "", ""); $query ="insert into tblReguser 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']."',"; $query = $query."'".$_GET['txt14']."',)"; #echo $query; $result = odbc_do($connectionstring, $query); if ($Result == 1) echo "ÔãÇ ÈÇ ãæÝÞíÊ ÏÑ ÓíÓÊã ßÇÑíÇÈí ßÔæÑí ËÈÊ ÔÏíÏ " ; odbc_close($connectionstring); ?> line 119 : $result = odbc_do($connectionstring, $query); Thank you..
  17. thank u i cant use mysql becuse it dont connect with my php.i use only from ODBC... please guide me for ODBC
  18. thank u i changed my query and my problem is solved but a new problem exist in my project please guide me Warning: odbc_do() [function.odbc-do]: SQL error: [Microsoft][ODBC Microsoft Access Driver]Invalid use of null pointer , SQL state S1009 in SQLExecDirect in D:\MAS\Prj2\Local path\MASUdate\Update.php on line 251 line 251 is : $resultup=odbc_do($connectionstring,$Sqlupdate);
  19. thank u means dont i use () in query? i delete () from query but i have same problem!
  20. hi i have a problem when i update my data!!! please guide me <?php $connectionstring=odbc_connect("user","",""); $new_Edu=$_GET['txt1']; $new_Back=$_GET['txt2']; $new_Otherskiils=$_GET['txt3']; $new_Age=$_GET['txt4']; $new_Tell=$_GET['txt5']; $new_=$_GET['txt6']; $SqlUpdate="UPDATE tblReguser SET (Edu = "'.$new_Edu.'", Background = "'.$new_Back.'" , Otherskills = "'.$new_Otherskiils.'" , Age = "'.$new_Age.'" , Tell = "'.$new_Tell.'" where username = "'.$new_Adress.'" )"; $resultup=odbc_do($connectionstring,$Sqlupdate); echo "Record successfully updated!"; odbc_close($connectionstring); ?> error is : Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in D:\MAS\Prj2\Local path\MASUdate\Update.php on line 249 line 249 is : $sqlUpdate thank u
  21. thank i change if ($resultup==1) but so i have same problem.. line 250 is : $resultup=odbc_do($connectionstring,$Sqlupdate);
  22. hi when i use from UPDATE (sql) in my script,compiler show a warning for me please guid me to corrrect this problem thank u edu is PK $new_Edu=$_GET['txt1']; $new_Back=$_GET['txt2']; $new_Otherskiils=$_GET['txt3']; $new_Age=$_GET['txt4']; $new_Tell=$_GET['txt5']; $SqlUpdate="UPDATE tblReguser SET (Edu = '$new_Edu', Background = '$new_Back' , Otherskills = '$new_Otherskiils' , Age = '$new_Age' , Tell = '$new_Tell')"; $connectionstring=odbc_connect("user","",""); $resultup=odbc_do($connectionstring,$Sqlupdate); if ($SqlUpdate==1) echo "Record successfully updated!"; odbc_close($connectionstring); ?> and warning is : Warning: odbc_do() [function.odbc-do]: SQL error: [Microsoft][ODBC Microsoft Access Driver]Invalid use of null pointer , SQL state S1009 in SQLExecDirect in D:\MAS\Prj2\Local path\MASUdate\Update.php on line 250
  23. i am sorry i make a mistake
  24. my friend i search for free host but result of search for me is PHP&MYSQL while i need php odbc supported please help me
  25. hi i want to when i click on one of the value of list in SELECT tag , a html page open for example: <select> <option>www.yahoo.com</option> :when i click open yahoo.com <option>www.phpfreaks.com</option> </select> do should i use from events? please guid me
×
×
  • 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.