Jump to content


Newly Registered
  • Posts

  • Joined

  • Last visited

Everything posted by Mahngiel

  1. "The entered value is compared on the server with the generated value..." Use AJAX or post processing. Further, I hope you're not relying on JS only for validation.
  2. class Auth { private $CI; function __construct(){ $this->CI =& get_instance(); echo 'hook inst'; } function authenticate() { echo 'method called'; $this->CI->session->set_userdata(array('hook' => $_SERVER['php_self'])); echo $this->session->userdata('logged_in') ? 'logged' : 'not logged'; die('end'); } } what happens?
  3. this includes auto-starting ad vids since you NEVER know where the hell they are!
  4. Just learn by trying to build something. It's much more practical to learn this way, as you'll go through the headaches of trying to do something and not know how. Through these experiences you'll figure some stuff out -- hopefully.
  5. you need to kill the script too, dude. Although your "login" script doesn't actually log the user in, and you said this is just for practice... my advice is to change $this->session->set_userdata(array('logged_in' => $arr)); to $this->session->set_userdata('logged_in' => TRUE); Then, when your hook is called, if( $this->session->userdata('logged_in') ) will eval to true.
  6. $this->session->set_userdata('logged_in' => TRUE) !== $this->session->set_userdata(array('logged_in' => TRUE)); Run a dump on $this->session->all_userdata() and you'll see what you're asking for doesn't exist
  7. [this list is only in order as they come to mind, not importance] 1. Debian / Linux Mint : Since the new gnome came out, I transitioned to Mint for it's Cinnamon DE. It's an extremely smooth environment to work AND play in. Being Debian based, it's simple to keep a similar environment to production 2. tmux: The most bad ass terminal emulator on the planet. I couldn't imagine my workflow without it. 3. Firebug: Completely essential if you build any front-end 4. Git(hub): Versioning FTW 5. Dropbox: Helps me keep docs, scripts, dotfiles, graphics, etc sync'd across all my workstations 6. phpStorm: I used to rag on heavy IDEs. Now, I couldn't do without it 7. Bluefish: My favorite light-weight IDE. It works with SFTP so I can mount a remote server and make quick changes with all the colorization, syntax hilights, and code suggestions one needs. 8. GIMP: I often find the need to make quick changes to a graphic, or to grab a layer from a PSD. 9. LESS: A language, yes, but moreso an important tool for keeping organized CSS and compiling out minified CSS 10. Nano: Once you know how to use it, nothing else matters.
  8. By the looks of it, you have an error in your code on line 17. Update that and you should be rockin' and rollin'!
  9. You don't need to extend the validation class to do this. Just utilize the validation class normally. example usage (the form_validation lib is autoloaded in this app)
  10. I like it, do we get to keep our "Freak"-iness or is this only for today?
  11. Why would you imagine you'd need to encrypt the config file? If somebody has access to your server files, they wouldn't need to know your encrypt key to access the information that would be encrypted anyway. I think your paranoia has blinded your thought process.
  12. Did you load the model into the controller? $this->load->model('model_name', 'short name');
  13. Well, though these issue remain, I have developed a workaround by using cURL() for the downloads and using a hard-copy of the WSDL with these options in the SoapClient constructor $this->Client = new SoapClient( "path/to/local.wsdl", array( 'soap_version' => 1.1, 'trace' => TRUE, 'stream_context' => 'context' ) ); Further, had to remove a schema import from the xml. Am still looking for an answer as to why these changes need to be made.
  14. $(document).on('click', 'stuff to prevent', function(e){ e.preventDefault(); } http://api.jquery.com/event.preventDefault/
  15. Issue: Retrieving data from remote HTTP locations. "failed to open stream: HTTP request failed!" Doesn't Work: fopen(), file_get_contents(), SoapClient('[url=]http://remote_wsdl[/url]') Works: curl, wget via CLI & exec() Tried: Set all ini's to allow_url_fopen = 'On' root@OW-WS01:~$ php -v PHP 5.3.3-7+squeeze15 with Suhosin-Patch (cli) (built: Mar 4 2013 14:05:25) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH root@OW-WS01:~# php -i --php-ini /etc/php5/apache2/php.ini | grep 'fopen' allow_url_fopen => On => On root@OW-WS01:~# grep 'fopen' -R /etc/php5/ /etc/php5/cli/php.ini:; http://php.net/allow-url-fopen /etc/php5/cli/php.ini:allow_url_fopen = On /etc/php5/apache2/php.ini:; http://php.net/allow-url-fopen /etc/php5/apache2/php.ini:allow_url_fopen = On Code Debug: ini_set('default_socket_timeout', 10); ini_set('display_errors', 1); ini_set('error_reporting', E_ALL); echo 'allow_url_fopen:' . (ini_get('allow_url_fopen') ? 'TRUE' : 'FALSE') . '<br/>'; echo 'default_socket_timeout: ' . ini_get('default_socket_timeout') . '<br/>'; $Remote_XML = "valid_path.xml"; $todays_XML = __DIR__ .'/imports/' . date( 'Ymd', time() ) . '.xml'; echo '<hr/><br/> Testing fopen()<br/>'; $from = fopen( $Remote_XML, 'r' ); $to = fopen( $todays_XML, 'w+' ); stream_copy_to_stream( $from, $to ); echo '<hr/><br/> Testing file_get_contents()<br/>'; $fgc = file_get_contents($Remote_XML); file_put_contents($todays_XML, $fgc ); echo '<hr/><br/> Testing SoapClient()<br/>'; try{ $soap = new SoapClient( '/?wsdl', array( 'trace' => TRUE ) ); $soap->login( 'user', 'pass' ); echo 'soap passed'; } catch( SoapFault $e ) { var_dump($e); } phpinfo(INFO_CONFIGURATION); Results in image format: http://i.imm.io/10Hle.png So, how do I overcome this? Have sniffed packets and these requests aren't even getting generated. This code works just dandy on local and on another server, so there's got to be something I haven't figured out yet. Any idea what could be causing this or what to try next? Thanks
  16. For the most part yes. I stripped out the unnecessary info to my issue (depending on use, you'd really want some specificity) . Sorry if that lead to confusion. Also, one wouldn't want to use :input for this, as it attaches the handlers to submit buttons
  17. Aah, yes 'Autofill'. I appreciate the feedback and useful links, Ignace, truly helpful. I added input to my bindings and voila (FF 19.0.2) - autofill selection now fires the in response // super generic, over-compensating object mappage $( 'form :input' ).map( function () { // do something on change $( this ).bind( 'keyup change input', function () { } ); } );
  18. I could probably figure it out if I knew what to call it. My google-foo has failed. Is there an event handler for when a user selects an option from their browser's remembered form data? I've gone through keyup, change, click, blur, and select Cheers!
  19. SwiftMailer's function to set the recipient's email and name looks like this: setTo(<address>, <name>); This works dandy, unless a recipient has parenthesis (maybe other characters, but for my purpose is irrelevant). Examples: John (Work) John (Home) In my use case, th data in parenthesis is important for the recipient to derive the intent of the email notification. SwiftMailer will truncate any data in parens leaving behind "John " in both scenarios. Esacaping the parens with a backslash John \(Work\) alleviates the parens replacement, but includes an automatic escaping of the escape lol: John \\(Work\\) Reading into the headers sent with SM, there are several other headers that have parens in them, so I don't believe this is done for that purpose - but I could be wrong. So my Q is two part: Is there a way to send parens in the recipient's name? and is there a reason this is done at all? Cheers
  20. I imagine this is because you're used to ORM. This isn't so much the case with CI, and I bet $20 you'll really like their db driver. // Random Controller $this->load->model('poll_model', 'Polls'); $Poll = $this->Polls->get_poll(array('id'=>3)); // Poll_model function get_poll($data = array()) { // Check for valid data if(empty($data) OR !is_associative($data)) { // Invalid data, return FALSE return FALSE; } // Retrieve the query from the database $query = $this->db->where($data)->get('polls', 1); // Check if query row exists if($query->row()) { // Query row exists, return query row return $query->row(); } else { // Query row doesn't exist, return FALSE return FALSE; } } Joins are always cumbersome, and no different with CI. I would write this: // Controller $pk = $this->uri_segment(3); $this->load->model('quest_model', 'Quests'); $Data = $this->Quests->name($pk); // Model function name($id) { $this->db->select('fields')->from('users_quests')->join('quests', 'quests.user_id = users_quests.user_id')->where('users.user_id = ' . $id)->get(); }
  21. So I was browsing the Google Play store this morning and came across this. I'll let the pictures speak for themselves...
  • 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.