
M.O.S. Studios
Members-
Posts
300 -
Joined
-
Last visited
Everything posted by M.O.S. Studios
-
excellent! ill try it all again, and look at the files. The html source was of the page sending the request on my end! I had the response sent to the console.log() function so I can more closely examine it. I was getting source code for the html page I wrote to send it
-
Hey everyone, I’m trying to write an api call to the Trexity API. They have some documentation here. I’ve used apis before, and it’s never been an issue. However I have been trying to get a curl command to connect and I can not. I have an API token, tried using the ‘Bearer’ authentication and I either get a 500 error, or it sends back a response; but it’s just the html source of the page that is sending it. normally I’d attach source code, but I rage deleted it a few days ago. I was hoping someone could maybe take a look at the documentation and let me know if they notice anything unusual… only thing I see is it uses openAPI; and I don’t know what that is I will be making the code again. If I have the same issue, I’ll post the code here thanks everyone
-
What are Best Practice for some of these concepts?
M.O.S. Studios replied to M.O.S. Studios's topic in PHP Coding Help
Would this be safe? I believe its possible for one website to read cookies from another. Couln't they copy that cookie to access the site? -
Hey everyone, I am working on a project for fun. This is a LAMP application that is going to run on my intranet server, and hold NO VALUABLE data. I am doing it just to get better at programming, and learn some best practices and techniques. at this point, I am working on some things, and I don't know what the best practices are. Can someone help me go down the pest route? 1. A log-in system and I want to include a "remember me" button. What is the best practice for this? Obviously leaving user data in a cookie is asking for trouble, so I was thinking of leaving a unique id of some sort? 2. Information in a login SESSION. What information do you put in a log in session? I have seen lots of different techniques on this. I don't really know which is the best. For the moment, I keep an array like this: array('Status'=>True, 'Username'=>'Users name" ,'email'=>'users Email'). If a hacker can inject session information, this seems like it would be really easy to break, because they only need a user's name and email to gain access. Is there something more I should do? 3. Config file that holds Mysql Information. I made a file that contains all the values that might change over time. That way I only need to change it in one spot. In this file I have things like the Mysql Database information. Should these files be encrypted? Or can I use a .htaccess file to make sure it isn't accessible to a hacker (as I mentioned before, this isn't a project that's going live, its more of an exercise to help me learn) Thanks everyone
-
I’m asking for educational purposes, I think understanding why is as important as how. so, if I understand correctly, the idea is it strictly prevents comparing hashed password together. So one cracked password doesn’t unlock them all?
-
Maybe I am using the wrong terminology. if someone got a hold of the DB, the can see the $2y$10$ And assume that’s how it was encrypted. Then run a list of common passwords through password_validate along with the hash. if it tests each hash against the most common passwords, words, etc.. first, then worked its way down to the least common, it could in theory works out the majority of information.
-
Hey everyone, I’m working on an app for my local intranet sever. My security needs are almost non existent, because it’s only accessible on my local network. Even if someone wanted to mess with it, the only thing this app controls is my fish tank! Yup, it just shows me some information about my water, and let’s me turn on and off devices. So I’m not too worried about it. That being said, I want to add a password just to keep my coding skills sharp, as I haven’t done anything with php in a while. That being said, I would like some help understanding something... while looking up the best practices for working with passwords, I found password_hash and password_verify... don’t these two function completely negate the advantages of salting a password? my understanding is that salting a password makes using a rainbow table impossible. However, what’s stopping someone from just doing a dictionary attack with the password_verify function? as I said above, my application doesn’t require a lot of security, I’m asking for educational reasons
-
Hey everyone, I’m pretty new to python, but have done a lot of coding with php and JavaScript. here is what I am hoping to do. i want to write a script that will do the following: 1. scan sub directory make an array with the names of each of the files 2. iterate through the files using the array, and make either a object, or a function using the file name (without the extension) as the name, and the contents for the code 3. Run the function/create object that were just created, and with known variables I’m pretty sure I can figure out step one and three. It’s step two that’s giving me problems. I tried using the open() function, and eval(), but it’s giving me some problems, and that feels like a ‘janky’ way to do it. this is for a raspberry Pi project I’m using to control the equipment on my fish tank. The idea is I can write code for each sensor individually, and the program will automatically be able to incorporate it. I’d just have to drop it into the folder any suggestions?
-
Making a LI with a listener from a object
M.O.S. Studios replied to M.O.S. Studios's topic in Javascript Help
I've changed it. it now works masterfully effectively. for (keyValue in navArray){ $('#navMain ul').append('<li>'); $('#navMain ul li').last().text(' ').attr('id', keyValue).append('<div>'); $('#navMain ul li:last div').text(navArray[keyValue]); } $('#navMain ul').on('click', 'li', function(){window.location = $(this).children('div').text();}); -
Making a LI with a listener from a object
M.O.S. Studios replied to M.O.S. Studios's topic in Javascript Help
I didn't know that about Id's. I thought they had to be unique within their own siblings. I am making it using PNG's and CSS for two reasons 1. I need unique font, and this is the best way to get it 2. When I need to translate the page, I can have one script to change the CSS Here is how I ended up doing it, But I may change that now to have one listener like you described. (function( $ ){ $.fn.navMenuADD = function(URL){$(this).click(function(){window.location = URL;});}; })( jQuery ); for (keyValue in navArray){ $('#navMain ul').append('<li>'); $('#navMain ul li').last().text(' ').attr('id', keyValue).navMenuADD(navArray[keyValue]); } -
so I have an object that contains the information I need to create a navbar within my CMS. I have the code working, but I feel I can make it more efficient. at the moment here is the OOO of the script: Iterate through the object and does three JQuery commands: 1. Creates an LI object 2. give the new LI tag a: content = ' ', an new ID (taken from the object's key it's iterating through), and add an internal DIV; 3. populate that new internal DIV with the URL the LI goto 4. iterate through all the new LI's and create a 'click' listener that send the browser to that link. A few things should be noted. The DIV's that are created are invisible. they are just there to hold the information for the script This is a image based Navbar. So the LI's link to a StyleSheet. Thus the unique id I think the first and second step can be combined into one. I also feel If I could assign each LI the listener as they are being created I could make the whole thing cleaner. When I try this way, all the links end up leading to the same place. I remember this having something to do with "reference" information opposed to "String". If I remember right, When the script iterates and assigns the URL to the listener, it's not saving the information, it's saving a reference to a variable. When that variable changes, it alters all the variables that reference it. I term 'function factory" comes to mind; but a google search didn't help Any thoughts? Here is the code var navArray = {'navHOME' : 'index.php', 'navLOGIN' : 'login.php', 'navCART' : 'CART.php', 'navcontact' : 'contact.php'}; for (keyValue in navArray){ /*step 1 */ $('#navMain ul').append('<li>'); /*step 2 */ $('#navMain ul li').last().text(' ').attr('id', keyValue).append('<div>'); /*step 3 */ $('#navMain ul li:last div').attr('id', 'value').text(navArray[keyValue]); } /*step 4 */ $('#navMain ul > li').on('click', function(){window.location = $(this).children('div#value').text();});
-
Hey Guys, I want to make a page on my Zencart website. I am having some trouble figuring out the best way to do it. Here is what I am hoping for: 1. Looks and feels like the rest of my zencart. IE has all the themes, headers, menu items etc as the rest of the page 2. I want to be able to edit the contents of it on my computer using my php editor, and have access to the functions and classes that come with Zencart 3. I want to be able to place .js in the appropriate include/modules/pages subdirectory to have a link created in the <header> file I seem to remember that I could make an ezpage, then have it reference to an internal file for content… anyone know if I am remembering right? I tried internal link, but it looks like that isn't it
-
I am working on a website for an e-book that is available on KINDLE. I am working on a script that will send a user to the Amazon page associated with their country. it seems to be working, but I am not able to test properly because I am not able to go around the world to test the script! Is there any (free) was I can fake where my computer is so I can properly test the script? here is the code that determines where the user is coming from jQuery.ajax({ url: '//freegeoip.net/json/', type: 'POST', dataType: 'jsonp', success: function(location){ window.userLocal = []; for(var keyy in location){ window.userLocal[keyy] = location[keyy]; } } });
-
This is the closest section I could post this question. I have some fabric that I love the colour of. It's not a compels colour, it's a price if felt. Anyone have any tricks to find out what it's hex code is?
-
each function is different iteration of the same function. I've already go them set up in a custom queue. I just want to set the queue to space out triggering the functions.
-
OK here is what I have. Queue bf Function 1 Function 2 Function 3 Function 4 Function 5 I want to be able to use delay to beable to set how much time is between each function. according to the jquery website .delay() should be able to do that. Don't know why it isn't. If I use SetTimeout(), I will need the clients computer to start calculating 25 different functions instead of 1 queue... isn't the best way to do it.
-
Nope tried everything, No matter where I add the .delay() I have the same problem. All the functions in the queue trigger at the same time. How do I add the pause in between them!
-
Arg, setInterval is only for triggering the same function. That is not what I'm asking. Hurry has a built in way of queuing different functions and adding a delay between each one. The trick to doing why u want is going tO be delay. Because later on I am going to ad other functions into the queue. So setInterval is not what I need
-
I want to use delay(). this I posted a striped down version of the script, But I want to place things into a queue and figure out how to delay triggering each event.
-
I'm making a script that updates a number in a div every 5 seconds. <!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></title> <script src='jquery.js'></script> <script> $(document).ready(function(){ $.fn.counter = function(fc){ var obj = $(this); var animationSeq = new Array(); var retFun = function(i){ $(obj).text(i); } var retFun_func = function(i){ return function(){retFun(i)}; } for(var i = 0; i<=fc; i++){ animationSeq[i] = retFun_func(i); } for(x in animationSeq){ $(obj) .queue('bf', function(next){ animationSeq[x](); }); } $(obj).dequeue('bf'); } $('#t').counter('25'); }); </script> </head> <body> <div id='t'></div> </body> </html> I'm trying to add a 5 second between each number change. How do I incorporate the .delay function?? Thanks in advance
-
-dang thanks anyway
-
I want the two to be the same so when i upload my apps there is less of a chance of errors.
-
My sandbox server has php 5.3.6 My live server has php 5.2.16 is their a php.ini setting to lower it on my sandbox server? or do i have to reinstall php all together?
-
this works for me function inphpini($key){ $inivalues = ini_get_all(); return (strlen($inivalues[$key]['global_value']) !== 0) } please note i had to change it to make it make scene on out of contents. may be buggy
-
Hey guys, I need a function and im hoping that you guys can help me out. I want to feed this function a ini setting and have it return true if was set in php.ini and false if it isn't set or if it was set elsewhere (set_ini for example). Any ideas? Thanks in advance