php5

500 - An error has occurred! DB function reports no errors when adding new article in Joomla!

I have an article that I want to publish on my Joomla! site. Every time I click apply or save. I get error 500 - An error has occurred! DB function reports no errors. I have no idea why this error comes up, al I can think is that it's a server error. I'm using TinyMCE to type articles together with Joomla! 1.5.11. Updated: I turned o...

Howto set PHP socket_write and socket_read character encoding?

I'm writing a PHP server and the client is sending data in a specific character encoding. Now, I want to tell the server to read and write data in this same character encoding set. How should I specify the character encoding set for PHP's socket_read and socket_write methods? ...

how can i print reports from browser in php

Hello, I have a report say, Sno Address Name Age when users click on Print button, they should be able to print the respective report Can anyone help me how can i handle this in php, as i generate this report in php I get all the info from table(MySql) Thanks for the help ...

Can't enter date into postgres field with datatype timestamp

I'm trying to insert a date ("This is a string") into a postgres database field. I'm getting the following error ERROR: invalid input syntax for type timestamp: "" Here is my code $date = '2002-03-11'; $query = 'INSERT INTO dates(date) VALUES('.$pdo->quote($date).')'; $pdo->query($date); I have absolutely no idea on how to do thi...

linux worker script/queue (php)

Hi, I need a binary/script (php) that does the following. Start n process of X in the background and maintain the number processes. An example: - n = 50 - initially 50 processes are started - a process exits - 49 are still running - so 1 should be started again. Please, this is urgent. Thanks! Michael P.S.: I posted the same questi...

How does ZendFramework-1.0.4 handles $_FILE global variable?

Hi, I'm Using ZendFramework-1.0.4 and I don't have any idea how does it wrap the $_FILE global-variable. Is it a good idea to use it directly in my Controller? Bcus I need to Upload an image file. ...

how to execute php from a database?

I've got a bit of an awkward problem. Normally when putting stuff in a database, this will be saved in the way it is. So, if the saved stuff is: <?php echo "hi!"; ?> This will just be output as 'hi!' when called. However, in my case I'm saving plain text into a database. I'm not doing any verifying to check for these codes and I've t...

When to use static modifier in PHP

Doing some code reviews lately I came across a number of classes that have significant number of static methods in them... and I can't seem to grasp why? Hence my question: What are the best practices regarding using static methods in PHP? When would one want to use them and when would one shouldn't use them? What are specific differe...

PHP Fatal error: require_once(): Failed opening required 'Zend/Gdata/Extension.php'

For some strange reason I cannot figure out right now, NoEmbed.php fails with a fatal error when trying to include a file. include path is set correctly, I've verified that like below (right before the require_once directive in NoEmbed.php): $s = ini_get('include_path'); $a = explode(':',$s); foreach($a AS $path) { echo $path; i...

PHP 5 - serializing objects and storing their relationship

I am writing a fairly complex PHP applications where a single user action can trigger changes in many other sub-systems, and I'm contemplating using an observer pattern. However, I am wondering if I have to re-create all the objects involved. Is it possible to while serializing objects to store their relationships? For example $equipm...

Is there any difference between {strlen($var) == 0} and {empty($var)}

Hi, considering that the variable only can be String fetched from an HTML Form (input-text, textarea). ...

Identifying allowed XML elements defined by by an XSD in PHP

I'm trying to write a script in PHP5 that will: read in an XSD let the user give an element/tag name which will serve as the context output a list of elements allowed within that element/tagname based on the XSD So far I'm only able to see solutions for using XSDs to validate XML files. Anyone done something like this before? ...

Deprecated warning only in some php5 environments?

Hello, We're moving from php4 to php5, and we get this warning on one of our developers machines, but not in our php5 test setup: Deprecated: Call-time pass-by-reference has been deprecated in C:\Workspace\Prelive\www\includes\filename etc.. The code seems to be the same in both environments, and the php.ini on the test environment ha...

Access custom error messages for InArray validator when using Zend_Form_Element_Select

Hello, I'm using Zend Framework 1.62 (becuase we are deploying the finished product to a Red Hat instance, which doesn't have a hgih enough PHP version to support > ZF1.62). When creating a Form using Zend Form, I add a select element, add some multi options. I use the Zend Form as an in-object validation layer, passing an objects val...

AMFPHP over SSL problem

I seem to be having a problem running AMFPHP under SSL in our development environment. I created a self-signed cert under CentOS and got everything working, but whenever I go to the page in Firefox I get warned that the certificate is self-certified and therefore cannot be accepted. This then seems to affect the AMFPHP calls from flas...

PHP 5.3 support for strange '${}' code?

I've just upgraded to PHP 5.3 and started supporting an old website for a new client. It seems to use rather odd PHP code which I've not come across before. Whilst trying to access $_GET or $_REQUEST variables, the developer has used the following: ${"variable_name"} I get notices generated due to undefined variables (presumably becaus...

Posting to php page using local program

Greetings all, I have an application when I am posting data on a fairly regular interval. I have one set of code which was developed for VB on the local side and classic ASP on server side, now I would like to change the servside to PHP. The original code uses the xmlHTTP object to post xml data to an asp webpage, worked like a charm. ...

PHP: Fatal error after a form POST

The following code throws an error in PHP 5.2.9 after submission, but not on the original load. Error: Fatal error: Only variables can be passed by reference in /home/golfcom/public_html/test.php on line 12 File: <?php include('connection.php'); $result = $dbc->query("SELECT subdivision FROM Residential"); $search['subdivision'] = arra...

How can I replace a variable in a get query in PHP?

I have an URL http://test.com/test?xyz=27373&amp;page=4&amp;test=5 which I want to tranform by replacing the page=4 through page=XYZ how can I do that with preg_replace? ...

Exection time of php script

is there any function in php through which we can fast the execution time of php script ...