php

PHP - How can I lookup the Zip Code using the City & State

I need to lookup the Zip Code for a list of addresses (which include the city/state). Is there a master zip code list for download (that is free) or are there any web services that will return the full postage info for an address. Ie, lookup query: 386 Bread & Cheese Hollow Rd, Northport, NY ====> 386 Bread And Cheese Hollow Rd, Northpo...

PHP MYSQL to XML - Efficient File Generation

Hi there, I run a price comparison data engine, and as we are collecting so much data im running into pretty serious performance issues. We generate various XML files, one per product and within the product data is each Online shop we grab data from, with their price, link, description, etc. We have multiple feed parsers/scrapers which ...

How can I render a web page on the server (no GUI) for printing?

I'm trying to print pages pragmatically with a PHP script, to an office printer. Here's what I've got so far: I have a printer installed on the server, and I can send jobs to it with PHP via the command line's print command. I can also write plain text files with my PHP script, and then add them to the print cue. So printing PHP genera...

Parsing SQLite3 in PHP

I've got an SQLite3 file which I'd like to parse using PHP, but I'd rather not have to go to the trouble of loading it into a database which I'd first have to install on my server. Is there any library or function in PHP which allows for the direct parsing of SQLite3 from text or a file? ...

Special HTML characters in phpDocumentor in the NetBeans IDE

As you know the NetBeans IDE will pop you inline documentation in your PHP sources based on the phpDocumentor syntax. What I found out is that when I use special HTML characters in my phpDocumentor documentation they are treated as HTML in NetBeans but as text in the HTMl doc generated by phpDocumentor. For example: /** * Add a new &...

How to make a class property private in PHP4?

in PHP4 there is no public,private,etc. So I am wondering if there is some sort of work-around so that I can make a class's property private and only accessible via getter/setter Thanks!! ...

php, the HTTP_REFERER not found..

Hi im trying to connect to integrate my form to a payment provider but im getting URL not allowed and it turns out that the HTTP_REFERER is not found.. #the following function performs a HTTP Post and returns the whole response function pullpage( $host, $usepath, $postdata = "" ) { # open socket to filehandle(epdq encryption cgi) $fp ...

global php class in functions?

Hi, is there a way to access one instance of a class inside functions in php? like this: include("class.php"); $bla=new Classname(); function aaa(){ $bla->DoSomething(); //Doesnt Work } $bla->DoSomething(); //works. thanks! ...

How to implement a Symfony form with a many-to-many relationship?

Hi, I have three tables forming a many-to-many relationship. They are, WebUserRole -> WebUserRolePermission <- WebUserPermission I've just started doing the admin for my WebUserRole object (using the propel:generate-admin), and I want the form for the WebUserRole to list the permissions with a check box next to each. Now, is there a...

Is it wrong to transform/unserialize xml to an array to interface with it?

Consider a SOAP response with lots of nodes, I've noticed some developers using a PEAR Unserialize class while I've always been using simple_xml. Are there any disadvantages to interfacing if you aren't really doing any XML transformation or rendering but simply using data from it. ...

Computing Trending Topics

Let's say I'm collecting tweets from twitter based on a variety of criteria and storing these tweets in a local mysql database. I want to be able to computer trending topics, like twitter, that can be anywhere from 1-3 words in length. Is it possible to write a script to do something like this PHP and mysql? I've found answering on ho...

proper place of Configuration::load() in CakePHP

I wish to load some global defaults in my CakePHP application. E.g. app/config/defaults.php $config['site']['name']='FooBar'; $config['secuity']['somelimit']=-1; I'm going to use (Configuration::read()) these values across various classes not just in a single controller. Where is the proper place to call Configuration::load('defaults...

Codeigniter Shared Resources - Opinions Wanted

I run multiple websites all running off of a single installation of CodeIgniter on my server (separate application directories and a single system directory). This has been working fabulously and I don't see any reason to change it at this point. I find myself writing library classes to extend/override CI all of the time and many times...

multiple sessions are opened for one visitor

Hi, LAMP test server - only I am visiting it: I have a website and for some reason I get multiple sessions per user (browser). I am browsing the page with one browser only and I get 5-6-7-8 session files in /tmp. What can be the reason for it? Sessions are simple file based sessions. I noticed that I get multiple sessions when I upda...

Creating directories from filename?

Hi! I'm creating website that handles "great amount" of images. I have decided to use multiple directories method for storing files eg. images/efg/ed/ehj/efgedehjokjvdf2jn4.jpg I'm thinking that to prevent filename duplication is to take current timedate + some random string + md5 those = nice line of random string. Mostly I'm wonderin...

how to keep last n number of line from log file in php

hi i want to delete all lines from old log files and keep fresh 50 lines which is at the bottom plz give me the php code do something like this and if possible can we change the orientation of these lines normal input 111111 2222222 3333333 44444444 5555555 output like 555555 4444444 3333333 22222 111111 to see the fresh log at ...

What does "zend_mm_heap corrupted" mean

All of the sudden I've been having problems with my application that I've never had before. I decided to check the Apache's error log, and I found an error message saying "zend_mm_heap corrupted". What does this mean. OS: Fedora Core 8 Apache: 2.2.9 PHP: 5.2.6 ...

PHP sending HTML to JS

I have a div on the page where the contents change depending on the value selected in a drop down. Because there is a large amount of formatted content in this div I want to have a php script supply html which is stored in a file on the system. I can't seam to figure out how to have php return the contents of that file, which essentiall...

trying to use SOUNDEX in query but getting an error in terms of database columns in mysql...

Hi, Trying to figure out what went wrong, must be a silly syntax. $objDatabase = QApplication::$Database[1]; $strQuery = 'UPDATE `account` SET `sndx`=SOUNDEX("'.$objAccount->Name.'") WHERE `Id`='.$aid; $objDbResult = $objDatabase->Query($strQuery); The error I get is: MySqli Error: Unknown column 'sndx' in 'field list' Exception Typ...

Doctrine nestedset delete

Hi there, I have some models witch are using Doctrine nestedset feature. I want to add delete functionaly of elements from tree since that is required in my application. I was trying with snippets from documentation but I am getting a very strange error with that code. YAML is here: http://pastie.org/820978 And I am trying with this c...