Jump to content

fastsol

Moderators
  • Posts

    827
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by fastsol

  1. I truly hope that you are simply trying to paste paragraphs of text and not actual code from Word. Programming in Word is a terrible idea and should be avoided at all costs.
  2. 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.
  3. If this is the code for the entire page, then remove the blank lines at the top of the page before the opening <?php tag. Make the <?php the first thing on the page.
  4. 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);
  5. 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(); }
  6. You forgot to put the escape_string on this line $cv = ($_FILES['cvfile']['name']);
  7. 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.
  8. Change this $finfo = new finfo(FILEINFO_MIME); To this $finfo = new finfo(FILEINFO_MIME_TYPE); The first version will also return the charset for the file. Second version only returns the mime type string.
  9. 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.
  10. 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.
  11. 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.
  12. 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; }
  13. Set it right with the other session vars for their username and user_id. // Authenticated, set session variables $user = $result->fetch_array(); $_SESSION['user_id'] = $user['id']; $_SESSION['username'] = $user['username']; $_SESSION['role'] = $user['role'];
  14. I also hope that you are storing the date in the db in a DATE appropriate data type for the field. Something like DATE or DATETIME or TIMESTAMP
  15. echo "Date of Birth: " . date("d-m-Y", strototime($row ['dob']));
  16. What exactly is a "soft refresh" in your mind? If it stops working after an ajax load are you sure there isn't a javascript error in the console after the ajax?
  17. This function is spelled wrong - fetchFromLysqlDatabase();
  18. 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());
  19. 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.
  20. I found this article that seems informative http://klungvik.com/blog/2011/05/03/increase-exim-performance/comment-page-1/
  21. Oh I know it's possible. I'm sure it's a combination of server software and different coding language than php to an extent.
  22. You're lack of punctuation in your post is making this hard to understand what you're trying to do. If you are trying to enable/disable the dropdown only when another dropdown is selected, but do it without refreshing the page, you'll need to use javascript. Otherwise the other dropdown will only be able to be enabled by php if the page is refreshed.
  23. Sending emails is a time consuming process in php. I've tried optimizing this same thing and seems to be about an average of 1.5-2 seconds per email to send depending on if it's going through smtp or not.
  24. 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.
  25. Have you done a viewsource on the page after it loads to see what/if anything is being populated in the url tag in the div style? To see if it's empty or the path is wrong.
×
×
  • 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.