php5

Xcache var_size error

I am trying to use xcache with zend framework to cache the metadata from Zend_Db_Table_Abstract so that describe queries are only called once per table. When implementing xcache into my bootstrap and running the application, I am being presented with the following error: Warning: xcache_get() [function.xcache-get]: xcache.var_size is e...

Is it a good idea to use XML for formatting data in communication ?

Hi, I was going to use XML for communicating some data betwwen my server and the client, then I saw few articles saying using XML at any occation may not be the best idea. The reason given was using XML would increase the size of my message which is quite true, specially for me where nost of my messages are very short ones. Is it a good...

PHP: passing a function with parameters as parameter

Hey, I'm not sure that silly question, but I ask: So, if there is an anonymous function I can give it as another anonymous functions parameter, if it has been already stored a variable. But, whats in that case, if I have stored only one function in a variable, and add the second directly as a parameter into it? Can I add parameters to t...

Executing system command in PHP differs when using browser and when using command line

Hi, I have to execute a Linux more command in PHP from a particular offset, format the result and display the result in the browser. My code for the above is: <html> <head> <META HTTP-EQUIV=REFRESH CONTENT=10> <META HTTP-EQUIV=PRAGMA CONTENT=NO-CACHE> <title>Runtime Access log</title> </head> <body> <?php $moreCom...

[PHP] How do I convert a string "nine" to 9 ?

I know I can do that using switch(), but still I wanted to know if there's any PHP function for that. ...

Zend DB MYSQL Wrapper

All, I have a PHP application written in Zend Framework with MVC style. I plan to use Zend_DB to connect to the MySQL database and process queries. I am looking for a wrapper class which makes it easy to use Zend_DB class. This wrapper class will have a constructor that connects to the Mysql db using Zend_DB. It will also have a method ...

How to share a session with a Erlang application

I need to create a chat in Erlang. Is there a way to share the session between PHP and Erlang applications ? ...

.post inside jQuery.validator.addMethod always returns false :(

Hello! I am very new to jQuery and javascript programming. I have a program below that checks whether username is taken or not. For now, the PHP script always returns if(isset($_POST["username"]) )//&& isset($_POST["checking"])) { $xml="<register><message>Available</message></register>"; echo $xml; } Login f...

PHP active page code - I can't figure out parse error

I'm trying to build an active page menu with PHP and MySQL and am having a difficult time fixing the error. In the while statement I have an if statement that is giving me fits. Basically I think I'm saying that "thispage" is equal to the "title" based on pageID and as the menu is looped through if "thispage" is equal to "title" then e...

PHP Frameworks: Codeigniter vs. Yii vs. Custom?

Hi everybody, I have used codeigniter for a some years now. Why I chosed to work with codeigniter back then? Pretty much for the extensive documentation that were available and the big user community. It made me as a totally newbie to the MVC pattern able to get a site up and running really fast. I think what is priorited from my side ...

Zend Framework PDF example to excel type

How can I make something like this with Zend_PDF: I have a few columns A, B, C, D, E and after them I will have some information, something like excel. A | B | C | D ss|das|dad|ds ss|das|dad|ds ss|das|dad|ds How can I create something like this with ZF_pdf? I will pull the data from DB, can you please give me an example? ...

Using a php://memory wrapper causes errors...

I'm trying to extend the PHP mailer class from Worx by adding a method which allows me to add attachments using string data rather than path to the file. I came up with something like this: public function addAttachmentString($string, $name='', $encoding = 'base64', $type = 'application/octet-stream') { $path = 'php://memory/' . md5(...

What does "->" do or mean in PHP?

I have seen this at a lot of place but have never understood it's meaning or working... for example: // Registry $registry = new Registry(); // Loader $loader = new Loader($registry); $registry->set('load', $loader); If someone can elaborate this, I will be very greatful... thanks in advance... ...

Some help needed with a SQL query

Hello, I need some help with a MySQL query. I have two tables, one with offers and one with statuses. An offer can has one or more statuses. What I would like to do is get all the offers and their latest status. For each status there's a table field named 'added' which can be used for sorting. I know this can be easily done with two ...

Inserting empty string into auto_increment column in MySQL 5

Hi, I've inherited a project which we are trying to migrate to MySQL 5 from MySQL 4.0(!) and from myISAM to InnoDB. Queries are now falling down because they are being constructed using an ADODB connection's ->qstr() on all parameters, including ints. Where no value is provided I end up with: INSERT INTO tablename VALUES ('', 'stuff'.....

How to validate non empty string in xml content using XML Schema in php

Source XSD:------------- <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xsd:element name="labor_invoice" type="labor_invoice_type"/> <xsd:element name="parts_invoice" type="parts_invoice_type"/> <xsd:complexType name="labor_invoice_type"> ...

Get POST variable that is an array

All, I have the following hidden variables: <input type="hidden" name="chk[10]" value = "cats"> <input type="hidden" name="chk[13]" value = "dogs"> <input type="hidden" name="chk[14]" value = "fish"> I want to get these variables through POST and print them. How can I do this in PHP? Thanks ...

How to set upload_max_filesize in .htaccess?

I have try to put theese 2 lines php_value post_max_size 30M php_value upload_max_filesize 30M in my root .htaccess file but that brings me "internal server error" message ... php5 is running on the server I don't have access to php.ini so i think htaccess is my only chance. Can you tell me where is the mistake? Thanks in advance ...

Loop through JSON Request

All, I have the following JSON Request that comes through a function call in PHP. As evident, each URL can belong to one or more catids. How can I loop through the JSON request and create an associative array that denotes which catid has how many URLs in it. Ex: $arr = array("140"=>3, "141"=>4, "144"=>3) JSON Request: { "head...

how to Extract the data from http://www.pse.com.ph/servlet/TickerServletFile save into mysql database ?

This should be a code igniter based class, The table header should be Price Percent_change Company Name Company Code Volume Please help any one knows? Many thanks! ...