This article can help you to track down outgoing spam using PHP.
From php version 5.3.0 we can use the directive mail.log to log who’s calling the function mail(). When someone calls the function mail() from a php script we can get some info about the sender in log.
PHP mail.log entries include the full path of the script, line number, To address and headers.
1. Check email log
2. Edit php.ini
3. To enable mail.log, add following line in php.ini
4. Create lo...
The following RewriteRule lives in the .htaccess file at olddomain.com and tells any request coming in to that domain to swap olddomain.com out and replace it with newdomain.com. This includes ANYTHING after the trailing slash, like a direct link to a previous post. So http://olddomain.com/this/direct/link gets sent properly to http://newdomain.com/this/direct/link
The important part is the [R=301] which sends a 301 (Permanent) Redirect header.
That tells search engines that the page ha...
Some websites validate some bits and pieces but fail in other cases assuming that user will not pass anything strange there.
French OS Con website is and example of that XSS security risk.
If you go to this wage:
You will see there is a link go back to previous post. Unfortunately this post's id is take straight from the requested URL (GET parameter) without any cast or validation. It is an common case of XSS errors where page number, date or id is passed around in links and it is n...
How to install ImageMagick from YUM repository
The easiest way to install ImageMagick extension is to install it from yum repository:
1) Run “yum search imagick” command to check if ImageMagick extension is available in your repositories.
If you get the line below – ImageMagick extension is available in your repository and you can install it using “yum install” command
2) Run “yum install php-pecl-imagick” to install ImageMagick extension.
3) Restart Apache webserver.
One of the latest (sort of) crazes sweeping the net is APIs, more specifically those that leverage REST. It’s really no surprise either, as consuming REST APIs is so incredibly easy… in any language. It’s also incredibly easy to create them as you essentially use nothing more than an HTTP spec that has existed for ages. One of the few things that I give Rails credit for is its well thought-out REST support, both for providing and consuming these APIs (as its been explained by all the R...
Stop Words are words which do not contain important significance to be used in Search Queries. Usually these words are filtered out from search queries because they return vast amount of unnecessary information. A better definition is provided below:
“Words that do not appear in the index in a particular database because they are either insignificant (i.e., articles, prepositions) or so common that the results would be higher than the system can handle (as in the case of IUCAT where terms suc...
1. Functions with Arbitrary Number of Arguments
You may already know that PHP allows you to define functions with optional arguments. But there is also a method for allowing completely arbitrary number of function arguments.
First, here is an example with just optional arguments:
Now, let’s see how we can build a function that accepts any number of arguments. This time we are going to utilize func_get_args():
2. Using Glob() to Find Files
Many PHP functions have long and des...
Thank you for taking the time to visit my blog! Take a second to peek around and check out some of my previous posts. Of course, I would love to find out what you think as well, so make sure to comment. See you around!