php

Can Zend_Service_Rest do file uploads?

I assume that RESTful services is a comprehensive paradigm, that it also could cover file uploads too, as a subset of http operations. If so, how does one do file uploads in Rest and specifically, with Zend_Service_Rest? Should my client code somehow read the file and assign its content to some property of restful object? Or there is a...

PHP DomDocument XML Load with Broken XML Data

Hi, How do you deal with broken data in XML files? For example, if I had <text>Some &improper; text here.</text> I'm trying to do: $doc = new DOMDocument(); $doc->validateOnParse = false; $doc->formatOutput = false; $doc->load(...xml'); and it fails miserably, because there's an unknown entity. Note, I can't use CDATA due to t...

Accessing Zend Session data between actions

Hi. Here's my problem - I'm trying to access a session namespace across actions. The ZF examples appear to work by generating NEW namespaces, but they only demonstrate this within one action - but how do I access an existing namespace from a separate action? Here's the code: public function indexAction(){ $defaultNamespace = new Ze...

lightweight RESTful PHP server

I want to write an extremely lightweight PHP server which handles data requests from remote clients. The data returned is tabular (like that of data read from a CSV file or a database table). The "problem" is that I could be returning potentially several hundred thousand rows of data - with a column width of between 10 - 15 (depending on...

Problem with Custom Error Handler.

Please refer my previous post here. I did changes accordingly but getting error. Please help me figure out the errors in this code. My IDE (Aptana) is giving red underlines on many lines of this code: <?php /* Include dependency */ require_once("./Config/dbconfig.php"); abstract class dbconnection { var $conn; try { ...

Splitting 20 million record database

I have a US company database which is 20 millions records. Firstly they is no budget for a massive RAM database server. So I think I am going to have to split the db into parts, 4 parts grouped by State. My question is how is the best way to handle this with PHP, I am thinking get the users query find the State and then point to the r...

PHP Doctrine Inheritance

Hi, I'm reading through the Doctrine documentation but I can't find a way to implement the type of inheritance I want to use. I would like to set up a hierarchy like so: Node -> Something -> Something Else With Node being the main parent. I would like to store data common to everything in a node table, eg date of creation, update e...

dates from and to

Hi I have already asked a similar question. but want to make a change like this: I have a starting date and ending date called into a function in php. I need to estrapolate the stating day and month form the startingDate and the same for the endingDate, so to make calculation based on day and month. How do I go about this? Thank you th...

How should I stress test my web application?

I've got a somewhat complex web application, containing Flash and javascript on the client side and PHP functionality server side. The PHP functionality contains system calls (exec()) to merge/edit/create files with gnu software (*nix environment) as well as api calls to REST services for uploading these files (this will be done with cro...

open source credit card payement gateway

I have been for some advices about credit cards processing gateways on stakeoverflow where i found an answer that suggested using an open source gateway processing library but I have bookmarked or any thing and now I don't seem to find it, So i am asking the question again : can any body point me to an open source credit card processing...

Searching for availability with MySQL (and PHP) ?

I have two MySQL (MyIsAm) tables that represent letting units and bookings: LettingUnits (ID, Name, etc...) LettingUnitBookings (ID, F_LU_ID, Start, End) Where F_LU_ID is a foreign key to the unit. What is the best way to search for units that are available during a certain time frame? The search is passed a Start, End and Duration....

How to select a users specific info from a MySQL database?

I was wondering how can I have my users pick their favorite food from a category of foods in my MySQL database. Will I need two different tables? If so what will my second table look like? Here is my MySQL food table structure. id | parent_id | food | url ...

Flash coding problem

Hello I recieve the information from php script to flash. And flash display it as: Radioart=Mia Frejman - Ett hjärta - Ett Hjärta The string contain some swedish symbols. How I can normally output it? best Vladimir ...

How to update some part of the webpage?

I would like to update (change the content) some part of the webpage without updating the whole page (without refreshing the page). Of course first thing you would write as an answer will be "Ajax!!!", but I know that search engines will not be able to get the content of that part if I do with Ajax. So is there any method or workaround ...

PHP - what is the function to turn $ sign to %24 or any other special character?

htmlspecialchars won't do it and neither does htmlentities. ...

Multi-dimensional array keys - strange behaviour

I am using a multi-dimensional associative array to keep track of monthly totals, then I want to loop through it using foreach and output the contents. The totals for each inner array are kept in element 12, and only want each array to output if the total is > 0, except "Total", which I want to output even if it is 0. foreach($years...

WordPress Theme variables scope

I need to create a variable that can be accessed throughout my WordPress Theme template files (index.php, header.php etc..). I know function definitions go inside the functions.php template file (in your theme path), but there's no such thing for variables. For example I constantly need to retrieve Categories in my Theme, so I would li...

Encryption: how to have 1 iv despite multiple fields

I've been stuck trying to arrive at a best solution for this for a while. I know that an initialization vector has to be unique for each item being encrypted. So if I'm encrypting an address and I have it stored all in a single field, I need a single iv for this. But if I have the address spread over multiple fields, I need several ivs, ...

Cannot get Photo in RETS(REAL ESTATE TRANSACTION SYSTEM) using PHRETS class

I am using PHREST class for getting photo from RETS Server I can get its city,state,zip and price but I am not able to get images of property for that I am using below function $photos = $rets->GetObject("Property","Photo","05-020123:CLAW",1); print_r($photos); and here I am passed "05-020123:CLAW" this is UniqueID which I get from s...

Tagging with Zend Framework

I'm trying to create the same solutions as below, but using a simple MySQL query (instead of the static version used below where the words/tags are implemented in the code). The name of the MySQL table is "tags" and it has 2 columns "id" & "tag". Unfortunately I'm a beginner and I wasn't able to solve this. Can someone help me? /* Zend...