Jump to content

LoneStarJack

Members
  • Posts

    19
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

LoneStarJack's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am trying to use class StockMarketAPI and have a problem with acessing the return variable. foreach( $list_of_stocks as $sym){ $StockMarketAPI = new StockMarketAPI; $StockMarketAPI->symbol = $sym; $StockMarketAPI->stat = 'price'; print_r($StockMarketAPI->getData()); The print_r line returns : AA Array ( [price] => 11.885 ) echo '<br>'. $sym. ' ' . $data['price']; I have tried everything I know to capture the "$data['price'] // add update database table here with the returned price };
  2. Thank you I have never used the .param before, but I will read up on it now. Your help is greatly appreciated.
  3. It looked as if my browser (Firefox) was hung up "waiting for phfreaks.com". I tried to delete two as soon as I say the duplication but didn't find the button or link. Please forgive my impatience by pressing the Post button 3 times.
  4. I have tried everything I could find to combine these two AJAX requests into one request, Is there a doable answer? <!doctype html> <html> <head> <meta charset=utf-8"/> <title>Test sessions</title> <script src="../js/jquery.js" ></script> </head> <script> $(function() { $("#btn_test").click(function(){ $.post("sessions_set.php", { key: "test_type", value: "any old type" }); $.post("sessions_set.php", { key: "test_mode", value: "any mode" }); }); }) ; </script> <button id="btn_test" />Click <?php session_start(); $_SESSION{$_REQUEST["key"]} = $_REQUEST["value"]; ?>
  5. I had to reinstall everything on my laptop when a virus program wiped out my registry without first backing it up. Luckily I also installed PHPEd. Now everything that worked before comes to a blank screen however I can execute the program with PHPEd. This bombs out on my laptop: http://127.0.0.1/utility/ad_hoc_query.php With Status Code:500 Internal Server Error This works on my laptop using either PHPEd or the URL address line. http://localhost:8080/file:/C:/inetpub/ ... _query.php I tried changing the connection to mysqli and changed from localhost to 127.0.0.1 but that didn't solve to problem. I did not see any port info in PHPINFO and wonder if there is a problem between 3306 and 8080. Where do I change it?
  6. son.of.the.morning The keypress, keyup, and keydown allow me to test the length of the field with each key stroke. If the length is greater than 10 the button will be shown. It will also hide the button should the count go below 10.
  7. It was easier than I thought. <script> $(document).ready(function(){ $('input#btn').hide(); $('textarea[id=text]').keypress(function(){ if($(this).val().length > 10) { $('input#btn').show(); } else { $('input#btn').hide(); } }); }); </script>
  8. Thanks scootstah. Works great. I like your format for your answer. Now I want to work on the contents of the textarea having a length > 10
  9. I tried both suggestions and combinations thereof and it still was no go. I am wondering about #ta being a TEXTAREA. $('#ta').keypress(function(){ if($(this).val != ''){ $('#btn').css('display', 'block'); };
  10. If you link (<link href="style.css" rel="stylesheet" type="text/css"> ) -- do not include the <style> tags in the style.css file.
  11. css('display', 'none') works and so does the visibility fnction, but they will not turn back on with the $('#ta').onkeypress(function().
  12. I can't get the desired results with this code <script> $(document).ready(function(){ $('#btn').css('visibility','hidden'); }); $('#ta').onkeypress(function(){ if($(this).val != ''){ $('#btn').css('visibility','visible'); }; }); </script> </head> <?php if (!isset($_POST["sql"])) { echo '<body onload="document.forms[0].elements[0].focus()">'; echo '<div id="formx" >'; echo "<h2>Dump Query Records</h2>"; echo '<form action="dump_query_records.php" method="post">'; echo 'Cut and paste sql statement' . '<br>'; echo 'SQL : '; echo '<textarea id="ta" cols="65" rows="6" ></textarea>'; echo "<br>"; echo '<input ID="btn" type="submit" value="Submit SQL!" > </input>'; echo '</form>'; echo '</div>'; exit(); }; ?>
  13. Thank you. My host must have updated my phpinfo. I had to have him turn off magic quotes because I could not find out where it is controled. I have it off on my local site and would never put it on.
  14. I enter the following: select nam_last from names where nam_last = 'cohn' into a form field When I print it in the next program I get select nam_last from names where nam_last = \'cohn\' Which generates an error: SELECT Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'cohn\'' at line 1 What causes the \ to be added into the field, and how do I stop it?
×
×
  • 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.