Jump to content

sKunKbad

Members
  • Posts

    1,832
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by sKunKbad

  1. I'm trying to use a simple encryption class and getting 500 errors. I was able to pinpoint the error to a check for CRYPT_BLOWFISH: if( CRYPT_BLOWFISH == 1 ) { // .... } I thought all php 5.3.X installations were supposed to have CRYPT_BLOWFISH defined. What can I do? The encryption class needs it, and I'm hoping there's an easy fix.
  2. You could say that CodeIgniter and Cake are old and obsolete, but I continue to make tons of money with CodeIgniter. I was hired and have been working on a large project for more than 18 months because I knew CodeIgniter. So, apparently employers are hunting for people that know specific frameworks, and telling somebody to not use CodeIgniter because it is obsolete and has no future may be bad advice. I for one could care less what framework I use, because I try not to pretend I am too elite for one or the other. My primary goal is to make money, and the framework I use is not as important as the fact that I can do what I need to do to get the job done. Cha-ching! Laravel is actually a newer framework that seems quite popular. If I was starting with frameworks, I think I'd choose Laravel.
  3. It's not fantastic, and I've seen many sites that are worse. It doesn't make the band look really good, so if they aren't really good then the website is not likely to do much for them.
  4. You could also do something like this: $sql = "SELECT * FROM diamonds WHERE colour IN ( ?, ?, ? )"; $query = $this->db->query( $sql, array( "D", "E", "F" ) ); I find this much easier for complex queries than using active record, which ends up being harder than just writing the query out by hand.
  5. You can check out my Community Auth application, located at community-auth.com. The user management table is a full working example of searchable and paginated query for users. It'll for sure get you on the right track.
  6. I've been trying to connect to a CentOS server with ftp_ssl_connect, and I just get errors, even though I can successfully connect with FileZilla using FTPeS. These are the errors: Warning: ftp_login() [function.ftp-login]: SSL/TLS handshake failed in C:\xampp\htdocs\script-library\connectivity\connectivity.php on line 72 Warning: ftp_login() [function.ftp-login]: Proceed with negotiation. in C:\xampp\htdocs\script-library\connectivity\connectivity.php on line 72 The server has vsftpd for ftp. It is configured for SSL, and again it works with FileZilla FTP client, so I don't know why it doesn't work with my PHP. Other than the above error messages, I don't really know how to debug or get more info. $ftp_server = '123.123.123.123'; $ftp_user_name = 'username'; $ftp_user_pass = 'xxxxxxxxx'; $file = 'test.txt'; $remote_file = 'test.txt'; $remote_directory = '/home/username'; $ftp_output = ''; // Test if connection is HTTP or HTTPS if ( isset( $_POST['do_ftp'] ) && $_POST['do_ftp'] == '1' ) { if( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' && function_exists('ftp_ssl_connect') ) { // Set up secure ftp connection $conn_id = @ftp_ssl_connect( $ftp_server ); } else { // Set up standard ftp connection $conn_id = @ftp_connect( $ftp_server ); } } // Check if connection was made if( is_resource( $conn_id ) ) { $ftp_output .= '<span class="good">FTP CONNECTION SUCCESSFUL</span><br />'; // Login with username and password if( $login_result = ftp_login( $conn_id, $ftp_user_name, $ftp_user_pass ) ) { $ftp_output .= '<span class="good">FTP LOGIN SUCCESSFUL</span><br />'; // Turn passive mode on ftp_pasv( $conn_id, TRUE ); // CD to the appropriate directory ftp_chdir( $conn_id, $remote_directory ); // Upload a file if ( ftp_put( $conn_id, $remote_file, $file, FTP_ASCII ) ) { $ftp_output .= '<span class="good">FTP UPLOAD OF ' . $file . ' SUCCESSFUL</span><br />'; } else { $ftp_output .= '<span class="bad">FTP UPLOAD OF ' . $file . ' FAILED</span><br />'; } } else { $ftp_output .= '<span class="bad">FTP LOGIN FAILED</span><br />'; } // Close the FTP connection ftp_close( $conn_id ); } else if( isset( $conn_id ) ) { $ftp_output .= '<span class="bad">FTP CONNECTION FAILED</span><br />'; } Output from FTP: FTP CONNECTION SUCCESSFUL FTP LOGIN FAILED
  7. I'll have to play around with the fonts some more. I've already spent a lot of time doing that, but I'll give it a shot.
  8. I made this site this week: Classic Mobile Detailing Just wondering if you were looking for a mobile detailer, if the site would be appealing to you. It was just a fun project for myself.
  9. Looks like they were trying to hack your site.
  10. This ended up working for me: '/(?<=# BEGIN DENY LIST --)(.|\n)*(?=# END DENY LIST --)/'
  11. I'm trying to replace the spaces, or what will be a current list of IP addresses that are between the 2 comments in this string <?php $deny_list = ' 123.123.123.123 222.222.222.222 '; $string = ' ## IP BANNING <Limit GET POST> order deny,allow # BEGIN DENY LIST -- # END DENY LIST -- </Limit> '; $pattern = '/(\# BEGIN DENY LIST --)(.*?)(\# END DENY LIST --)/'; $string = preg_replace( $pattern, $deny_list, $string ); echo '<pre>'; echo htmlentities( $string ); echo '</pre>'; Can't figure it out.
  12. It would be a better and easier strategy to leave the price in the cart as full price, but compute the checkout total based on the status of the coupon being applied.
  13. Double click not possible on iPad, so I could really check it out. Is there a reason it cant be single click?
  14. Why not just use the CI Uploader class?
  15. I've got a query that may produce multiple results because of multiple tenants records, but I need to have only one result per unit: SELECT DISTINCT u.`unit-id`, u.`street-address`, u.`property-id-fk`, u.`suite-no`, t.`tenant-id` FROM unit_table u LEFT JOIN tenant_table t ON u.`unit-id` = t.`unit-id-fk` WHERE u.`status` = 'Inactive' AND u.`owner-id-fk` = ? This doesn't work unless I dont select tenant-id, but I need a tenant-id. If I put DISTINCT before t.`tenant-id` it produces an error. How can I have the query only return a single row for each unit AND tenant?
  16. What happens when you want to do an sql join?
  17. I'd appreciate if people with a lot of php security knowledge could check out my application. I'm not interested in security related to the server, only my application. All code is available on bitbucket: https://bitbucket.org/skunkbad/community-auth-ci-session-version Installed at: http://community-auth.com Verification for phpfreaks - http://community-auth.com/phpfreaks.txt I've studied many hours regarding php security, but there's always a chance I missed something. I'd appreciate if you take it easy on the server. I don't want my host to get mad at me or anything. Thanks
  18. I once had a virus on one of my network computers that was sniffing network traffic. Because I was using standard FTP, it was stealing my FTP login username and password. Once I took that computer offline, everything was fine. You ought to make sure that your computer, as well as all the computers on your network are clean.
  19. php has csv functions that would make what you are doing super easy.
  20. class Homepage extends CI_Controller { public function __construct() { parent::__construct(); // Assuming layout.php or Layout.php is located in /application/libraries/ $this->load->library('layout'); } public function index() { $whatever = $this->layout->some_method(); } }
  21. You should use as little db activity as possible, because it's always faster to get things from the file system. This is what I would do: <div id="box_Content_700b"> <?php // If db insert successful if( mysqli_stmt_affected_rows( $stmt ) == 1 ) { ?> <h1>Member Account Created</h1> <p>Congratulations!</p> <p>Your account has been created, and a confirmation e-mail sent to: "<?php echo $email; ?>"</p> <p>Please click on the link in that e-mail to activate your account.</p> <?php } // If db insert failed else { ?> <h1>Account Creation Failed</h1> <p>You could not be registered due to a system error.</p> <p>Please contact the System Administrator.</p> <?php } ?> </div>
  22. The margins / padding are not looking good in FF3 on Ubuntu. I don't know what it looks like on another computer / browser, but you might want to make sure it looks good in a lot of browsers.
  23. It seems pretty nice to me. I'm not sure I would put all the videos on one page, because it you end up with lots of videos, it would be better if they were separated into different pages/categories.
  24. I think you ought to take a look at free template sites and learn to use CSS without a table based layout. It's not the worst site I've ever seen, but it's certainly not going to wow anyone, and that's not good if the person is a potential customer.
  25. I don't think you need to use a foreach loop if you are using next_row and previous_row. Take a look at the docs again. Start with a single row by using row_array. $row = $query->row_array(); $next = $query->next_row(); $prev = $query->previous_row();
×
×
  • 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.