Jump to content

Piba

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Everything posted by Piba

  1. Hello guys, In the past, i used the Sphider search engine on the Apache server, and it was working fine until I changed the server to an IIS server and it is not working well rightnow. It is not indexing the dynamic pages. The keywords used to be 17,000 and now they are only 5,000. One more problem, if I searched for a word that doesn't exist in the keywords, the sphider says did you mean "the word i enterd". Example: if I searched for "car" and car doesn't exist in the keywords, the Spider says: did you mean "car"? I'm using now Sphider-plus version, here is the link for the https://sourceforge.net/project/show...roup_id=214642 Any idea about my problem??? Thanks, Piba
  2. Hi gizmola, My problem is solved All my problem was from the version of the client, it doesn't support the arabic language I installed an Express edition and it's fine now Thanks alot for your always support and help Regards, Piba
  3. Hello guys, I'm using oracle instant client version 11.1.0.6.0 And i want to retreive data that is arabic, but the problem is it displayed all in question marks (????????????? ??????? ?????) I set the NLS_LANG variable to ARABIC_SAUDI ARABIA.AR8MSWIN1256 but the porblem is still be.. I tried also to set NLS_LANG variable to AMERICAN_AMERICA.AR8MSWIN1256 but also the problem is sitll there ??? any advise??????
  4. Hi gizmola, Thanks for replying, i read the site you suggested, it's really helpful.. But my problem now as the following: When i write in the "run": C:\Program Files\instantclient11 sqlplus username/password@db It response and oracle information was showup.. BUT...when i try to access database through php code, the same error is appeared So, is the problem from my code, or something inside the tnsname.ora? or the problem from the other server (which have oracle database)?? And BTW, i tried all three ways in the website with no respone Thanks, Piba
  5. Hello guys, Ok, i'm working on php/mysql but now i want to deal with oracle (on other server), So i installed instantclient-sqlplus-win32 for oracle, and when i open phpinfo page, the oci8 is enabled But my problem is when i connect to db, this error is show up ORA-12154: TNS:could not resolve the connect identifier specified My coonect code: <?php // try connecting to the database $conn = oci_connect('username', 'password', 'host'); // check for any errors if (!$conn) { $e = oci_error(); print htmlentities($e['message']); exit; } // else there weren't any errors else { echo 'I am an Oracle mack daddy.'; } ?> I checked from the file tnsname.ora But when i searched on google to find solution, i read that it should be a file named sqlnet.ora And i don't have this file... Is this my problem?? Shall i got both sqlnet.ora and tnsname.ora files?? Please i need help as soon as possible Thanks
  6. Aha I'm a little bit embarressed Thanks alot haku I really appreaciate your help Have a nice day Best Regards, Piba
  7. Ok..Could you please explain to me why this is a wrong?? I store id (auto-increment) and then take the id and store it in the session.. So, where is mistake?? Thanks alot
  8. IS THERE ANY CHANCE THAT THE SESSION DOESN'T STORE THE VALUE CORRECTLY??
  9. hello benphp... Ok..Could you figure out what is the error in my code???
  10. Hello......... Would anybody help please!!! :
  11. No, they were'nt two users on the same computer Maybe it's not overlapping, but i really dont know why user2 got error msg while he just start the form Ok.. I will place here the code, and explain it: First when the user open page1,fill and press button(Go to next stage) i will save in table4 an empty record: $table4= "INSERT INTO table4 VALUES('0','0000-00-00','0', '0')"; @mysql_query($fourth) or die(mysql_error()); $id=mysql_insert_id(); $_SESSION[id']=$id; session_write_close(); the first field of table4 is auto-increment id and then i will save the first page value: $table1= "INSERT INTO table1 VALUES('0', curdate(), '$_SESSION[id]', '$_POST[q1]','$_POST[q2]','$_POST[q3]')"; @mysql_query($table1) or die(mysql_error()); header("location:page2.php"); Ok..the page2 first check if user filled this page before or not: if(!(isset($_SESSION[id']))) header("location:errormsg1.php"); // the user is trying to access page2 before answer page1 $get_id=mysql_query("select user_id from table2 where user_id ='$_SESSION[id]'"); if(mysql_num_rows($get_id_res)!=0) header("location:errormsg2.php"); //if the user filled this page before else { body of page2 } Then when he press button(Go to next stage) i will save in table2: $table2= "INSERT INTO table2 VALUES('0', curdate(), '$_SESSION[id]', '$_POST[q1]','$_POST[q2]','$_POST[q3]')"; @mysql_query($table2) or die(mysql_error()); header("location:page3.php"); The same for page3 and page4, except that in page4 will be updated: $table4= "UPDATE table4 SET date=curdate(), name='$_POST[name]', age='$_POST[age]' WHERE id=$_SESSION[user_id]"; @mysql_query($table4) or die(mysql_error()); header("location:index.php"); I see that the record in table4 with id=1 is replaced with record of id=2 And sometimes as i said before, when user2 going from page1 to page2, errormsg2 tells him that he filled before!!!! Is there any problem with my query?? I'm really got confiused ??? ??? Thanks alot GingerRobot for helping
  12. Hello GingerRobot, Thanks for replying:) But i don't want to transfer the id through url, that will be visible to users I want through $_POST For session: Actually i used before in this form session method, but i got alot of problem, Not in programming but in saving data I will explain to you my old way using session, so if you can help, this would be better i have a multi-page form, lets say from 4 pages... in the first page, insert empty values in table1 to get automatic id for user: mysql_query("INSERT INTO table1 VALUES('0','0000-00-00','0')"); $id=mysql_insert_id(); $_SESSION['id']=$id; session_write_close(); After that, i save user's answers in table1,2,3,4 WHERE id=$_SESSION[id] And ofcourse update table1 WHERE id=$_SESSION[id] Also, each page there will be check if user fill the page before or not My problem is when two users at the same time start filling the form, the session is changed and user1 got an error message that he already filled this page (according to user2 session not his) I dont know excatly what is the problem??? Can you figure out?? Thanks
  13. Hello quys, I have a question please, I have a multi-page form, and i post values from one page to another just like this: <input type=hidden name=q1 value=$_POST[q1]> .... Ofcourse, this will be by making the action=page1.php in form tag, first page Here is the problem: in page2, there is radio button(yse-no) ,if the user choose yse, then he will goes to page3 While if he choose no, the page will direct him to page4 I wrote something like this: <form action="page3.php" method="post"> <table> ..... <input name=q1 type=radio value=0>Yes <input name=q1 type=radio value=1>No <input name=id type=hidden value=$id> ..... </table> </form> In page3: if($_POST[q1]==1) header("location:page4.php"); else { .... body of page3 } So, if i'm in page3, i can see the hidden input But how if i'm in page4?? with header the hidden will be lost!!! So how could i make something like this??? Thanks Regards, Piba
  14. Hi Myth Thnaks for your replay.. i'm afraid that i dont understand exactly how to make this ??? Becasue i have already onchange in the select Here is the code of select1: <html> <head> <script src="selectuser.js"></script> </head> <body><form> Select a User: <select name="dropdown1" onchange="showUser(this.value)"> <option value="1" <? if(isset($_POST['dropdown1'])) if($_POST['dropdown1']==1) echo $_POST['dropdown1']; ?>>Peter Griffin</option> <option value="2" <? if(isset($_POST['dropdown1'])) if($_POST['dropdown1']==2) echo $_POST['dropdown1']; ?>>Lois Griffin</option> <option value="3" <? if(isset($_POST['dropdown1'])) if($_POST['dropdown1']==3) echo $_POST['dropdown1']; ?>>Glenn Quagmire</option> <option value="4" <? if(isset($_POST['dropdown1'])) if($_POST['dropdown1']==4) echo $_POST['dropdown1']; ?>>Joseph Swanson</option> </select> </form><p> <div id="txtHint"><b>User info will be listed here.</b></div> </p></body> </html> Then the js page: var xmlHttpfunction showUser(str) { xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="getuser.php" url=url+"?q="+str url=url+"&sid="+Math.random() xmlHttp.onreadystatechange=stateChanged xmlHttp.open("GET",url,true) xmlHttp.send(null) }function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("txtHint").innerHTML=xmlHttp.responseText } }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; } and finally the select2: <?php $q=$_GET["q"]; $con = mysql_connect('localhost', 'peter', 'abc123'); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("ajax_demo", $con); $sql="SELECT * FROM user WHERE id = '".$q."'"; $result = mysql_query($sql); <select name=dropdown2> while($row = mysql_fetch_array($result)) { echo "<option name=info value='$row['FirstName']'>"; } echo "</table>"; mysql_close($con); ?> So, how could i save the second value in dropdown2 when the page relode?? I don't think onchange in dropdown2 will work!???!??! Could help plz
  15. Thanks alot nogray It works with me --------------- And i'm still waiting answers for my second question
  16. Hello everyone...... I have 2 questions ;D My first one: How could i use noscript tag to show The user who doesn't enabled the javascript different page than if he enabled js?? Just like yahoo mail, if you disabled js and try on open your mail, a pge that tells you to enable js or using an old version of yahoo mail!!!!!! I like this and wonder how to make something like this??? My second question is how to save value in the dropdown menu using js?? So if the user relode the page, his choise will be saved?? Hope you can help me Best Regards, Piba
  17. Hello mort, First of all, sorry for late but i got busy.... Could you explzin more how i write in onchange?? Thanks alot
  18. Hi guys, I have a drop down menu, the user must choose form this dropdown and when he choose, another dropdown menu will show up according to what he choose So, the second drop down is called in other page... My problem is the value in the second dropdown menu won't be saved if the page is refreshed!! I know how to save the value of the first one: <select name=dropdown1> <option name=option1 value=1 <? if ($_POST['dropdown1']=="1") echo selected=selected; ?> >option1</option> </select> But how could i save the value of the second dropdown menu ??? Hope i'm explaining my problem well thanks alot, Piba
  19. mmmmmmmmm... I don't want them to go back to prevoiuse pages and modify them.. When the user try to do so, i check if he filled this page before, if so, an error message will appear.. The problem is when two users at the same time open the form, the sessions not work as well I think there is a conflict , i don't know why!!!!!!!!! maybe coz i'm using $_SESSION['id']=$id; session_write_close(); Is there any way other than what i did for storing the session?? Thanks
  20. Hello guys... I have a multipage form, let say the form consists of 4 pages In every page there are some questions and it should be saved before the user going to the next page There are also 4 tables of database, each page's data will be saved in one table.. So, when i saved the first page's data, i took the id and store it it session: $_SESSION['id']=$id; and in each page i took this session and insert the data according to that id...... My problem is: some times when the user close the form before ending it, the session will be store, and any user want to start the form, an error message tell him that you have already fill page 1 How can i handle this problem?? I wrote on the last page: unset_session but didn't solve my problem I think about forgetting this method and start by sending data by post (hidden input) But i faced alot of problem too :'( So...any suggestion?? Waiting your help Regards, Piba
  21. Dear Shocker-z First i would thank you for your replay, But your code is just like the one i put it and didn't work ------ Dear haku What do you mean by post it html??? ----- Dear deanstach Thanks alot for your replay and help, it didn't work either... But it work with this: if(!(isset($_POST[checkbox1]))) echo "error"; :D:D:D Regards, Piba
  22. Hi all, Hope you all doing well... I have some issue with my form; I have a check box that is required, but i don't know how to do validation to the checkbox ??? I tried if(isset($_POST['checkbox1'])) but it didn't work T tried also $c1=$_POST['checkbox1']; if($c1 !="") echo "Error"; Can anyone help me please Thanks alot, Piba
  23. Hi redbullmarky, yes i'm using $_POST & $_GET And i'm already using mysql_real_escape_string Thanks alot bro for all advises you gave them to me :) ----- Absolutely. But many of the solutions we are asked to provide are 'useless'. Breaking people's erroneous perceptions becomes tedious and argumentative. People believe what they believe at any given time, and only over time will they accept a new idea to replace a misunderstood one. So if it makes a new programmer feel more secure to unset unused submitted variables, I'll tell them how... hehe I've run into scripts where the author grabs the submitted variables he is expecting, then unsets the rest of them. Why? Who knows... it's just a perception that doing SOMETHING is better than nothing, even if that thinking is flawed. This is rampant with security issues, because it's so hard for a programmer to feel his code is secure. It quickly boils down to hauling out the ol' shotgun, and pray for the best... Regards, PhREEEk Hi PHP_PhREEEk, unset $_POST & unset $_GET will help :) Thanks for replying ------ Hi MadTechie.. Thanks for replying, but can you give me an example for that?? Quick example, <?php session_start(); $key = rand(1000,99999); $_SESSION['access'] = $key; echo "<a href=\"page2.php?access=$key\">link</a>"; ?> <?php session_start(); if($_GET['access'] != $_SESSION['access']) { echo "No Access"; exit; } session_destroy(); ?> welcome if you goto direct to page2.php it will say no access, if you click the link on page1.php it will goto page2.php and say welcome .. but if you refresh page2.php it will fail again. you can change this depends on the need of course with a login system your check the access right but for a page with a link, EDIT: as for injection read redbullmarky's post.. Hi MadTechie, Thanks alot bro for quick replying, and explaination That's will help me :) see ya
  24. Hi...Actually i want to prevent the sql injection in the url.. So, i think if there is a way to prevent the user from typing or editing the url!!!!!!!!!! Any way thanks ----- Hi MadTechie.. Thanks for replying, but can you give me an example for that?? ----- Hi, I'll try this way Thanks bro
  25. Hello everyone, I have a question...If i have a site,for example www.mysite.com/index.php How can i prevent users from editing or typing in the url (for security)?? So, if the user wish to enter www.mysite.com/index.php?....... the browser will not accept any other word more than www.mysite.com/index.php Does anyone know?? Please i need it :'( :'( Thanks Piba
×
×
  • 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.