php

Getting 500 error on webpage only for one computer

I am running a site on php with a mysql backend. Things have been fine but suddenly one users account started getting a 500 error. Each user has his own profile when they log into the any box so his internet explorer settings are the same no matter what box he logs on to. Does anyone know if this could be an internet explorer setting cau...

How to generate Doctrine models/classes that extend a custom record class

When I use Doctrine to generate classes from Yaml/db each Base class (which includes the table definition) extends the Doctrine_Record class. Since my app uses a master and (multiple) slave db servers I need to be able to make the Base classes extend my custom record class to force writes to go to the master db server (as described here...

Parse a nested xml with PHP to an object

Hi All, I have to parse an xml file with PHP to an object. At the moment I don't have a clue how to do this, help is appreciated. The xml is quite big. I have to parse a part of it which looks like this: <someNamespace:xmlDocument> <someNamespace:categories> <category name="Patrick" anAttribute="numericValue" anotherAttribute="numeri...

Recommended books about PHP MVC

Can you recommend books to learn about PHP MVC please? Thanks everyone. ...

XDebugging PHPUnit testcases in Eclipse PDT

Until now, I was debugging my PHP scripts and testcases using vim and the appropiate script with python backing it. However, me and my colleagues need to move forward and vim/gvim is not an option for them. So I've tried to integrate debugging PHPUnit in Eclipse on my setup as an external tool, which again, works with vim. However, it s...

make select box values faded out/unclickable

Hi, I have a normal HTML select dropdown box <select id="day" name="day"> <option value="0">All</option> <option value="1">Mon</option> <option value="2">Tue</option> <option value="3">Wed</option> <option value="4">Thu</option> <option value="5">Fri</option> </select> But on occassion I want to make some options not clickable,...

Convert Hex to RGB for imagegif function

The function below is designed to take an input hex (with or without the "#" prefix) and apply the color update to the portion of the image between startPixel and endPixel. I can get the function to work fine on localhost tests when (1) supplying red, green, blue and (2) running the file directly as a stand alone (ie, just saving the co...

Best practice to create absolute URLs with Zend framework?

Is there a best practice for creating absolute URLs using the Zend framework? I wonder if there is some helper or if this would just be concatenating the scheme, host, etc. from the $_SERVER variable and then add the relative path generated by Zend. ...

Curl grab HTML content

I have a webpage which requires a login. I am using curl to build the HTTP authentication request. It works, but I am not able to grab all the content from my links. I miss all the images. How can I grab the images as well? <?php // create cURL resource $URL = "http://10.123.22.38/nagios/nagvis/nagvis/index.php?map=Nagvis_CC"; //Ini...

Sending email through Gmail SMTP using PHP

I have following system setup Windows XP Service pack 2 WAMP 2.0 PHP 5.3 I've configured my php.ini file with the following: smtp=smtp.gmail.com smtp_port=25; and my PHP code is <?php mail('[email protected]','test subject','test body'); ?> The error I'm getting is Warning: mail() [function.mail]: SMTP server respons...

What does bindtextdomain in PHP do

I might be blind, but I don't see any good explanation here. So, what does bindtextdomain do? ...

URL Structure Parent to Child Relationship With Static Files

Currently I can not show site structure in the url IE www.site.com/parent-page/child-page without creating a subdirectory at the root. Is there an easy way to dynamically create the parent to child relationship other than creating subdirectories? ...

PHP - MVC - Fetching the view

Greetings all! Looking for some help with MVC in a PHP context. Currently I am building a small, lightweight MVC framework to help expedite application development at work. It's a long hard separation eliminating inline code - at least with numerous projects looming overhead and the temptation to utilize it ever-present. I understand...

PHP - What's the difference between escapeshellarg and escapeshellcmd?

PHP has 2 closely related functions, escapeshellarg() and escapeshellcmd(). They both seem to do similar things, namely help make a string safer to use in system()/exec()/etc. Which one should I use? I just want to be able to take some user input and run a command on it, and not have everything blow up. If PHP had an exec-type-function ...

Parsing periodic elements in PHP/html

This problem actually hit me recently. So I was tasked with putting people's bios up on the web (asked for opinions in a different question), which I went with XML and just created elements based on what sections was going to be displayed. Some people had formulas in their bio and when I was copying/pasting the formatting didn't copy o...

What is %2 in $id%2

What does %2 do in the following php? $id=(int)@$_REQUEST['id']; echo ( !($id%2) )? "{'id':$id,'success':1}": "{'id':$id,'success':0,'error':'Could not delete subscriber'}"; ...

video streaming

i have built a web forum using php but i want to integrate it with videos that are uploaded such that people will be able to make comments on it in a tree view form... how do i integrate that to my php class.....any help with that? ...

In PHP, make every letter left of colon lowercase w/o use of explode,implode

Can this be done with regular expressions? Examples x-example-HEADER:teSt becomes x-example-header:teSt y-exaMPLE:testoneTWOthree becomes y-example:testoneTWOthree ...

What are differences between $id=(int)@$_REQUEST['id']; and $id=$_REQUEST['id'];

What do @ and (int) do in the following. $id=(int)@$_REQUEST['id']; ...

how to convert a character to 7 bit even parity in php

I want to convert a Character to a 7 bit even parity. Can you please suggest me, how to implement this? ...