Jump to content

sepoto

Members
  • Content Count

    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", "coldfusi
  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",
  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 .'")';ech
  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
  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'];$sepysCoun
  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(!
  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

    Twitter.

    Thank you very much for the great input...
  13. sepoto

    Twitter.

    So I suppose then that just doing this is not quite enough to declare the global: <script type="text/javascript" src="jquery/jquery-1.8.0.js"></script><script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script><script type="text/javascript">var window.barLocations;</script><script type="text/javascript" src="js/jquery.tweet.js"></script><script type="text/javascript" src="js/barsmap.js"></script> I put that into my header. It is still coming up undefined when I try to access it through onclick.
  14. sepoto

    Twitter.

    // Catching the forms submit eventbutton.onclick = function() { button.disabled = true; // Getting the address from the text inputvar address = document.getElementById('addressBox').value;var radius = document.getElementById('radialDistance').value; // Making the Geocoder callgetCoordinates(address, radius); // Preventing the form from doing a page submit//return false;$('#hdivBarLocations').show(); alert(barLocations[0].twitter); //<<<<-----------------------------} So I reproduced the code where the undefined variable was taking place. alert(barLocations[0].twitter); inside o
  15. sepoto

    Twitter.

    I like this code but I am finding I have to modify it: http://tweet.seaofclouds.com/ So then this will be my first jQuery plug-in.
  16. sepoto

    Twitter.

    I have this code that does some AJAX to go back into my database and extract an array of bars. I have developed the code to change one of my div's to display all the data for each bar. In addition to displaying the data I also need to modify the contents of #latestFromDSGbuffer to contain a twitter feed of 5 tweets each per bar that was queried. I have tried a number of samples but for some reason I am able to get the twitter samples working in a sandbox but when I try to integrate that code things don't seem to be working out. I don't know if maybe that is because I was trying to call $.ajax(
  17. So as I change the code to this I am left with an array to string conversion? Hmmm... I'm confused here: <?php function getHours($time, $day, $close){ if(!$close){$hours = <<<htmltext <option value="1" { if(isset($time[$day]['hours1'])) echo $time[$day]['hours1'];} >1</option><option value="2" { if(isset($time[$day]['hours2'])) echo $time[$day]['hours2']; } >2</option><option value="3" { if(isset($time[$day]['hours3'])) echo $time[$day]['hours3']; }>3</option><option value="4" { if(isset($time[$day]['hours4'])) echo $time[$day]['hours4']; }
  18. I have this code from another programmer: function getHours($time, $day, $close){ if(!$close){ $hours = <<<htmltext <option value="1" {$time[$day]['hours1']} >1</option> <option value="2" {$time[$day]['hours2']} >2</option> <option value="3" {$time[$day]['hours3']} >3</option> <option value="4" {$time[$day]['hours4']} >4</option> <option value="5" {$time[$day]['hours5']} >5</option>
  19. I believe at this point that the answer to the [ ]'s is in the PHP json_encode doc's under JSON_FORCE_OBJECT. I'm still toying with it. I'm not sure how I came all unraveled... Darn... No.... using JSON_FORCE_OBJECT breaks the $.each.... I'm lost at this point still and I know it all hinges on the [ ]'s which need to come out on the PHP side. Alright.... This took me a while but this is how it should be.... The JSON has to be parsed and then it becomes much easier... $.ajax({ url: 'ajax.php', data: { lat: results[0].geometry.location.lat(), lng: results[0].geometry.location.l
  20. I figured it out. My first entry comes out like this: lat 34.1721 from: $.each( {"lat":"34.1721","lng":"-118.947","company":"The Bar Cave","street_address1":"315 Eagle Ridge St.","city":"Newbury Park","state":"CA","postal_code":"91320","phone_number":"8054028072","email":"eric.sepich@hotmail.com","website":"","id":"10","twitter":""}, function(k, v){ alert(k + " " + v ); }); It is a bit tricky the way the examples are but it works way well. Sorry... It must be the midnight oil I am burning... So it looks to me like the [ ]'s need to be stripped off in order for the function to work p
  21. [{"lat":"34.1721","lng":"-118.947","company":"The Bar Cave","street_address1":"XXX Eagle Ridge St.","city":"My City","state":"CA","postal_code":"90007","phone_number":"8055551212","email":"eric.sepich@hotmail.com","website":"","id":"10","twitter":""}] The first thing that strikes me about how this JSON was returned from PHP is the opening and closing '[' and ']'. So I am trying to figure out how to iterate through this array which actually represents one row of data from my database. I am wondering do I need to first call $.parseJson();? Do the '[' and ']' remain in there? A lot of examples
  22. I really like this one also. The jQuery library needs to be added: $.ajax({ url: 'ajax.php',data: { lat: results[0].geometry.location.lat(), lng: results[0].geometry.location.lng(), radius: radius },type: 'post',success: function(output) { alert(output); }});
  23. OK. I see what it is. I have to turn off the inside blue border. It appears that everything hinges upon some expert positioning. I still need to study it more. Thank you dsonesuk, you are helping me take things to the next level by showing me this. I greatly appreciate your efforts.
  24. So I have been studying this code and I have read a bit about the callback function: xmlHttp.onreadystatechange = function() { if(xmlHttp.readyState == 4) { HandleResponse(xmlHttp.responseText); } } is asynchronous although I'm not fully sure exactly what that means to me at this point. Essentially I am starting with a page bars.php: <!DOCTYPE html><html><head><title>Daily Sports Guide Bars</title><link type="text/css" rel="stylesheet" href="style/style.css"><link type="text/css" rel="stylesheet" href="style/suckerfish.css"><style>#ma
  25. It's going to take me a bit of time to tinker with what you have done. I see I can learn quite a bit from running your code through jsFiddle. Thanks again it looks like an awesome alternate method.
×
×
  • Create New...