Jump to content

aeroswat

Members
  • Posts

    851
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

aeroswat's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. Thank you sir. I think I will take that advice and start using it. I had tried that .ready() before but realized I wasn't putting the function() in there so it wasn't calling what was inside of it. I have another problem with a different project now but I think I will go ahead and make a new thread for this one since its completely outside this.
  2. As to whether the username is available or not you will need to use AJAX for. It may be pretty intense for the server depending on what kind of load you have as it will have to check every time the onkeyup even is triggered. The password won't need to use AJAX but it will have to check on the onkeyup event still.
  3. Thanks for the answer. I'm still trying to get through this. I am sort of new to jQuery so I'm trying to understand how it all works. My reference to sName works as I intend it to in my other page <?php require_once('../src/auth.php'); ?> <html> <!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=iso-8859-1" /> <title>Order Lookup Form</title> <link href="../src/loginmodule.css" rel="stylesheet" type="text/css" /> <h1>Student Lookup</h1> <script type='text/javascript' src='../src/menu<?php echo ($_SESSION['SESS_AC_TYPE'] != '0' ? $_SESSION['SESS_AC_TYPE'] : ''); ?>.js'></script> <script type="text/javascript" src="../src/jquery-1.2.1.pack.js"></script> <script type="text/javascript"> function lookup(inputString) { if(inputString.length == 0) { // Hide the suggestion box. $('#students').hide(); } else { $.post("../functions/studentlookupall-exec.php", {sName: ""+inputString+"", fun: "Stu"}, function(data){ if(data.length >0) { $('#students').show(); $('#studentsList').html(data); } }); } } // lookup function fillStu(thisValue) { $('#sName').val(thisValue); setTimeout("$('#students').hide();", 200); } function fillOrders(str){ $('#suggestions').hide(); if(str.length == 0) { // Hide the suggestion box. $('#orders').show(); $('#orderList').html("Please select a student!"); } else { alert("Negro"); $.post("../functions/orderlookupentries-exec.php", {sName: ""+str+""}, function(data){ if(data.length >0) { $('#orders').show(); $('#orderList').html(data); } }); } } function fillBook(sNum,bTitle) { $.post("../functions/orderlookupbook-exec.php", {SN: ""+sNum+"", BT: ""+bTitle+""}, function(data){ if(data.length >0) { $('#orders').show(); $('#orderList').html(quoteReplace(data)); } }); } function quoteReplace(str) { var exp = /'/g; return String(str).replace(exp, "''"); } </script> </head> <body> <br /> <div> <div> Student Name: <input size="30" id="sName" onkeyup="lookup(this.value);" type="text" /> <input type="button" onclick="fillOrders(sName.value);" value="Search" /> </div> <div class="suggestionsBox" id="suggestions" style="display: none;"> <img src="../images/upArrow.png" style="position: relative; top: -12px; left: 50px" alt="upArrow" /> <div class="suggestionList" id="autoSuggestionsList"> </div> </div> <div class='suggestionsBox' id='students' style='display: none;z-index:200;position:absolute;top:110;left:80'> <img src='../images/upArrow.png' style='position: relative; top: -12px; left: 80px' alt='upArrow' /> <div class='suggestionList' id='studentsList'>" . </div> </div> </div> <br><br> <div id="orders" style="display:none;"> <div id="orderList"> </div> </div> </body> </html> Which seems to do the exact same thing. Anyhow I tried replacing it with the jQuery click handler and now firebug is not recognizing anything happening at all. <?php require_once('../src/auth.php'); require_once('../src/config.php'); ?> <!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=iso-8859-1" /> <title>Student Lookup Form</title> <link href="../src/loginmodule.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="../src/jquery-1.2.1.pack.js"></script> <h1>Student Lookup</h1> <script type='text/javascript' src='../src/menu<?php echo ($_SESSION['SESS_AC_TYPE'] != '0' ? $_SESSION['SESS_AC_TYPE'] : ''); ?>.js'></script> <script type="text/javascript"> function lookup(inputString) { if(inputString.length == 0) { // Hide the suggestion box. $('#suggestions').hide(); } else { $.post("../functions/studentlookup-exec.php", {sName: ""+inputString+""}, function(data){ if(data.length >0) { $('#suggestions').show(); $('#autoSuggestionsList').html(data); } }); } } // lookup function fill(thisValue) { $('#sName').val(thisValue); setTimeout("$('#suggestions').hide();", 200); } function fillStudents(str){ $('#suggestions').hide(); if(str.length == 0) { // Hide the suggestion box. $('#students').show(); $('#studentList').html("Please select a student!"); } else { alert("Negro"); $.post("../functions/studentlookupentries-exec.php", {sName: ""+str+""}, function(data){ if(data.length >0) { $('#students').show(); $('#studentList').html(data); } }); } } $('#searchit').click(function(){ var studentInfo = $('#sName').val(); fillStudents(studentInfo); }); </script> </head> <body> <br /> <div> <div> Student Name: <input size="30" id="sName" onkeyup="lookup(this.value);" type="text" /> <input type="button" id="searchit" value="Search" /> </div> <div class="suggestionsBox" id="suggestions" style="display: none;"> <img src="../images/upArrow.png" style="position: relative; top: -12px; left: 50px" alt="upArrow" /> <div class="suggestionList" id="autoSuggestionsList"> </div> </div> </div> <br><br> <div id="students" style="display:none;"> <div id="studentList"> </div> </div> </body> </html>
  4. Here is the code from the page. When the textbox "sName" is filled with the value "Vinny J" and I click the search button firebug is saying that sName is not defined... it clearly is. It doesn't work in FF but does work in internet exploder... any help would be appreciated. Here is the code for the page <?php require_once('../src/auth.php'); require_once('../src/config.php'); ?> <!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=iso-8859-1" /> <title>Student Lookup Form</title> <link href="../src/loginmodule.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="../src/jquery-1.2.1.pack.js"></script> <h1>Student Lookup</h1> <script type='text/javascript' src='../src/menu<?php echo ($_SESSION['SESS_AC_TYPE'] != '0' ? $_SESSION['SESS_AC_TYPE'] : ''); ?>.js'></script> <script type="text/javascript"> function lookup(inputString) { if(inputString.length == 0) { // Hide the suggestion box. $('#suggestions').hide(); } else { $.post("../functions/studentlookup-exec.php", {sName: ""+inputString+""}, function(data){ if(data.length >0) { $('#suggestions').show(); $('#autoSuggestionsList').html(data); } }); } } // lookup function fill(thisValue) { $('#sName').val(thisValue); setTimeout("$('#suggestions').hide();", 200); } function fillStudents(str){ $('#suggestions').hide(); if(str.length == 0) { // Hide the suggestion box. $('#students').show(); $('#studentList').html("Please select a student!"); } else { alert("Negro"); $.post("../functions/studentlookupentries-exec.php", {sName: ""+str+""}, function(data){ if(data.length >0) { $('#students').show(); $('#studentList').html(data); } }); } } </script> </head> <body> <br /> <div> <div> Student Name: <input size="30" id="sName" onkeyup="lookup(this.value);" type="text" /> <input type="button" onclick="fillStudents(sName.value);" value="Search" /> </div> <div class="suggestionsBox" id="suggestions" style="display: none;"> <img src="../images/upArrow.png" style="position: relative; top: -12px; left: 50px" alt="upArrow" /> <div class="suggestionList" id="autoSuggestionsList"> </div> </div> </div> <br><br> <div id="students" style="display:none;"> <div id="studentList"> </div> </div> </body> </html>
  5. To be honest I believe that storing a randomized salt in the database would provide the same security as storing a non-randomized salt in the database. That's why I would salt a non-changing variable that is stored in the database that otherwise would not be used as a salt.
  6. Looks like you are still creating the image inside of the function. You should take the image creation outside of it. Also you need to pass a reference to the original canvas object to the function instead of creating a new instance. If you don't already know how to do reference variables then google it. There's lots of information. I believe PHP uses the & symbol to pass reference variables like most other languages
  7. Yes. Just a suggestion though. I recommend that you do the image creating outside of the function. Make this be like a drawline function that takes, as an argument, a $canvas variable that already exists with your graph on it. Then the function will modify that canvas by adding the horizontal line. Then after your call to that function you will output the image.
  8. I don't believe you can store the php after the page has been executed... Php is a server side scripting so you will never see php code once the page is done loading. If you want to do it before hand I'm sure you could just save it in a string, insert it into the database. Print out the string.
  9. As in I get a server error and nothing at all displays. I know it's probably just as simple as creating a function, and calling the function somewhere in the script, I'm just not sure where. It would be helpful if you told us the type of error message you are receiving
  10. The md5'd salt can't be random because there would be no way for the system to replicate that salt purposely. You could use some sort of entry in your user's information that is unchangeable to create an md5'd salt. For instance a creation date or user id + some word. Whatever you do though do not hash the password twice because it makes it more vulnerable.
  11. Wait... You are getting a javascript is disabled message... Yet you are not using a noscript tag? I'm confused... Do you mean that you actually have javascript disabled on your browser? In that case I want to be the first to say... No shit it doesn't work lol. In the other case that you do have javascript enabled then you may get better luck posting this in the javascript forums. Or if you want help here you should say exactly what is happening and like thorpe said provide the html that the code is producing so that we can look at a clean version of what you are trying to do and better assess any problems. Have you by chance used firebug or the internet explorer javascript error feature? If so what kind of errors are you getting on there?
  12. When you say "it breaks it" what exactly do you mean? What happens?
  13. That doesn't seem like good practice to not use the AS keyword
  14. Yes sir. I decided to make a check for the http and have an example of it in the prompt box. Thanks for the help.
×
×
  • 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.