php

Send photo to email bot, upload photo to website

Hi all, I am constantly taking the following steps, and I know there's a way to automate this: emailing photos from my phone to myself saving those photos to my computer uploading the saved photos to a website Is there a way to write a script (perhaps in PHP), that does the following: listens to any emails sent with attachments to...

Is it better to externalize object creation from XML or to do it from the constructor?

Hi I have some PHP classes I am creating from XML config. What I would like to know is this: Am I better off (from an object-oriented standpoint) having factory methods to create those classes from XML or passing in XML to the constructor to create the classes? The factory approach has the advantage of separating construction from usa...

I made an upload script in PHP. How do I avoid overwriting files?

I've made an image upload script using the move_uploaded_file function. This function seems to overwrite any preexisting file with the new one. So, I need to check if the target location already has a file. If it does then I need to append something to the filename(before the extension so that the file name is still valid) so the filenam...

Popular open source projects using Zend Framework

Hello, I am trying to find any open source project based on Zend Framework. Something well written and as popular as Wordpress or Drupal to see actual benefits of ZF as well as possibly use it as an example. The only 'showcase' I managed to find is http://framework.zend.com/wiki/pages/viewpage.action?pageId=14134. But this list looks c...

Best practices for iterating over MASSIVE CSV files in PHP ...

Ok, I'll try and keep this short, sweet and to-the-point. We do massive GeoIP updates to our system by uploading a MASSIVE CSV file to our PHP-based CMS. This thing usually has more than 100k records of IP address information. Now, doing a simple import of this data isn't an issue at all, but we have to run checks against our current re...

target a specific page in iframe

hi, I'm running the CMS indexhibit, indexhibit uses an iframe to load it's content. http://www.therussianfrostfarmers.com/ My homepage has WordPress loaded into this iframe, which works ok, i've got some scrollbar issues, but that another problem. Currently, when ppl find a WP post through there search engine, the user is redirected t...

What's the best way to manage multiple media servers, and file allocations between them?

I have a file host website thats burning through 2gbit of bandwidth, so I need to start adding secondary media servers to store the files. What would be the best way to manage a multiple server setup, with a large amount of files? Preferably through php only. Currently, I only have around 100Gb of files... so I could get a 2nd server,...

How can I do this without breaking the MVC framework in CakePHP?

Sorry for what is a generic title. I'm not the best at titles. Anyway the way Cake passes around data (as a hash) is pretty much the reason why I even need to ask this question. If when I passed a variable/obj from the controller to the view, it was an object that I can ask questions to (i.e. $duck->quack() ) rather than having it be an...

Can a View in Kohana access it's parent View's variables?

This applies to Kohana 2.3.2 I've recently started making my Views more dynamic. Using the default template view as a base, now I am doing in the controller $this->template->innerView = new View('article'); Then, in the middle of my template.php, I have <?php echo $innerView; ?> To echo the 'guts' of the article view between my he...

MySql NOT NULL Constraint doesnot work

I am trying to implement NOT NULL constraint in the customer table which is created as: CREATE TABLE CUSTOMER( cust_id INT(5) NOT NULL AUTO_INCREMENT, PRIMARY KEY(cust_id), first_name VARCHAR(25) NOT NULL, last_name VARCHAR(25) NOT NULL, email VARCHAR(25) NOT NULL, password VARCHAR(25) NOT NULL, gende...

Adding many markers kills my google maps - how do I do this?

Hi guys, I'm stuck here again. I have a database with over 120 000 coordinates that I need to be displayed on a google maps integrated in my application. The thing is that and I've found out the hard way simply looping through all of the coordinates and creating an individual marker for each and adding it using the addOverlay function is...

Streaming video file?

Hi I need to stream flv file. streaming should look like live streaming. and I their should be a way to change target file. sorry for my poor English. ...

Sort PHP array?

I have the following? $array1 = array(); $array2 = array($Id, $Name, $Count); array_push($array1, $array2); I want to sort array1 on the $count? sort() and ksort() don't do what i require? Any ideas? Thanks Edit: I am inputing an Id number, name text and number of times the name occurs, so I want to to have the name with the hi...

Convert a Unix timestamp to time in Javascript

I am storing time in a MySQL database as a Unix timestamp and that gets sent to some Javascript, how would I get just the time out of it? Ex. HH/MM/SS ...

How to install PHP Module in IIS 7?

Please help me! ...

Google Maps using Marker CLusterer - map hangs !!! Why!

This is weird. I'm using the marker clusterer to bunch all my markers however the first time when the map renders and when I try to drag it or pan it - it hangs and firefox tells me the script is slowing it down so I have to stop the script. But if I zoom it out - it zooms normally and panning it from then on causes no issues - I have no...

Ensure a user-defined path is safe in PHP

I am implementing a simple directory listing script in PHP. I want to ensure that the passed path is safe before opening directory handles and echoing the results willy-nilly. $f = $_GET["f"]; if(! $f) { $f = "/"; } // make sure $f is safe $farr = explode("/",$f); $unsafe = false; foreach($farr as $farre) { // protect against d...

Beginning PHP development - programming stack recommendation and web site resources

I'm beginning PHP development, and I'm looking at picking brains for ideas and best practices, and also website resrouces, such as www.w3schools.com Yes, it has to be PHP as that's the existing website technology that's being used. I'm using Windows, although I'll be doing development on a Virtual Machine, maybe Virtual PC or Virtual B...

How do I get information from wikipedia into my application.

Hi guys I wish to get information for entries I have in my database from wikipedia like for example some stadiums and country information. I'm using Zend Framework and also how would I be able to handle queries that return multiple ambiguous entries or the like.. I would like all the help I can get here... ...

Storing settings, to edit later, in PHP

I am writing a PHP application that will have the ability to edit settings through a web interface. I didn't mean for the user (and actually, it will only be admins) to be able to load the file up in a text editor, but rather, they make a change using a form, and that will change the settings file (and do other things as well). At this ...