php5

Browser not loading Php pages

Im using a linux machine, and I followed the instructions seen on http://jm2.php.net/manual/en/install.php to setup php, apache and my sql. I did exactly what it said and nothing more, but when I try to open a .php file with firefox or chrome, it downloads...? Im following a tutorial on learning php seen here: http://devzone.zend.com/n...

Better explanation of $this-> in this example please

Referring to this question: http://stackoverflow.com/questions/2035449/why-is-oop-hard-for-me class Form { protected $inputs = array(); public function makeInput($type, $name) { echo '<input type="'.$type.'" name="'.$name.'">'; } public function addInput($type, $name) { $this->inputs[] = array(...

Curl_errno=55, "Failed sending network data."

Hi all: I have a php script that updates a database via an api. This script works on one server but not on another. Both servers have curl enabled and they have php 5.2.6 or above. The error happens in the do_put() method. The rest of the script seems to be fine. I have found that: curl_errno= 55 = "Failed sending network data". curl_...

Apache on linux and i18n : spawning processes or threads ?

Hello, I would like to understand better exactly what is going on when Apache on linux receive an HTTP request in a process pre-fork model. Let's say we have 20 Apache child processes waiting. When I receive an HTTP request, is it true to say that 1 child process will be chosen to handle the request and that this process won't handle a...

Calling overridden method from within overriding method in OO PHP

Working in a symfony model, I want to override a function and call the overridden function from within the overriding one, along the lines of class MyClass extends BaseMyClass { function setMyProperty($p) { parent::setMyProperty($p); //do some other stuff } } This is resulting in a segmentation fault. I don't want to alt...

Google maps api v3 refreshing away markers

Hi, I am having problems with the google maps API V3. It seems that every time I load my page the maps load (including the markers) and then it does a quick reload and removes all the markers. Am I missing somehting? What am I doing wrong? Here is an example: http://www.PaulPeelen.com/wp-content/uploads/2010/04/SafariScreenSnapz001.mov...

[PHP]RegEx help with a string

So I have a random of strings and I need to parse them, let's take an example: This string - DeleteMe please and some other text So I want to find DDeleteMe please and some other text and remove it, because all I need is This string Best Regards, ...

Can I use this technique to provide free email service for my users?

I'll let users register their [email protected] ,,, they enter their members area where they can : 1- send emails ( easy to do) 2- receive emails .. for receiving emails , I'll use a catch all email account , read the email and figure to whom it's sent (username), and then I save it on the database with userid of the username who h...

PHP - Concatenating objects and casting to string - bad idea?

Is it bad practice to concatenate objects when used in this context: $this->template->head .= new View('custom_javascript') This is the way i normally add extra css/js stuff to specific pages. I use an MVC structure where my basic html template has a $head variable which I set in my main Website_controller. I have used this approach f...

tool to export code to html

Hi there, I'm looking for a tool that can highlight code (ruby, php, javascript...) like with an IDE and then export the code to html format so that when opening the html page the code looks just like with the IDE Thanks. ...

File private variables in PHP

Is it possible to define private variables in a PHP script so these variables are only visible in this single PHP script and nowhere else? I want to have an include file which does something without polluting the global namespace. It must work with PHP 5.2 so PHP namespaces are not an option. And no OOP is used here so I'm not searching ...

PHP Sax: Why might I use this for?

What is this for and why might I use it? ...

What are some design patterns that you know of for PHP OOP?

I recently learned a lot about MVC design pattern which is a very interesting concept. I would assume there are a lot more design patterns out there, and I thought it would be great for people to share some. Here's my contribution, MVC design pattern: http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller ...

PHP POSTGRE extension

Will you be so kind to tell me why the sysytem can't load POSTGRE extension for PHP? In php.ini I write: extension=php_pgsql.dll But when I reboot, I get this warning: Unable to load dynamic library: C:/PHP/exe\php_pgsql.dll. There are no problems with other extensions. ...

Using memcached as a session storage with CodeIgniter

I am researching possibilities of using memcached as a session storage for a system built on CodeIgniter. Has anybody done this before(that's probably a stupid question :) and if so what's your experience folks? Have you used any existing libraries/extensions? As far as performance improvement what have you seen? Any caveats? ...

[PHP-GD] How to use imagefill() from file?

Hello people, Thanks for looking at this question. I wanted to know how can I use the GD function imagefill() to patch an image with another image. imagefill() currently accepts resource of a color. I can do that. But wanted to know how this can be done with a file. I noticed a user note - But that didn't worked and took a long ...

when to use destructor in php?

what is the main purpose of a destructor? could you give any examples of what i might want to run when a object is deleted? ...

"date_part('epoch', now() at time zone 'UTC')" not the same time as "now() at time zone 'UTC'" in postgresql

I'm writing a web based front end to a database (PHP/Postgresql) in which I need to store various dates/times. The times are meant to be always be entered on the client side in the local time, and displayed in the local time too. For storage purposes, I store all dates/times as integers (UNIX timestamps) and normalised to UTC. One partic...

How to upload a word document and find duplicate values in that document using PHP

Hi all, How to upload a word document and find duplicate values in that document using PHP. thanks in advance Fero ...

date_create_from_format equivalent for PHP 5.2 (or lower)

Hi all, I'm working with PHP 5.3 on my local machine and needed to parse a UK date format (dd/mm/yyyy). I found that strtotime didn't work with that date format, so I used date_create_from_format instead - which works great. Now, my problem is that my staging server is running PHP 5.2, and date_create_from_format doesn't work on that ...