php

SimpleXML: Sort XML - Place XML Entries at the top

Im using SimpleXML to add new images childs for a slideshow tool on my website, the code is something like this: $xml_toload = $_SERVER['DOCUMENT_ROOT']. '/xml/'.$country.'/compact.xml'; $xml = simplexml_load_file($xml_toload); //This line will load the XML file. $sxe = new SimpleXMLElement($xml->asXML()); //In this line it create a S...

@ mentions on Facebook using Facebook Connect API

I am trying to do @ mentions on Facebook using either facebook.stream.publish or facebook.users.setStatus. You are able to do this on Facebook and I know its possible to do using 3rd party APIs as a "Twitter Sync" app currently supports it. So far I have tried using: @[fb_id], @:fb_id, @[fb_id:fb_name], @:[fb_id:fb_name] and @:[fb_id] ...

PHP framework question

I'm currently working on a browser-based MMO and have chosen the LAMP stack because of the extremely low cost to start with in production (versus Windows + IIS + ASP.NET/C# + SQL Server, even though I have MSDN Universal). However I will need a PHP framework for this as it's no easy task. I am not restricted by anything other than the ab...

PHP's real SESSION object

EDIT: (UPDATED) Maybe my question was not clear enough. Ok, lets put it this way: $arr["a"] = 10; var_dump($arr); $arr["b"] =& $arr["a"]; var_dump($arr); the first var_dump returns: array 'a' => int 10 While the second one returns: array 'a' => &int 10 'b' => &int 10 If I unset($arr["a"]) it will return: array 'b' => ...

Am I "doing it wrong" in Kohana 3?

When I have a controller, e.g. article I often have a action_view() that handles most of the code. Sometimes, it can become 80-100 lines long. My controller usually handles all of these: binding template variables setting sessions (where appropriate) sending emails validating forms I could see bit and pieces that I could make anoth...

PHP: The Reflection API - Great Addition To PHP With Little Use

Hello, Reflection API is great thing out there to manipulate the OOP stuff and looks like most of the developers aren't even aware of that or have never used that. Reflection API Claims: PHP 5 comes with a complete reflection API that adds the ability to reverse-engineer classes, interfaces, functions, methods and extensions....

htaccess mod_rewrite help

i have a domain with a website in a folder. i.e http://domain.com.au/website/page.php i only have access to .htaccess files to make the rules. i would like my url to look like this.. http://domain.com.au/page so in essence i want to drop the subfolder its sitting in, and the php extention. All links in my php are structured like thi...

How to simulate args inside a php file?

PHP file.php arg1 arg2 Now I want to hardcode arg1 and arg2 into file.php,how to do it? ...

how to send mails using phpmailer through yahoo SMTP?

Hi, i am using phpmailer to send mails it is working with gmail but when it comes to yahoo giving the following errors SMTP -> Error : Password not accepted from server : 530 access denied SMTP -> Error : RSET failed SMTP -> Error : Could not authenticate i am using the working yahoo account. Please give me a solution. Thanks in adva...

PHP and SimpleTest - running tearDown() even if there's a fatal exception

A search yields a couple of questions on catching fatal exceptions, but this one is specific to using SimpleTest. (I know that SimpleTest is out of date, but getting PHP-Unit to work on my configuration is another question). I am trying to get the tearDown() method to work even when there is a fatal exception, as I create some test rows...

How create an unique 20 single byte token/key/ID on php?

I need to create a token/key to use it as a number order, so this should be unique, the tokens must be something like "6X990742MG185953R" so we can use it like a barcode, e. http://barcodes4.me/barcode/c128b/6X990742MG185953R.png We can't use UUID or GUID because is to long, the much closer we are is this: function uuid64() { $uuid ...

pybabel or other l10n libraries for PHP

Babel or pybabel is an interface to the CLDR (Common Locale Data Repository) in Python. As such, it has the same 'knowledge' as PHP's i18n functions and classes (if the appropriate locales are installed on the host), but without the hassle of using process-wide settings like setlocale(). Is there a similar library or toolkit for PHP? Es...

Select pdf urls with jQuery

Hello, I want to select urls with pdf file extension and list the pdfs separately, using jQuery or PHP. Thanks Jean ...

Grouping array values in php.

Hello, I have an array with some value like this: [Organization_id] => Array ( [0] => 4 [1] => 4 [2] => 4 ) but i want some thing like this: [Organization_id] => Array ( [0] => 4 ) Thanks in advance.. ...

get statistics web pages in zend framework

whats the best way to get Statistics Web pages by the users visited ? anybody may explain how do we implement to get statistics web pages by the each users visited and the most page is visited? ...

html parsing error unable to modify the parent container element before the child element is closed

Is there anybody that can help me please? sorry my english... this is the php code that generate the error (only on Internet explorer 8, on firefox, opera and chrome working good): <!-- SHIPPING ADDRESS --> <h4 id='onCheckoutShipping'><?php echo JText::_("Indirizzo di spedizione") ?></h4> <?php $baseurl ...

How do I get the image and data from Amazon.com page using PHP?

How do I get the image and data from Amazon.com page using PHP? For example I put some product ISBN from Amazon.com to text field the press the button. It will show some data of product page such as product image, product name, product price. Have any idea or some tool for me? thank you ...

Installing PHP in windows - "php.exe" and "PHP SAPI" both should support pdo_mysql

We use Windows for our development systems. I am installing PHP, Apache, MySQL manually. All from zip packages. Now: If I use php thread safe binaries: pdo_mysql fails to load when executing php.exe from command line. I get the following warning: PHP Warning: PHP Startup: pdo_mysql: Unable to initialize module Module compiled with mod...

Open Source PHP Form Management System?

Hi, I've found an incredible Form Management System called Formdesk (http://www.formdesk.com). It is very powerful and flexible. However, I would like to know if there is an open source (preferably PHP/MySQL) alternative because there might be cases where I would need to modify the code. Basically, this is the process: An agent fills o...

add custom to mysql_fetch_assoc results array

Hello there - is it possible to add custom data to the results so it can be used the same as the $results being returned? ie i'd like to add a random number to the results; $recordSet = mysql_query($sql,$this->conn); $results = array(); while ($row = mysql_fetch_assoc($recordSet)){ $results[]=$row; /// add to results[] a custom...