prosoxi.com | Tag Archive | PHP

Tag Archive | "PHP"

i18n gettext in PHP


gettext is the GNU internationalization and localization (i18n) library. It is commonly used for writing multilingual programs. It has an implementation in a lot of different languages and it’s also commonly used in PHP applications.

Read the full story

Posted in PHPComments (0)

stdClass in PHP


stdClass is php’s generic empty class, kind of like Object in Java or object in Python (Edit: but not actually

Read the full story

Posted in PHPComments (0)

Version Control with Git


Have you ever worked on a project that was so unwieldy, you were scared to update a file or add a feature? Maybe the problem was that you weren’t using a version control system. In today’s tutorial, we’ll learn the basics of what might possibly be the best VCS in the world: Git.

1330615720_3967622daac5c4973b7adabeba702823

Read the full story

Posted in PHPComments (0)

Install and Develop with Memcached


Your latest PHP/MySQL website is finally online. And it’s awesome. But it’s not as fast as you want it to be, because of the many SQL queries running every time a page is generated. And above that, you have the feeling it will not scale well under heavy loads. And you are most likely right.

Read the full story

Posted in Linux, PHPComments (0)

PHP prosoxi fucntions


Prosoxi.com php functions!

Read the full story

Posted in PHPComments (0)

PHP $_POST Array Empty


Fellow PHP programmers, I encountered a most peculiar problem today that I must share. I had a situation where someone was sending me POST data but the PHP $_POST array was empty. I setup a debugging script to see the GET and POST arrays and sure enough everything was empty. I asked my friend Google and found a neat way to get the raw incoming message using PHP:

$data = file_get_contents('php://input');

That convinced me that they were in fact sending me what looked like POST data but for some reason the PHP $_POST array was still empty. Long story short, what I discovered and hopefully what will save someone out there some time, is that if the Content-Type is empty or not recognized in the HTTP message then the PHP $_POST array is empty. Not sure if this is a bug or is by design…

Anyway if the guy on the other end can’t figure out how to send a properly formatted HTTP message, you can force the Content-Type as a last resort using something like this above where you want to access the $_POST array:

if(empty($_SERVER['CONTENT_TYPE'])){   $type = "application/x-www-form-urlencoded";   $_SERVER['CONTENT_TYPE'] = $type;   }

 

<?php

if ($_SERVER['REQUEST_METHOD'] == 'POST'){    echo '<pre>',print_r($_POST, TRUE),'</pre><br /><br /><br />';}

?>

<form method="post" action="">    <input type="hidden" name="test1" value="one" />    <input type="hidden" name="test2" value="two" />    <input type="hidden" name="test3" value="three" />    <input type="submit" value="Test Me" /></form>

Source

http://www.bradino.com/php/empty-post-array/

http://stackoverflow.com/questions/1282909/php-post-array-empty-upon-form-submission

Posted in PHPComments (0)

jquery upload plugins


Uploading files without refreshing page looks nice and even simple. With the help of ajax and jquery one can achieve this. Today I have collected 7 ajax file upload plugins which are cool and easy to integrate.

Read the full story

Posted in JavaScript - AjaxComments (0)

PHP Array Operators


Array Operators

The + operator returns the right-hand array appended to the left-hand array; for keys that exist in both arrays, the elements from the left-hand array will be used, and the matching elements from the right-hand array will be ignored.

Read the full story

Posted in PHPComments (0)

Php regular expression to match a div


Use an HTML parser. NOT regular expressions.

The problem with regular expressions is that they cannot match nested structures. Assuming your regex must match a single <div> and its closing tag, there is no way to correctly match this input:

Read the full story

Posted in PHPComments (0)

PHP-MySql: Select previous row and next row from current ID


During the dark age, the simplest way to get previous row from current ID was using this query:

Read the full story

Posted in PHPComments (0)

PHP ftp upload tutorial


To upload a file to ftp you need a html form where you can insert the ftp details, like the ones described above:

Read the full story

Posted in PHPComments (0)

Prevent Duplicate Form Submission


You can use the method below to prevent duplicate form submission or form re-submission using PHP. This method is simple to implement and does not require JavaScript.

Read the full story

Posted in PHPComments (0)

PHP 5.4 Features


PHP 5.4 Features

PHP 5.4

PHP 5.4.0 is planned to be released on February, 2 2012. By the time you are reading this, it may already been out. It is a result of many months of development.

Read the full story

Posted in News, PHPComments (0)

php gettext


gettext — Lookup a message in the current domain

Read the full story

Posted in PHPComments (0)

Encode your images straight into PHP


Came across this today messing around with WAMP server. The index page it has has some images. I was looking to replace them as i was feeling lazy about creating an Index page

Read the full story

Posted in PHPComments (0)

How to Scrape Meta Tags From Any Web Page With PHP


A couple of weeks ago I was going to work on a new project, it was a directory-like kind of app. One the things this application had to do was let users add their websites to their profiles, and so the first question came up, “how am going to get their website’s title and meta tags?”.

Read the full story

Posted in PHPComments (0)

Domain Name Finder, Lookup, Whois

Domain Finder Tool by Truste.gr

read more for domains

Advertise

Sponsors

Wedstar all about wedding - gamos - γαμος
Κατασκευή ιστοσελίδων
Domain Names | Hosting