June 12, 2014
Hey reader, you really need to see this PHP meta robots parser? So damn easy, now lets get our hands dirty ;). Am writing a function that interprets the meta robots which receives arguments of strings (e.g noindex,nofollow), you can grab this with the get_meta_tags() function then let me start the function to parse this.
June 9, 2014
I was on a project that an SMS is required to be sent to a subscriber which must be a Nigerian Mobile Number in other to manage their SMS Units, that is what led me into writing a function to validate Nigerian phone numbers.
May 30, 2014
That moment you turn on your system which is currently running in Windows then you are unable to connect to http://localhost/phpmyadmin, you try starting your MySQL server but seeing this message MySQL shutdown unexpectedly.
May 20, 2014
Yea, am not that a WordPress fan or a good user but few months ago I was working with it and it was really cool, mainly I love working with backend so I decided to use some features of WordPress which led me into reading bulks of their docs and finally gave me something. Well, […]
April 25, 2014
Its a year now when I was still a cool newbie in PHP thought am not yet expert now 🙂 I was coding something like a forum where users can post and other users can read and comment. I hosted the project and something just hit my head “What if a user posts <script>alert(‘hello’)</script> will […]
April 14, 2014
One of my latest project I worked on was where I decided to use a feature that I saw in SMF Coding, that values are stored in a MySQL Database Column separated with Commas. Though I don’t know how to retrieve these values as at that moment but I was sure it will make my […]
April 3, 2014
Fetching out proxy users and exposing their real IP is what I really enjoy, I remember using Google Search in Opera Mini Mobile which uses its proxy to forward. But to my suprise, it got to know am in Nigeria and redirect me to .com.ng 😀 . So glad to find out PHP doing this, […]
February 14, 2014
Query not your database too much and leave it to rest, which will absolutely make your page load as fast as a local html file in your PC WHAT IS CACHING? This is the act of storing a data for future retrieval in a faster way. WHERE IS CACHING NEEDED? Well, I should say when […]
December 19, 2013
Hello there, was just surfing on PHP functions in their site and came accross this function and it works great! Though I don’t even know how the Easter is been calculated Below is the script, copy it to a PHP file and save or download the attachment: <?php function check_easter($year) { $y = getdate(easter_date($year)); if($year<date(‘Y’)) { $word = ‘was’; } else { $word = ‘is’; […]
November 15, 2013
Hi there, below is a little snippet of what using Proxy in PHP cURL
|
<pre><br /><span style="background: #ffffe8; color: #5f5035;"><?php</span><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: #797997;">$loginpassw</span><span style="background: #ffffe8; color: black;"> </span><br /><span style="background: #ffffe8; color: #808030;">=</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: #0000e6;">''</span><span style="background: #ffffe8; color: purple;">;</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: dimgrey;">//your proxy login and password here if any</span><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: #797997;">$proxy_ip</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: #808030;">=</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: #0000e6;">'202.148.22.171'</span><span style="background: #ffffe8; color: purple;">;</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: dimgrey;">//proxy IP here</span><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: #797997;">$proxy_port</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: #808030;">=</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: #008c00;">80</span><span style="background: #ffffe8; color: purple;">;</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: dimgrey;">//proxy port from your proxy list</span><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: #797997;">$url</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: #808030;">=</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: #0000e6;">''</span><span style="background: #ffffe8; color: purple;">;</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: dimgrey;">//URL to get</span><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: dimgrey;">//Lets initiate cURL</span><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: #797997;">$ch</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: #808030;">=</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: #400000;">curl_init</span><span style="background: #ffffe8; color: #808030;">(</span><span style="background: #ffffe8; color: #808030;">)</span><span style="background: #ffffe8; color: purple;">;</span><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: dimgrey;">//Some useful things we need for it to work</span><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: #400000;">curl_setopt</span><span style="background: #ffffe8; color: #808030;">(</span><span style="background: #ffffe8; color: #797997;">$ch</span><span style="background: #ffffe8; color: #808030;">,</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: #7d0045;">CURLOPT_URL</span><span style="background: #ffffe8; color: #808030;">,</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: #797997;">$url</span><span style="background: #ffffe8; color: #808030;">)</span><span style="background: #ffffe8; color: purple;">;</span><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: #400000;">curl_setopt</span><span style="background: #ffffe8; color: #808030;">(</span><span style="background: #ffffe8; color: #797997;">$ch</span><span style="background: #ffffe8; color: #808030;">,</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: #7d0045;">CURLOPT_HEADER</span><span style="background: #ffffe8; color: #808030;">,</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: #008c00;">0</span><span style="background: #ffffe8; color: #808030;">)</span><span style="background: #ffffe8; color: purple;">;</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: dimgrey;">// no headers in the output</span><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: #400000;">curl_setopt</span><span style="background: #ffffe8; color: #808030;">(</span><span style="background: #ffffe8; color: #797997;">$ch</span><span style="background: #ffffe8; color: #808030;">,</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: #7d0045;">CURLOPT_RETURNTRANSFER</span><span style="background: #ffffe8; color: #808030;">,</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: #008c00;">1</span><span style="background: #ffffe8; color: #808030;">)</span><span style="background: #ffffe8; color: purple;">;</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: dimgrey;">// output to variable</span><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: #400000;">curl_setopt</span><span style="background: #ffffe8; color: #808030;">(</span><span style="background: #ffffe8; color: #797997;">$ch</span><span style="background: #ffffe8; color: #808030;">,</span><span style="background: #ffffe8; color: black;"> CURLOPT_PROXYPORT</span><span style="background: #ffffe8; color: #808030;">,</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: #797997;">$proxy_port</span><span style="background: #ffffe8; color: #808030;">)</span><span style="background: #ffffe8; color: purple;">;</span><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: #400000;">curl_setopt</span><span style="background: #ffffe8; color: #808030;">(</span><span style="background: #ffffe8; color: #797997;">$ch</span><span style="background: #ffffe8; color: #808030;">,</span><span style="background: #ffffe8; color: black;"> CURLOPT_PROXYTYPE</span><span style="background: #ffffe8; color: #808030;">,</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: #0000e6;">'HTTP'</span><span style="background: #ffffe8; color: #808030;">)</span><span style="background: #ffffe8; color: purple;">;</span><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: #400000;">curl_setopt</span><span style="background: #ffffe8; color: #808030;">(</span><span style="background: #ffffe8; color: #797997;">$ch</span><span style="background: #ffffe8; color: #808030;">,</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: #7d0045;">CURLOPT_PROXY</span><span style="background: #ffffe8; color: #808030;">,</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: #797997;">$proxy_ip</span><span style="background: #ffffe8; color: #808030;">)</span><span style="background: #ffffe8; color: purple;">;</span><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: dimgrey;">//Gather up every result in a variable</span><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: #797997;">$data</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: #808030;">=</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: #400000;">curl_exec</span><span style="background: #ffffe8; color: #808030;">(</span><span style="background: #ffffe8; color: #797997;">$ch</span><span style="background: #ffffe8; color: #808030;">)</span><span style="background: #ffffe8; color: purple;">;</span><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: dimgrey;">//We are done, lets close connection</span><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: #400000;">curl_close</span><span style="background: #ffffe8; color: #808030;">(</span><span style="background: #ffffe8; color: #797997;">$ch</span><span style="background: #ffffe8; color: #808030;">)</span><span style="background: #ffffe8; color: purple;">;</span><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: dimgrey;">//Show up your result</span><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: maroon; font-weight: bold;">echo</span><span style="background: #ffffe8; color: black;"> </span><span style="background: #ffffe8; color: #797997;">$data</span><span style="background: #ffffe8; color: purple;">;</span><span style="background: #ffffe8; color: black;"></span><br /><span style="background: #ffffe8; color: #5f5035;">?></span><br /> |