php

function explanation in php

Hi i have one function but i am not getting what is it doing. Below is my function // My function gets two parameters lat and long public function generate_peano1($lat, $lon) { $lat = (($lat + 90.0)/180.0 * 32767) + 16384; $lon = ($lon + 180.0)/360.0 * 65535; $lat_16 = $lat&0x0000FFFF; // Not getting what is here. $...

php postgresql connection

Hi i couldnt solve the above below error.. somebody please help me.. when i was trying to connect with postgresql using pg_connect(), it says that "Fatal error.. call to undefined function pg_connect..". please help me.... Thanks & regards Tismon Varghese ...

PHP mailer error

I tried to use php mailer but errors as follows. SMTP -> FROM SERVER: SMTP -> FROM SERVER: SMTP -> ERROR: EHLO not accepted from server: SMTP -> FROM SERVER: SMTP -> ERROR: HELO not accepted from server: SMTP -> ERROR: AUTH not accepted from server: SMTP -> NOTICE: EOF caught while checking if connectedSMTP Error: Could not authenticate...

How to show the outcome of joomla menu item type as a module?

I am not sure how to put it ... but I am using certain modules in my joomla site which can be shown only using a menu item e.g. Phoca gallery, hwdvideoshare etc. These modules can not be displayed on any specific position, instead a menu item has to be created which links to these modules and shows them according to the configuration par...

php & filesystem +setUID/permissions ... i just don't get it!

i have to admit, i never really completely got the *nix filesystem permission model. oh, the rwxrwxrwx stuff isn't too complicated, but i get confused easily when programs create new files and how i can handle them. my current problem is the mixture of a (closed source) java-applet that does file uploads over ftp and php (it's on a ded...

Extracting gettext translations from PHP heredoc syntax?

I'm using PHP's gettext functions for doing localization. I'm using Poedit to do the actual translation, and with its "Update from sources" feature it is really easy to extract all the strings that need to be translated - except from inside heredoc syntax. Poedit is using the xgettext program to generate the .po files from the PHP sourc...

Is it possible to download something to a default local dir quietly using a server side script?

I need to download something from server to local machine just by a visiting an url without any popup-window,using something like php or python.But cannot find a good solution.Is it possible or not?Hope someone can help me. ...

Simplest way to get a complete list of all the UTF-8 whitespace characters in PHP

In PHP, what's the most elegant way to get the complete list (array of strings) of all the Unicode whitespace characters, encoded in utf8? I need that to generate test data. ...

What's the best database structure to keep multilingual data?

Here's an example: [ products ] id (INT) name-en_us (VARCHAR) name-es_es (VARCHAR) name-pt_br (VARCHAR) description-en_us (VARCHAR) description-es_es (VARCHAR) description-pt_br (VARCHAR) price (DECIMAL) The problem: every new language will need modify the table structure. Here's another example: [ products-en_us ] id (INT) name (VA...

Wrapping a text using php, based on language

Hi! My problem is that I have quite a small area (div or span), in which one to about five words are displayed. However, the area is too small for some words (for instance "muziekgeschiedenis" will surpass the area's bounds). Is there a way in PHP to wrap this word, but not solely based on number of characters? I can use wordwrap(), or ...

How do I pretty print an XSLT result document with removed source elements?

I have a source XHTML document with elements in multiple namespaces that I am transforming into an HTML document (obviously with no namespaces). In my XSL templates I only match elements in the XHTML namespace to remove non-HTML-compatible elements from the result tree. However, in the output, while those elements are gone, the whitespac...

which is the best site for learning more on php

hi i am using php for a while but....... i think i need to improve on my skills ....since i have problem in troublesooting so i am searching for a article site which can make me comfortable working on the language.....what is the solution to develope my skills ...

Decimal validation + PHP ?

How to do decimal number validation in PHP? :) (The decimal point is optional) it should accept ... 0 , 1 , 2 , 0.123 , 0.2 , 12.34 etc. ...

Possible to 'Show MySQL Variables' with PHP code onto the browser?

Is this possible: mysql_query("SHOW VARIABLES LIKE 'query%'"); in php? If so how can I display the variables onto the browser? If it is not possible, which mysql command tool is easiest and free to download? Thanks ...

How to use regular expression in json(PHP) ?

Hello, Now i have a json code like this: {"1": { "text":"e1", "children": { "1": { "text":"e1_site1", "children": {"1":"e1_site1_salarie1_nom"} }, "3": { "text":"e1_site2", "children": ...

How to clear APC cache without crashing Apache?

If APC stores a lot of entries, clearing them crashes httpd. *If apc_clear_cache('user') takes longer than phps max_execution_time the script calling apc_clear_cache will be terminated by php before the clearing-operation is finished. this seems to leave some handles or sth. that will prevent apache from closing it's proc...

Wordpress - need different number of posts on page 1 versus page 2 of category

hi, i'm tearing my hair out with this Wordpress problem. in a category section, i'm trying to display 5 posts on the first page and then the default number of posts (set to 6) on the 2nd and subsequent pages. i've tried using query_posts('posts_per_page=5') on the first page but then the 2nd page displays posts 7 to 12 instead of posts ...

Get MySql result-set size from query using PHP

Is it possible to get the size of the result-set when doing a query? I need to set a proper MySql cache_limit (MB) and therefore I am trying out some queries, but I need to know the sizes of the result-sets to fine-tune my cache configurations. What exactly does query_cache_limit do when measuring the size of a query (or result)... An...

seeking basic understanding of implementing Xmpp in PHP applications --

I am new to xmpp and need to understand its basics for integrating it with my php application. I have set up Openfire server and want to use my preexisting mysql database to get the users. So as per the docs, i modified Openfires config xml file to add the database Auth and User settings. Also the Xmpphp lib seems to be the right lib...

Mysqli giving me problems: Warning: mysqli_stmt_bind_param() expects parameter 1 to be mysqli_stmt, boolean given in

I know that this code works on another site i've got but it's not playing ball today. I get three warnings: Warning: mysqli_stmt_bind_param() expects parameter 1 to be mysqli_stmt, boolean given in /homepages/14/d248783986/htdocs/subdomains/clients.bionic-comms.co.uk/httpdocs/carefree/process.php on line 33 Warning: mysqli_exec...