Jump to content

jimfog

Members
  • Posts

    1,803
  • Joined

  • Last visited

Posts posted by jimfog

  1. I'm not sure what you mean by "grabbed."
    Maybe I should have said "passed" to the GET variable.Here is the docomplete function that handles the ajax call:
    function doCompletion() {	    var url = "autocomplete.php?action=complete&id=" + escape(completeField.value);	    req = initRequest();	    req.open("GET", url, true);	    req.onreadystatechange = callback;	    req.send(null);}

    This is what I have come to understand so far:The letters entered in the input box by the user get passed to the function,and specifically to the url...and afterwards can the be accessed by a GET array. I am I saying it correctly?Here is the tutorial so you can have the whole picture....https://netbeans.org/kb/docs/php/ajax-quickstart.html#overview

  2. I know that get is a superglobal array and that is seen anywhere in the script. I know also(and tell me if I am wrong) that it is related with links...I mean you a pass a value to GET with a link. Recently though, I came across with a scenario where the input of a user in an input box was grabbed by a GET['action'] variable. Here is the HTML-it is a tutorial on AJAX:

    <form name="autofillform" action="autocomplete.php">		    <table border="1" cellpadding="5">			    <thead>				    <tr>										    <th><strong>Composer Name:</strong></th>					    <th><input type="text"  size="40" id="complete-field"  onkeyup="doCompletion();"></th>				    </tr>			    </thead>			    <tbody>                   			    </tbody>		    </table>	    </form>

    IN general do user inputs in an input box(search...as in this example here) get "grabbed" from GET['action']?

  3. I was referring to this:
    If Javascript is disabled then that code never runs and the form submits normally.

    Depending on your application, you may want to plan for this case.

    probably I will not give the option of a fallback to js---it will work only with js
  4. You will probably need to send data to the server script so it knows whether to respond with a complete document or with data formatted for AJAX. Testing for the value of a hidden form field is usually enough.
    Ι did not quite understood that.From the moment you send something with AJAX I think it is natural to expect the response in AJAX. Clarify more if you want... Αnd most importantly does form data go with json to the server-this is something I really do not know...
  5. You would prevent the form from submitting normally and submit it via ajax. If Javascript is disabled then that code never runs and the form submits normally.
    This is what I had in my mind when I was asking the question.So...in ajax forms we always use prevent.default-for the reasons you mention.
  6. I want to a search feature in my site that uses ajax and displays search results as the user types terms(like google instant search). SO far I have concluded that jquery autocomplete will do the trick. Do you think there is something better than the above out there?

  7. I am about to ajaxify a form and my question is where in the context of a form prevent.default is used exaxtly. I know what(in general) prevent.default does but where exactly does it help with form submission.

  8. I am not so experienced in js and as such I have this question;Here is some code:

    $(function() {    $('.error').hide();    $(".button").click(function() {		 $('.error').hide(); 	 	    var name = $("input#name").val(); 	    if (name == "") { 	  $("label#name_error").show(); 	  $("input#name").focus(); 	  return false;     }            	  // validate and process form here    });  });

    Why the if statement above has a "return false" statement in it.Is there a difference in the false statement between PHP and JS.

  9. In a series of td elements(enclosed in a tr element) I have set a class were the css is set to display:none.So, when the user comes to the page for the 1st time he does not see the html mentioned above....this:

    <tr class="selections">					  <td> <label class="label" for="buztype">...ς</label><br></td>					  <td><input type="radio" name="buztype" value="1" checked> ...<br></td>					  <td> <input type="radio" name="buztype" value="3"> ... <br></td>					  <td> <input type="radio" name="buztype" value="4">...<br></td>					  <td><input type="radio" name="buztype" value="5">... <br></td>					  <td><input type="radio" name="buztype" value="2">...<br></td>					   </tr>.selections{ display: none; }

    If the user clicks an icon(edit) in the form the above class is removed and the above html is displayed:

    $('.edit').click(function() {                 				 $('.selections').removeClass('selections');				 });

    The problem is what to do when the user clicks the cancel button the above html must be hidden again...How can I do that? The html does not have a class anymore so as to grab it with jquery and hide it again.How am I going to target the above tr element now that it's class is removed.

  10. I Intend using a group of columns as a foreign key.I have a parent table named credentials(crID column is the primary key). CrID will go in a child table, in to 2 columns(as a foreign key). As far as I understand there seems not to have a problem with such a scheme. It has to do with a booking application. The columns that contain the crID are called bookedFrom and bookedFor...to get an understanding of the logic. What I do not understand is this phrase in the MySQl manual regarding multiple columns foreign keys: However, in the referenced table, there must be an index where the referenced columns are listed as the first columns in the same order. It is found here-just use the browser "find" function to find it:http://dev.mysql.com/doc/refman/5.7/en/create-table-foreign-keys.html

  11. I am using PHPMyAdmin(along with workbench) as an admin tool for the database. In PHPMyAdmin I use the export feature to backup the database...nonetheless in the MySql manual other methods are mentioned too. Using mysqldump for example. What do you propose as a backup method? Is PHPMyAdmin's method OK? I just want to backup the db because I want to upgrade to 5.7

  12. Why can't you answer that? Have you given permission for everything the user needs to do, or is there something they need to do that you haven't given permission for?
    You are right for the questions above? I was just asking due to lack of experience.
  13. I have set up a user in my database(using PhpMyAdmin) with certain privileges(SELECT,INSERT,UPDATE,DELETE)-and he is going to be the web user, the one the php scripts will use to access the database. Do you think that the privileges I have set are OK,,,or is there something also that needs to be done.

    mails

    You have to use PHP, you can't do all of that with Javascript.
    Ι suppose I will use PHP to store the mails with the relevant details in the database and ajax to make the calls. Am I correct?Just want to hear what you think?

    mails

    Ι am talking about such as the messages you can send through facebook.You send, you receive and you see also a list with the messages sent,archiving them.maybe some more features...But NOT something complicated as outlook for example. I do not think it requires much coding...Mostly what puzzles me is how am I going to organize the tables in the database(I will make a separate topic about that in the MySQL forum).

    mails

    I am in the stage where I want to build a mailer for a web app.It will be very simple(for now), the user will be able to see its mails, answer etc... Nonetheless I have no idea from where to start. Of course I know to use the PHP mail function...but from there I am little in the dark. So, is there something I must take extra care when building a mailer.Of course I know the mail function... Is it a lot of code to build a simple mailer?

  14. when the user tries to login...do you check that there is his username/password in the db solely based on the supplied(with the form) username? I mean something like this:

    select * from credentials		   where email='tahtah@tahtah.com';

    I am saying that because when the password is hashed in the dbhow can we cross check it with the one supplied by the user during the form. After the above, I compare the hashed password in the db with the user supplied password(after it has been hashed also) WHat do you do usually?

  15. I have a created a class where in it you will find password hashing/checking functions...for example:

    public static function hash($password) {	  return crypt($password,self::$algo.self::$cost .'$'.self::unique_salt());}

    And this is the code where you apply the function to a password submitted by the user with a form:

      $pass_hashed = PassHash::hash($_POST['password']);

    My question is why the code below is wrong-according to Netbeans IDE?

      $pass_hashed = PassHash->hash($_POST['password']); 

    Since I am accessing the has function OUTSIDE the class why it is wrong. PassHash is the name of the class.

×
×
  • Create New...