Here’s a quick piece of code that i find useful to check if a request that comes to a PHP page was made via an Ajax call or a simple form post. This method uses the $_SERVER[‘HTTP_X_REQUESTED_WITH’] request to determine if data was sent to a specific page using an xmlhttprequest. It’s worth bearing in …
Category Archives: PHP
output_add_rewrite_var
This function adds another name/value pair to the URL rewrite mechanism. The name and value will be added to URLs (as GET parameter) and forms (as hidden input fields) the same way as the session ID when transparent URL rewriting is enabled with session.use_trans_sid. Please note that absolute URLs (http://example.com/..) aren’t rewritten.
PHP Form Handling
If your PHP program is a dynamic web page (and it probably is) and your PHP program is dealing with user input (and it probably is), then you need to work with HTML forms. Here are some tips for simplifying, securing, and organizing your form-handling PHP code.
Favorite Libraries
my favorite php and js librarys
Useful WordPress SQL Queries You Wish You Knew Earlier
WordPress is driven by a MySQL database. This is something active WordPress users would know. However, if you only just read about it here from us, here’s what you should know. MySQL is a free relational database management system available in most web hosting services. All of the WordPress data like the posts, comments, categories, …
Continue reading “Useful WordPress SQL Queries You Wish You Knew Earlier”
PHP and cURL snippets
cURL, and its PHP extension libcURL, are very useful tools for tasks like simulating a web browser, submit forms or login to a web service. In this article, I’m going to show you some amazing things that you can do using PHP and cURL.