php

trigger php function request when google maps marker is moved

When a marker is placed, I want to call a php function (in another file) with the latitude and longitude as input and output the result in a div on the page. So whenever the marker is moved, it updates the div with the latest result of the function. I know I'd need javascript to do this but I'm not very familiar with it and any help wou...

Recursing Properly

Hello, I have several navigation related functions which I would like to have no depth limits. These generate CSS menus, breadcrumb trails and the like. I am stumped as to how I would make the functions follow each path to depth or to root without explicit looping. The following is a typical example where I want the topmost parent of...

Where should i set my db object in my model ? (MVC)

I would like to know where is the best place to set my db object with my model. Should I hard coded it since my model should be designed for one project, so i set it inside my constructor or wherever i do initialization ? or Should I pass my db object to my constructor when instancing my object ? What is the best way, i mean from exper...

Get flv file with PHP for embedded swf control

So would like to do: get an flv file from a protected directory and feed it to a swf embedded player as a parameter using PHP. Is this possible? Sending the contents of the file to the embedded player does not seem to work. ...

PHP XPath explicit node...

I am trying to pull an exact table during a "web scrape." Used cURL to pull page into $html, which succeeds fine. Used Firebug to get exact XPATH to the table needed. Code follows: $dom = new DOMDocument($html); $dom->loadHTML($html); $xpath = new DOMXpath($dom); $summary = $xpath->evaluate('/html/body/table[5]/tbody/tr/td[3]/table/t...

How to access remote flash Shared Objects from php or java?

Are there any php (preferably) or java libraries that allow to retrieve remote flash shared objects? Something equal to: connection = new NetConnection(); connection.connect("rtmp://example.com/test"); var testdb_so = SharedObject.getRemote("testdb_so", connection.uri, true); ... Thanks. ...

MySQL Timestamp - why all zeros?

I'm using PHPMyAdmin and I've got a MySQL table column called "timestamp." The type (surprise!) is TIMESTAMP, and in 'attributes' I've set it to ON UPDATE CURRENT_TIMESTAMP. However, each new record gets a timestamp that looks like this: 0000-00-00 00:00:00 I have explicitly set the default value to none, but when I save and come bac...

Encrypt array as string

I'm looking for an two-way encryption algorithm to encode an array as a string, so that I can securely store some data in a cookie. The algorithm shouldn't just implode the array, I want it to be obfuscated too. My data contains all printable characters. A link to something would be sufficient, I just can't seem to dig anything up on Go...

Regular expression syntax In PHP to extract all instances of a format.

I am attempting to extract all instances of a particular format from a string: I am wondering if my new Sony [PT# 123456ABC; Sony] has this feature but my friend says the new Toshiba [PT# AD-3232hjk; Toshiba] has this feature. I would like to extract: [PT# 123456ABC; Sony] [PT# AD-3232hjk; Toshiba] As you can see here, t...

PHP SPL to manipulate recursive menu

I have a table in a database which has category data: id title parent 1 category 1 0 2 category 2 2 3 category 3 3 4 category 4 0 Eeach parent may have the parent row id. For example, category 3 is a child of category 2, which is child of category 1. category 1 category 2 category 3 category 4 ...

Active Record implementation of this SQL ?

I am using CodeIgniter. My database is MySQL 5. The SQL statement below works fine, but I am thinking it would not really be compatible with MSSQL, PG, et al. I am wondering if it's possible to implement the statement using the Active Record class in CI, hence making it completely cross database ? I think the "GROUP_CONCAT" is where I'l...

Choosing the right PHP framework

Hello guys, I want to start working on a project and this time around i want to make sure of a framework and see its like. i am having a little problem choosing a framework to work with. At the moment one of my motivations of using a framework is the MVC pattern. I know how useful it is. However, the framework i want to use must be an ...

How to use google map for my site?

Hi, I have tried to find the link or document to know how to use google map for my site. I am using php. I need code for this. Though I tried a lot to find, may be the way I tried was not correct. Can anybody suggest me the link where I can find the code for google map use. Thanks in advance......... ...

How do I turn tld.com/bures/oceanfront into tld.com/articles/view/bures/oceanfront in Kohana?

I'm using Kohana 2.3.2 Most, if not all, of the links on my site are to articles. My controller is called Articles, and I have a method titled View. I don't want to prefix all my links with /articles/view/, so I'd like to set a default controller to handle all files. I've looked into using a default router, which made tld.com use the ...

ASP.NET and PHP hosting

Hi, Can anyone suggest some of the best hosting companies that support both ASP.NET and PHP ? I've been considering http://www.webhost4life.com Thanks. ...

PHP Jabber Integration

Hello, I am wondering how to integrate jabber instead of using my AJAX polling script. I chanced upon the following: http://code.google.com/p/xmpphp/ It gives me access to a jabber server, but does not tell me how to exactly go about it. I mean for example $payloads = $conn->processUntil(array('message', 'presence', 'end_stream', 'se...

PHP: Sort an array by the length of its values?

I made an anagram machine and I have an array of positive matches. The trouble is they are all in a different order, I want to be able to sort the array so the longest array values appear first. Anybody have any ideas on how to do this? ...

Best way to store multiple question poll results on a per-user basis?

I have a poll that has five 1-5 star ratings and I need to store the values individually for each user. Is there a method similar to bitfields where I can store these enumerated values (1, 2, 3, 4, or 5 for each rating) and easily extract them? At the moment my best bet would be to store a serialized PHP array, however that would take u...

Is the way I have my admin panel set up good?

So basically, this is what I have. But is this a good practice? I started splitting up my admin.php file due to it growing in size. However, I have a slight concern over how many files I could potentially end up with, and also problems to work with in case something may need to be updated over all the files. ...

Handling unexisting actions?

Hi, What is the best way to handle unexisting actions in the Zend Framework? Depending on the controller I want to be able handle the request differently. BR Niklas ...