Jump to content

jazzman1

Staff Alumni
  • Posts

    2,713
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by jazzman1

  1. As far as I know notepad++ is not an IDE it's a text/code editor. My personal choice is NetBeans.
  2. Depends of your hosting provider. 100 emails at one time is not good idea.
  3. Take some good php IDE and you'll find problems like this less than 10 sec.
  4. I do believe someone using windows environment would help here. Here is all commands under my CentOS-box. // go to includes directory [root@lxc1]# cd /includes // download the library [root@lxc1 includes]# wget http://phpmailer.apache-extras.org.codespot.com/files/PHPMailer_5.2.4.tgz // unzip it [root@lxc1 includes]# tar -zxvf PHPMailer_5.2.4.tgz // delete the tar file rm -f PHPMailer_5.2.4.tgz // list all files/directories in to /includes [root@lxc1 includes]# ls PHPMailer_5.2.4 [root@lxc1 includes]# ls PHPMailer_5.2.4/ changelog.txt class.phpmailer.php class.pop3.php class.smtp.php docs docs.ini examples extras language LICENSE README test test_script // php.ini ;;;;;;;;;;;;;;;;;;;;;;;;; ; Paths and Directories ; ;;;;;;;;;;;;;;;;;;;;;;;;; ; UNIX: "/path1:/path2" ; include_path = ".:/includes" // restart the web service [root@lxc1 includes]# /sbin/service httpd restart // open up index.php [root@lxc1 includes]# vim /var/www/html/pdo/index.php <?php echo (include 'PHPMailer_5.2.4/class.phpmailer.php') ? 'TRUE' : 'FALSE'; Result: TRUE
  5. A few recommendations when you use again an INSERT statement in the future! It is always a good practice to name all columns into which you are inserting values because: 1) The INSERT statement is much more descriptive 2) You can verify that you are providing the values in the proper order based on the column names 3) You have better data independence. The order in which the columns are defined in the table does not affect (no waste memory) your INSERT statement. So, I recommend to start with examples providing by MySQL into its source page.
  6. Hey sKunKbad, the "chroot" is an operation on the operating systems level changing the apparent root directory for the current able to running process with root priv. This technique allows you to have multiple chroot enviroments as separated domains on the main host. The result afterward is, you will be using the current kernel version of the host and that kernel being shared to others chroot'ed environments on the same machine. One of the problem I encountered using chroot through the years that all processes inside chroot'ed env aren't visible from outside (not able to kill or modified them ), and the most important thing it was, if I want to use chroot'ed programs which need to have a root access from the host, that was impossible (in standart way) by using chroot enviroment, because all modified environment cannot named and therefore they don't access to files, programs and so on outside the designated directory tree. Fortunately, lxc resolve the problems which I mentioned above. If you have a specific question, we're still here
  7. Short answer - yes! Do you know what chroot on Unix/Linux is?
  8. No! [root@lxc1]# mkdir -p /includes [root@lxc1]# mv /var/www/Swift-5.0.3/ /includes/ [root@lxc1]# ls /includes/ Swift-5.0.3 // php.ini include_path = ".:/includes" [root@lxc1]# /etc/init.d/httpd restart //include.php <?php echo (include 'Swift-5.0.3/lib/swift_required.php') ? 'TRUE' : 'FALSE'; Result: TRUE This could go wrong on Linux, not sure for Windows. @rocky48, can you post the link where you downloaded phpmailer. I wanna see the structure.
  9. Then, before writing whatever it may be, I'd suggest to encapsulate the fileserver using a container or some virtualization, personally I recommend LXC, if the server is running on Linux.
  10. What do you mean by saying "filesystem"? Apache (web application) or entire server system?
  11. It's too late for me (00:00) to get into it in detail, but try to apply physco's script to the sql case operator. Try, SELECT `Insurer` , `Policy Name`, CASE {$numberofadults} WHEN 1 THEN "Single{$region}" WHEN 2 THEN "Duo{$region}" WHEN 3 THEN "(Duo{$region} + Single{$region})" END as Price FROM `travelinsurance` WHERE 43 BETWEEN `Age Min` AND `Age Max` AND `Duration Unit` = 'Days' AND 2 BETWEEN `DurationDaysMin` Does the price should be an integer or just a concatenated string, I don't get it ???
  12. Can you post the code here using [ code ] tags rather than as a file attachment?
  13. Some actual error messages would help. What debugging steps have you taken so far, because I see many places that could go wrong. Start with php error_reporting and mysql_error functions.
  14. Do you know how functions work in programming? You need to call NewUser().
  15. Have you ever read the license agreement b/w Canonical and GNU? Not familiar with that, but Ubuntu is still GNU and isn't owned by Canonical. The tricky area here is that almost 80-85% of the GNU developers develop Ubuntu are paid by Canonical. The problems spoken by Richard is on the Ubuntu desktop not for server versions.
  16. Make sure you have a copy of some good php IDE.
  17. Here is a simple test on my CentOS machine, you can apply the same principle on windows one. The default web root directory on CentOS/RedHat/Fedora is /var/www/html. In the html folder I've created my current directory named swiftmailer.: /var/www/html/swiftmailer with testing php file include.php I'm using swiftmailer for the test, however, no problem to use phpmailer as well. The downloaded library I put it for the test inside /var/www directory, so the full path is: /var/www/swift-5.0.3 I open up the php.ini file and make next changes: ;;;;;;;;;;;;;;;;;;;;;;;;; ; Paths and Directories ; ;;;;;;;;;;;;;;;;;;;;;;;;; ; UNIX: "/path1:/path2" ; include_path = ".:/var/www" Then include "swift_required.php" to testing file named include.php include.php <?php echo (include 'swift-5.0.3/lib/swift_required.php') ? 'TRUE' : 'FALSE'; RESULT: TRUE If I change the included path to include_path = ".:/var" Result: That's all, there is nothing complicated, just doulbe check the paths. It should be work on windows as well. Don't forget to restart apache after you made some changes in php.ini file!
  18. Both. The path in php confing file should be to the main directory of this php mail library (phpmailer) not just to a single file. Where did you download phpmailer packet?
  19. @.josh, just to clarify! You're talking about Ubuntu Desktop or Ubuntu Server
  20. First of all, I'm agree with gurus just to jump into some good coding practice using a PSR standard or to follow a consistently style everywhere in your php application. As a web developer you should start to learn Javascript as well at some point and you will see that most often js and php are going together in your practice, for instance using Ajax or..... some web developers mix them up, which I'm considering as a very bad practice. Here is a simple example that uses javascript's return statement in right and wrong way. function square(x) { return { /* right way, good coding style in JS */ "return": x *x } } square(2) function square(x) { return { /* wrong way, the js parcer returns a silent error */ "return": x *x } } square(2) This is the first reason to prefer this coding style and the second is that my IDE (NetBeans) formats by default the code in this way and it's too late to change my habits
  21. When some distro is based on another that means, they are similar in most ways, even though still different in some.
  22. I don't know why you advise people to avoid using Ubuntu as a server. Don't forget, Ubuntu is Debian-based Linux system and the server version is very, very close to Debian server. Personally, don't use it but I couldn't say it's a bаd choice. Whatever OS you want to choose to use - Linux, BSD (apple), Windows or something else, you need strong knowledge on it to be in serve.
  23. First example. You know what happens in javascript, right?
  24. Why? According the screenshot I see 7 returned rows for each group of ID. So, the result of using mysql_num_rows should be only 1 for each of them. He could get the result of klikovi (clicks) to compare how many clicks already had for this particular group of IDs.
  25. I'm not really sure from where to start but, I do believe you should have to learn the basics of SQL and PHP. Also, as Psyco said above, when you ask for a free-paid help, you must provide all relevant information to help us help you. Not to mention that you have searched for a solution to your problem before asking it, haven't you? However, if you're trying to communicate on an English-language forum, you owe it to yourself to make an effort to write/describe the context and comments of your code at least reasonably correct English. I am Bulgarian and understand when reading Serbian language but most of the "staff" and members here do not so, they don't pay attention about your posting just scrool down the page in fine it's absolutely unuseful for anybody here. I dislike when people posting links out, for instance how to ask questions in a smart way or something similar, but do some google research and maybe you'll find some useful article for you. So, to answer your question, first, you need to define and explain in English what your intent is! If I understand correctly ( correct me if I am wrong), you have a website, where the members post links, text, pictures or something else. So, you want to restrict postings in time one per day (24 hours) for those members having postings less than 3. For those ones which already had more than 3 this restriction shouldn't work, right? Or...a second scenario. All users can make postings but only those who already had 3 clicks (as "like", "good", "yes" or something else) in their profile only they would be able to make posting more than 1 post per day. Can you explain that in a better way? Could you also explain the logic of this UPDATE statement too -> "UPDATE clanovi_njihovi_racuni SET klikovi = klikovi-0 WHERE id='$racun'"; especially the part of a SET statement - klikovi = klikovi-0. How is data represented in "klikovi" column as 0 (zero) and 1 (one) for click, or...? Why the foreign key named "racuni" is on type varchar in case, it links to PK of int type column? And finally if every click is represented as integer (0 and 1) in its column, you can simply summarize them using a sql sum() function, join both tables on "racuni" key, group them by user_ID and use the logic provided by kicken.
×
×
  • 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.