Jump to content

sepoto

Members
  • Posts

    254
  • Joined

  • Last visited

Everything posted by sepoto

  1. This code is quite functional. I really like it. Thank you thescientist for pointing this out to me. <!DOCTYPE html><html><head><link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script><script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> <script>$(document).ready(function() {$("input#autocomplete").autocomplete({source: ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby"]});});</script> </head><body style="font-size:62.5%;"> <input id="autocomplete" /> <script>$( "input#autocomplete" ).autocomplete({ select: function(event, ui) { alert("Alert!"); }});</script></body></html>
  2. <!doctype html><html lang="en"><head> <meta charset="utf-8" /> <title>jQuery UI Autocomplete - Default functionality</title> <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.8.3.js"></script> <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css" /> <script> $(function() { var availableTags = [ "ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme" ]; $( "#tags" ).autocomplete({ source: availableTags }); }); </script></head><body> <div class="ui-widget"> <label for="tags">Tags: </label> <input id="tags" /></div> <script>$("#tags").change(function() {alert('Handler for .change() called.');});</script></body></html> It isn't working yet. This is what I have. I think if I work with it some more it could potentially be the answer nut it just isn't yet...
  3. I verified this again be writing the script again and copy pasting this much easier query. I get rows out of MySQL workbench no problem however MySQLi return nothing into $result. I am really perplexed here... <?phprequire_once('include.securelogin.php');$mysqli = new mysqli($ad_host, $ad_user, $ad_password, "mysql");if ($mysqli->connect_errno) { printf("Connect failed: %s\n", $mysqli->connect_error); exit();} $tUserName = "root";$tPassword = "**********"; $tSQL = 'select * from `mysql`.`user` where user = "' . $tUserName . '" and password = PASSWORD("' . $tPassword .'")';echo $tSQL; if ( $result = $mysqli->query($tSQL) ) {echo $result->num_rows(); $result->close();} ?>
  4. <?phprequire_once('include.securelogin.php'); $tValue = $_POST['username']; $mysqli = new mysqli($ad_host, $ad_user, $ad_password, "mysql"); if ($mysqli->connect_errno) { printf("Connect failed: %s\n", $mysqli->connect_error); exit();} $tSQL = "select * from `mysql`.`user` where user = \"" . $tValue . "\""; if ($result = $mysqli->query($tSQL) && $result->num_rows > 0) { $result->close(); echo("username#matched");}else { } ?> If I pull $tSQL out of my Netbeans debugger, remove the opening quote and closing quote and run the query I get some results from the table `mysql`.`user`. For some reason nothing is ever returned into the variable $result though. Could this be some kind of permissions problem on the back end of MySQL somewhere? I thought I had a good idea to create some database users with some permissions and query them from `mysql`.`user` with mysqli but it has really not been working out so far. Any suggestions on how to get things working? Thanks!!!
  5. Does anyone know what event is fired when a Dropdown entry is selected for an input of type Textbox? I am using the AutoComplete Widget of the jQuery UI and I am attempting to perform some functions on the style of the Textbox when a user selects one of the entries. P.S. I'm also wondering is there a way a can track which events are being triggered as I use controls on the page perhaps maybe Google Chrome Developer Tools or FireFox Develpor Tools have this functionality?
  6. I have read the documentation on php.net about installing the module php-pdo with MySQL support and it seems that it says to use the option--with-pdo-mysql however it does not show me any context on how or where to use it. I have been installing php-pdo on my server with yum -y install php-pdo however that only installs the module with SQLite support. I need to know how to install the module on CentOS 6 with support for MySQL. It seems there are drivers for this. I found know documentation that could explain this to me. Does anyone know how to do this?
  7. implicit_flush is set to off on both systems 5.2 @ HostGator and 5.4 @ localhost.
  8. I can assure you that as I view my files in Notepad++ on Windows 8 right now that there is no line break before the opening tags in any of my files however I can tell you that the version of PHP provided by my hosting provider is quite old and if I remember correctly is some release of PHP 5.2. Also I can tell you that on my development machine running PHP 5.4 xammpp configuration with display errors on in the php.ini the warning does not appear. PHP 5.4 is winning.
  9. I've read the sticky and I've made an attempt at solving the problem using output buffering however it still is coming at me with the warning: <?phpob_start();session_start(); $productname2 = $_POST['productname2']; if (isset($_POST['countone'])){ if(empty($productname2)){echo "No product name was entered. Use the back button to go back to the form and try again.";}else if($productname2 != $_SESSION['productname']){echo "The product name does not match. The counter was not incremented. Please use the back button and try again.";}else{$sepysCounter = $_SESSION['sepysCounter'];$sepysCounter++;$_SESSION['sepysCounter'] = $sepysCounter;header("Location: http://localhost/Form2.php");}} if (isset($_POST['resetbutton'])){$_SESSION['sepysCounter'] = 0;header("Location: http://localhost/Form2.php");} ob_end_flush();?>
  10. <?phpsession_start(); $productname = trim($_GET['productname']);$productquantity = trim($_GET['productquantity']); if( (!empty($productname) && !empty($productquantity)) && (is_numeric($productquantity)) ) { $_SESSION['productname'] = $productname;$_SESSION['productquantity'] = $productquantity;$_SESSION['sepysCounter'] = 0;header("Location: http://localhost/Form2.php");}else if(empty($productname) || empty($productquantity)){ echo "A value must be entered for both the Product Name and the Quantity text boxes. Please use the back button to go back to the form"; }else if(!is_numeric($productquantity)){echo "The quantity field must be a numeric value";} ?> It's funny I have tried every way I can think of to get rid of the warning but it won't go away unless I completely turn off the display errors property in the configuration. Although the application works perfectly from what I can see. I think it may be this line causing the problem? header("Location: http://bcthub.com/Form2.php"); I see no other way though of writing the code. Could I get some commentary on this? Thank You! Form1.zip
  11. sepoto

    htmlentities

    I am currently reading the title "Essential PHP Security". I see one of the topics is concerning the use of "htmlentities()". I have looked up the functions man page on php.net and I do understand what it is doing however I don't yet fully understand how the use of "htmlentities()" is supposed to make my application more secure. Could someone explain this a bit? Thanks!
  12. sepoto

    Ob_Start();

    That was a great explanation. Thank you for your reply.
  13. sepoto

    Ob_Start();

    I had some code and recently I moved over to a new server which happens to be running Debian 5.0 Lenny. I had some code involving page redirection that stopped working and I had to add ob_start(); to the top of the .php files in question to get them working again. I read some documentation for ob_start(); but I have to admit it did not make sense to me at all. Why am I unable to send my headers unless ob_start(); has been invoked first? Is there a stack someplace being created? If so is it a stack only for header information? What exactly is ob_start(); doing? Thank you!
×
×
  • Create New...