Jump to content

fastsol

Moderators
  • Posts

    827
  • Joined

  • Last visited

  • Days Won

    9

Posts posted by fastsol

  1. Found the problem. My main table was not set on InnoDB *facepalm* so each instance I was making was waiting to complete updates and with each new instance it made it run slower and slower as it was having to wait for more likely collisions on the table. Quick change made it significantly faster but I will play around more with it later and see if that is the only problem.

    Once you verified the stats on the computers and where everything was getting info from, I was becoming very certain the issue lied in the query.

  2. Well right now the code is going to insert a new row if there already IS a row in the db with a name of the posted $name.  So you have that part backwards. What you want is this instead

    if (!$result) { // Notice the !
    

    Then I'm not sure if you are using a custom pdo wrapper, but get_result() is not a pdo object function, so that isn't going to return anything.  What you want instead is this.

    $result = $prepare->fetch(PDO::FETCH_ASSOC);
    
  3. Simple, you're clearing it on the 3rd line of the script everytime the page loads

    $_SESSION['values'] = array();
    

    This would be more appropriate.

    if(!isset($_SESSION['values']))
    { $_SESSION['values'] = array(); }
    
    • Like 1
  4. Yes Godaddy is terrible and honestly should not be used even if they fix the server issue.  They have tons of accounts on blacklists for email, so it's highly advised not to use them.  Your best alternative at this point would be to use a SMTP service.  I suggest making a gmail account for each business website and use phpmailer to send the emails through SMTP to gmail.

  5. If you're using Windows, I would suggest WAMP.  I have WAMP and it works perfect on my laptop.  What you use is up to you based on your machine and abilities to get it installed properly.  How many files are we talking that need to be updated?  If it's just a few, maybe just scan through them in Notepad++ for outdated functions or <? short tags like suggested above.  Find any issues and upload them to a server quick and test them there, rather than installing a outdated server locally.

  6. The server version isn't really an issue that needs to be solved to initially find out why the code is not working.  Initially you need to make sure you have a fully installed server to work with and then make sure that error_reporting is turned on and display_errors is on also.  You can do that globally in the php.ini file or at the top of any php page like this

    ini_set('display_errors',1); 
    error_reporting(E_ALL);
    

    Once those errors start to show up, then you can decide based on those errors if it's really a php version issue because old code won't work on the new version.

  7. The extension doesn't matter. It's just the name of the file, and it's just client input. A file does not have to have any extension at all to be a valid file. This is why you check the mimetype instead, which actually examines the contents of the file.

    I do agree, but the mime type can be manipulated too by the client (at least for images, I honestly don't know for other file types).  I have seen this debated over and over again and no one has ever given a solid resolution to how to upload files safely.  I am pretty confident in how I upload files on my server cause I have them stored outside the root and use a script to read the file rather than just display the image and folder permissions set so only the script can read the directory. 

     

    This truly is a topic that I would love to see a real expert way to handle regular file types like .pdf and .doc in uploads.  Everyone seems to have an opinion, but no one really ever shows a better way of doing it.

  8. You should also check the extension of the file.  It too is not fool proof but it's another step to help ensure it's the type you expect it to be.

    $allowed = array('doc', 'docx', 'pdf');
    
    $ext = explode(".", $_FILES['cvfile']['name']);
    $extension = strtolower(end($ext));
    
    $finfo = new finfo(FILEINFO_MIME);
    
    $mimetype = $finfo->file($_FILES['cvfile']['tmp_name']);
    
    if (!in_array($mimetype, $types) || !in_array($extension, $allowed)) {
        $ok = 0;
    }
    
  9. You need single quotes around the username and password values in the query string

    $query = mysql_query("SELECT * FROM UserName where userName = '" . $_SERVER['PHP_AUTH_USER'] . "' AND pass = '" . $_SESSION['PHP_AUTH_PW'] . "'") or die(mysql_error());
    
  10. That question is best left to you based on your needs/wants, but the normal I would say is "payments standard".  It really also depends on how much $$ you're going to push through paypal.  The payments standard doesn't have a monthly merchant fee, but has higher transaction fees.  So if you do lots of $$, then paying a little merchant monthly fee will likely outweigh the savings of lower transaction fees per transaction.

  11.  I personally use http://ixwebhosting.com

    Their support is great and very helpful.  I had a shared hosting account for years with them and I think they finally updated to at least php5.4 but I could be wrong cause I only use their dedicated server hosting now and I can set that to what ever I want.  Their shared hosting uses I think Centos control panel and is not the greatest.

     

    I have clients that use Hostgator, NetworkSolutions and I think BlueHost.  All seem totally fine and use cpanel so you can generally get whatever you need setup.

×
×
  • 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.