Jump to content

quasiman

Members
  • Posts

    197
  • Joined

  • Last visited

About quasiman

  • Birthday 09/13/1974

Profile Information

  • Gender
    Male
  • Location
    Austin, TX

quasiman's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. That's a great effort, but you're assuming a lot by posting this much information. Hopefully it's helpful...
  2. Without any idea of your requirements or abilities, here's what looks like a good example: https://github.com/web-project-builder/expense-management-codeigniter-adminlte-php
  3. Yep, doesn't work. Glad we got that sorted out.... lol. Only support I can provide (without more details) is the console log error I'm seeing: VM15:1 Mixed Content: The page at 'https://social.searchika.com/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://social.searchika.com/requests.php?hash=dae40cb6316d320130e8&f=update_lastseen&_=1562702739775'. This request has been blocked; the content must be served over HTTPS.
  4. I have to agree with the comments above. They're a bit harsh, but really this is for your own good. You need to know what's going on - instead of just putting the ability to upload anything out there. Here's a few good places to start: http://www.w3schools.com/php/php_file_upload.asp http://www.tizag.com/phpT/fileupload.php http://webcheatsheet.com/php/file_upload.php
  5. This is a Joomla component, and so natively I can't use ON DUPLICATE, but I've thought about putting it into just standard SQL... I just wouldn't have the portability. I think I'm going to look into running this through a cron plugin, instead of at the user page views. Thanks!
  6. Hi all, I'm working on a project involving an orders set of APIs, and having trouble coming up with the best logic to handle this - with the smallest amount of overhead and client facing slowness. Here's the jist of what I'm looking at... There are 21 API methods to pull different types of orders, and each of them handle paging by requesting a number of records (10 - 500), and a page number. So I could say in my URI, "page-no=1&no-of-records=50", followed by "page-no=2&no-of-records=50", to get subsequent records. The API will return in each call the total records returned as well as the total records in their database. Now, I want to insert all of this into my database, and so that means something like 21 APIs * 3 SQL requests each = 63 sql queries (check it exists, if so update - else insert). This seems to me like way too much work for a client facing application. Any suggestions?
  7. I've been trying and trying, but can't seem to get how you're meaning... 1. I need $data to be an array of everything, so that I can iterate over it to get the $query array of records. I'm not sure how I can make $data a temporary variable to do that - can you explain further? 2. I've tried combining the two arrays together, but really that just iterates over each $api method, reassigning values all over them. I'm sure I'm not doing what you had intended, but this seems to work foreach ($api as $type => $value) { $data[$type] = $dispatcher->trigger('getData', array(&$value, $string)); } // Loop through results foreach ($data as $k=>$key) { if (is_array($key)) { foreach ($key as $val) { if (is_array($val)) { foreach ($val as $v) { if (is_array($v)) { $v['apimethod'] = $k; $query[] = $v; } } } } } }
  8. Sorry for the topic title if it's confusing, I wasn't sure what to call this. So, I'm calling an array of API request and pushing the responses all into one array - but I need to identify which API is which. I've assigned keys to the api array, but I'm not sure how to get them into the returned data. Here's what I have so far..... $api = array( "domains" => "api/domains/search.json", "websrvs" => "api/webservices/search.json", "snlinus" => "api/singledomainhosting/linux/us/search.json", "digcert" => "api/digitalcertificate/search.json"); foreach ($api as $type => $value) { // Joomla style trigger to get the API data $data[] = $dispatcher->trigger('getData', array(&$value, $string)); } // Loop through results foreach ($data as $key) { if (is_array($key)) { foreach ($key as $val) { if (is_array($val)) { foreach ($val as $v) { if (is_array($v)) { $query[] = $v; } } } } } } return $query;
  9. Nevermind, I figured it out.... I set the dataType to 'json', but then I didn't properly set the object.
  10. Hi, I'm trying to learn jquery ui (without much of a javascript background), and I think I'm pretty close to what I want.....but the error I'm seeing doesn't make much sense to me. Here's my code first: <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> <script> $(function() { var contactid = "<?php echo $_GET['contactid']; ?>"; $( "#dialog-confirm" ).dialog({ autoOpen: false, resizable: false, height:290, width:450, modal: true, buttons: { "Delete": function() { $.ajax({ type: "POST", url: 'delete-contact.php', data: {contactid: contactid}, dataType: 'json', context: $(this), cache: false, statusCode: { 404: function() { alert("page not found"); }, 200: function() { alert("200 success"); } } }).then( function(){ alert("$.ajax succeeded"); }, function(){ alert("$.ajax failed!"); } ); }, Cancel: function() { $( this ).dialog( "close" ); } } }); $( "#confirm-delete" ) .button() .click(function() { $( "#dialog-confirm" ).dialog( "open" ); }); }); </script> Now, you can see I have a few alerts in there, and I'm getting two to popup, first '$.ajax failed!', followed by '200 success'. I check Firebug and I can see the post successful (to a dummy file just echoing the $_POST), so I don't understand why I'm seeing the deferred.then() return an error. Any ideas for jquery newbie?
  11. I figured it out..... "In order to be able to directly modify array elements within the loop precede $value with &": http://php.net/manual/en/control-structures.foreach.php So all I had to do was: $services[] = getData('domains/search', $params); foreach ($services as &$service) { foreach ($service as &$s) { if (is_array($s)) { $s['key_name'] = "key value"; } } } print_r($services);
  12. Hi all, I feel like this is a dumb question, but I can't seem to get around it. I'm working with several arrays and pulling them together basically like this: $services[] = getData('....', $params); $services[] = getData('....', $params); $services[] = getData('....', $params); $services[] = getData('....', $params); $merge = call_user_func_array('array_merge', $services); Now, the getData function is pulling through info from an API and I want to add a little reference to each array to show where it came from. The array I'm getting back looks like this: Array ( [0] => Array ( [entity.entityid] => 44705207 [orders.endtime] => 1372226238 [orders.resellerlock] => false [orders.timestamp] => 2012-06-26 05:57:20.292531+00 [orders.creationdt] => 1340690238 ) [1] => Array ( [entity.entityid] => 44705207 [orders.endtime] => 1372226238 [orders.resellerlock] => false [orders.timestamp] => 2012-06-26 05:57:20.292531+00 [orders.creationdt] => 1340690238 ) ) I tried this: $services[][]['key_name'] = 'key_value';. But it just adds a new array set : Array ( [0] => Array ( [entity.entityid] => 44705207 [orders.endtime] => 1372226238 [orders.resellerlock] => false [orders.timestamp] => 2012-06-26 05:57:20.292531+00 [orders.creationdt] => 1340690238 ) [1] => Array ( [entity.entityid] => 44705207 [orders.endtime] => 1372226238 [orders.resellerlock] => false [orders.timestamp] => 2012-06-26 05:57:20.292531+00 [orders.creationdt] => 1340690238 ) [2] => Array ( [key_name] => key_value ) ) So how do I add a key / value to the arrays that are already there? $services[] = getData('....', $params); foreach ($services as $service) { if (is_array($service)) { foreach ($service as $key) { $key['key_name'] = "key_value"; } } } This didn't even show up in the results.... I'm lost.
  13. Oops...I just realized this is the wrong forum. Maybe a moderator can move it?
  14. Hi Everyone, To begin with, traditional basic PHP/MySql websites use stored usernames and passwords in their database for authentication, and create session values to grant user access, based on the username and a hash of the password. Now, the site I'm working on uses MySql for the session storage and brute force protection, but the username and password are not stored there. During the login process the username, password, and IP address are passed via cURL to an API, which responds with a temporary (about 5 minutes I think) token. My question is this. What's the best way to ensure the session is secure? I'm not storing the password locally, and obviously I can't keep it in session to revalidate at the API. Would it be secure "enough" if I simply store the token response in MySql? Maybe hash it together with the username, IP address, and browser agent? If I did that, at least with the next login the token would be different and a new hash created. Any ideas?
  15. Josparky, Did you set the password in the config.php file? $upload_dirs = array( "images" => array( "dir" =>"uploads/images/", "name" =>"Images folder", "password"=>"images", ), "docs" => array( "dir" =>"uploads/docs/", "name" =>"Docs", "password"=>"docs", ), "common" => array( "dir" =>"uploads/common/", "name" =>"Common files", "password"=>"common", ), );
×
×
  • 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.