Jump to content

stribor40

Members
  • Posts

    22
  • Joined

  • Last visited

stribor40's Achievements

Member

Member (2/5)

0

Reputation

  1. I have directory "myJavaDirectory" which is inside directory where my php file is. I am trying to create object something like this SomeClass s = new someClass("......."); Then use couple functions provided by this object. SomeClass.class is inside MyJavaDirectory. Is there any way i can do this? Perhaps using exec() or any other way. Any suggestion would be appreciated.
  2. exactly but does that mean if if say if (isset($_SESSION['user_id'])){ // hide the link } else { //dont hide the link } what would be est way to do this?
  3. External script will check what user entered in popup box(username,password) and will autenticate this with external database. Once it is authenticated it will present user with my page. Now i am wondering what happens if user clicks in same link again after he has been autheticate. What happens is that once he clicks it again ( by mistake or for whatever reason) this whole thing happens again. ( pop up box,user enters username and password etc) and it goes to validate again. I would like to prevent that if user is already logged in( if it has already been authenticated?
  4. Hi I have link a href that when user clicks it will laungh pop up window where user will enter user name and password. <li><a href="#" onClick="javascript:window.open('https://someOutsideScript');">Link to my page</a> </li> This basically just validate user and when this OutsideScript gets returned I have couple variables that I can work with. The problem is that once user logs in and it gets validated and it starts filling my form (Link to my Page) if for some reason user clicks on that link again it will start this authorization process all over again. Can I somehow avoid this by using sessions so user gets validated only once. Any suggestions would be appreciated. Thanks
  5. i am using odbc extension and had lot of problems using prepared statements. Since server is IIS on windows and I never really worked with it so I wasnt even sure what extension to use that would work
  6. Are there specific steps that needs to be taken before username.email, first and last name (collected from the form) are stored into the database. I cleaned any white space at ends and also cleaned any characters that were not suppose to be in input
  7. I have this snipped of code for my database connection $res = odbc_exec($connection, $sql); if (!$res) { $arr = array('a' => 1); header('Content-type: application/json'); echo json_encode($arr); } in my java script i have ...... ... success: function(data) { if (data.a == 1){ $('#myidselector').html("<div><p>Somethign went wrong</p></div>"); } }, ..... ..... .... now i am aware that there is error function for ajax but once when php code goes to line odbc_exec($connection, $sql); it spits out the error and execution stops and never gets to java script . All I want to do is handle database error gracefully. Does anyone have suggestions how to handle this.
  8. how would you write this part isset($_GET['user'])?trim($_GET['user']):'' in a simpler beginner way
  9. What i am actually trying to do is this..... I will pass variable to my script like this. Http://mydoman.com/script.php?user=125 So now i want my script to do something with 125. I want to account for in the case user tries to put something like this in url ?user= Or ?user=hshahahah Or ?user Or ? Basically i just want to be prepared and handle any input into url that is not integer
  10. How to ensure that user input is integer Beside checking is_int(var) or intval, i also want to make sure it is not empy and not null. Only input i would like that int is between 1 and 1000. What happens if user puta just this " ". Or doesnt put anything ? Is there any way to ensure that it is only integer with php.
  11. i already completed this part,. form1.html data gets entered and processed with form1.php. Data is passed with ajax. This form has only one button to submit form. Now i have form2.html which is exaclty same as form1.html. It is processed with form2.php and it shows data entered in form1.html and the only difference is that it shows 2 buttons instead of 1. Is there anyway that I can get this done using only one html and php rather than using 2 html and 2 php files. any suggestion is much appreciated. Thanks
  12. how do i know when with ajax if there was an error. mysql_error() will spit out big string which i cant check from ajax?
  13. i have ajax call that send data to the pph script which inserts it into database. If for some reasons I have error when connecting to database ot error on insertion how do i sent some sort of error to ajax. <?php error_reporting(0); $a = $_POST['user']; $b = $_POST['name']; $c = $_POST['comment']; $link = mysql_connect('localhost', 'rot', 'joker1'); if (!$link) { $arr = array('connect' => 0); //die('Could not connect: ' . mysql_error()); } header('Content-type: application/json'); echo json_encode($arr); ?> This is the only way i was able to pass json back to ajax. Can anyone suggest better way to do this. I would like to keep die statement but in order to get it working i had to comment it off
  14. I have form that has one field. I have one field that is in modal. Both of these are part of the form. When I fill in the first field and click on submit dialog opens and i enter another value. Once I click on submit i would like to send both of these values to php using ajax but i am having troubles retrieving these values. If someone can take a look at my code it would be greatly appreciated http://jsfiddle.net/jnuY7/1/ Thanks
  15. i already wrote some code using odbc. can i still keep that and use odbc functions to clean the input
×
×
  • 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.