I have this doubt, I've searched the web and the answers seem to be diversified. Is it better to use mysql_pconnect over mysql_connect when connecting to a database via PHP? I read that pconnect scales much better, but on the other hand, being a persistent connection... having 10 000 connections at the same time, all persistent, doesn't ...
Hi All
I am a newbie in cakephp; I have two combos, provinces and cities with cakephp.
I would like to change cities value when the province combo value changes. Here is my code
<div class="cities form">
<?php
$v = $ajax->remoteFunction(array('url' => '/cities/','update' => 'divcity'));
print $form-> input('Province.province_id...
I have a PHP client that requests an XML file over HTTP (i.e. loads an XML file via URL). As of now, the XML file is only several KB in size. A problem I can foresee is that the XML becomes several MBs or Gbs in size. I know that this is a huge question and that there are probably a myriad of solutions, but What ideas do you have to t...
Lately I've been in the habit of assigning integer values to constants and simply using the constant name as a means of identifying its purpose. However, in some cases this has resulted in the need to write a function like typeToString($const) when a string representation is needed. Obviously this is inefficient and unneccesary, but is o...
I would like to display a Drupal view without the page template that normally surrounds it - I want just the plain HTML content of the view's nodes.
This view would be included in another, non-Drupal site.
I expect to have to do this with a number of views, so a solution that lets me set these up rapidly and easily would be the best - ...
I am writing a custom session handler in PHP and trying to make the methods defined in session_set_save_handler private.
session_set_save_handler(
array('Session','open'),
array('Session','close'),
array('Session','read'),
array('Session','write'),
array('Session','destroy'),
array('Session','gc')
);
For exampl...
I currently use Notepad++ for most of my development. I have been checking out other, more full-featured options and would like to switch (I'm in particular a fan of Aptana so far) but there is one thing about Notepad++ that I really like and I haven't been able to get so far.
My current workflow is something like this: Workflow (I t...
I am wondering your thoughts on doing a complete software rewrite. We realized after not long after we completed our software app that the framework was not going to scale well over time. For the record the framework was decided well before I got to the project. We are soon facing the reality that we will have to rewrite the entire app i...
can someone explain this one to me? a link to something in the php manual even?? i can't find anything:
if ($_SERVER['SERVER_PORT'] <> 443) {
doSomething();
}
...
I'm reading through the Zend Framework coding standards, where they state that curly brace after a Class definitions should be on the next line, the "one true brace form".
class MyClass
{
function....
}
I usually have the braces on the same line:
class OtherClass {
function ...
}
What's the reason for putting the brace on t...
So I got started with PHP at version 4, and had to make the switch to 5. Now I understand that version 6 is on the way, and that a lot of things have been re-thought.
The changes may be good ones, but in the future, does anyone know about PHP's roadmap? Does it look like it will flatten out?
...
Hello,
I found the discussion on Do you test private method informative.
I have decided, that in some classes, I want to have protected methods, but test them.
Some of these methods are static and short. Because most of the public methods make use of them, I will probably be able to safely remove the tests later. But for starting with ...
Hi, I've been coding PHP on and off for a few years, mostly some basic apps and sites. Not very much OOP at all. I've done some basic OOP but I don't really know if I'm doing it correctly or if I'm following best practices etc.
I know PHP pretty well but up until now my code has mostly been functional with some minor OOP.
Now I want to...
I'd like to have a page in php that normally displays information based on the GET request sent to it. However, I'd like for it to also be able to process certain POST requests. So, how can I tell if any data was sent by POST so I can act on it?
...
I have written a web app in PHP which makes use of Ajax requests (made using YUI.util.Connect.asyncRequest).
Most of the time, this works fine. The request is sent with an X-Requested-With value of XMLHttpRequest. My PHP controller code uses apache_request_headers() to check whether an incoming request is Ajax or not and all works wel...
OK, sorry in advance for the length of this question!
I've spent ages reading about the pros and cons of all the major PHP Frameworks (i.e. Zend, CakePHP, Symfony, CodeIgniter, etc., etc.). I've also read most of the questions and answers already posted in here about PHP Frameworks and I STILL can't make up my mind as to which one I sho...
I have been trying to get PEAR::mail to successfully deliver emails to hotmail users without being flagged as SPAM and ending up in the junk folder, i have no problems with yahoo/gmail only with hotmail.
google suggested that this is a common problem with hotmail and that possible causes can include
incorrect reverse DNS for main IP o...
Hello all, I am wondering what the best way is using php to obtain a list of all the rows in the database, and when clicking on a row show the information in more detail, such as a related image etc.
Should I use frames to do this? Are there good examples of this somewhere?
Edit:
I need much simpler instructions, as I am not a program...
A similar question discusses __construct, but I left it in my title for people searching who find this one.
Apparently, __get and __set take a parameter that is the variable being gotten or set. However, you have to know the variable name (eg, know that the age of the person is $age instead of $myAge). So I don't see the point if you HA...
I'm currently using Magpie RSS but it sometimes falls over when the RSS or Atom feed isn't well formed. Are there any other options for parsing RSS and Atom feeds with PHP?
...