php

Individual user specific customization

Hi, I am building a website with individual user customization in mind. So for instance, client #1 may say i want this feature to be designed for my account and then user #2 may say i want this added to my account. I was thinking of implementing a php if code where upon authentication those features will be loaded each time they login...

PHP ZipArchive not adding more than 700 files

Hi, I have a problem with the php_zip.dll's ZipArchive class. I'm using it through the ZipArchiveImproved wrapper class suggested on php.net to avoid the max file-handle issue. The problem is really simple: 700 files are added properly (jpg image files), and the rest fails. The addFile method returns false. The PHP version is 5.2.6. ...

Array parsing in PHP

I have an array $array1 Array ( [0] => SimpleXMLElement Object ( [galleryid] => gallery.xml [galleryname] => Default [createdat] => 9/8/2010 5:55 pm [description] => Default ) } when i am running foreach($array1 as $node) { print_r($node) ; } am ge...

Where should I place downloadable files for my component?

I am developing a Joomla Component which will allow visitors to download a sound file (be it mp3, or wave, does not matter). Those files are managed in the admin interface and can be unpublished in there. Therefore, it seems that placing them in the assets section is not an option, as it would make them accessible directly from the serv...

CSS and SQL populated lists.

I'm planning on doing this, but I can't get my head around to if this is completely possible or not. I'm trying to follow this design: http://i37.tinypic.com/28hfpzm.jpg The list on the left is populated by SQL. When clicking on one of these links on the left, the page will change (i.e. something like designers.php?designerID=whatever)...

Strange special character encoding error

Hi, I have a very strange character encoding error: I am sending a textfield to a script via jQuerys ajax function. Assuming I want to send the euro sign echo $string; produces € however echo base64_decode(base64_encode($string)); produces € any hints on how I could debug this problem? ...

What are some differences between error and exception in PHP?

I'm a beginner in PHP. So far, from the source I'm learning from, the only mechanism to trigger an exception is by writing a line that throws it. throw new Exception('message') Furthermore, on the code below, any exception won't be thrown, but an error will be raised. try { $file = fopen('no such file.txt', 'r'); } catch(Exception...

Desktop Widget using PHP

Hi all, I need to create a desktop widget where the users wants to update their details from the desktop html file.i haved tried with ajax but the value getting stored in the database but the response cannot get back to html file,i have included the remote js file into the html file. Im using Windows OS, php 5, Xampp server. the sa...

deep copy of doctrine record

I want to make a deep copy/clone of a doctrine record in a symfony project. The existing copy($deep)-method doesn't work properly with $deep=true. For an example let's have a look at a classroom lesson. This lesson has a start and end date and between them there are several breaks. This classroom is in a buildung. lesson-break is a one...

No closure support in PHP 5.3.2-1ubuntu4.2

I just realised that a bit of PHP doesn't execute correctly on one server, but it does on another. They're both running Ubuntu 10.04 with PHP PHP 5.3.2 (PHP 5.3.2-1ubuntu4.2 with Suhosin-Patch (cli) (built: May 13 2010 20:03:45)) I'm testing using: $f = function() {}; var_dump($f); die(); On the server that works, the result is: ...

Automatically change special constants on deplyoment?

I was wondering if it's possible to instruct Netbeans to modify php code before uploading sources to remote web site. In my case I use XAMPP to test locally on my pc the project I'm working on. However my remote webserver hosting the "release" version of my sources could have some peculiarities requiring altering the code on upload, lik...

Using OB to capture error?

Hello, Here is an example. Is it possible to save the output buffer. I would like to cache what its going to output. header('Content-type: text/css'); ob_start("compress"); function compress($buffer) { $buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer); $buffer = str_replace(array("\r\n", "\r", "\n", "\t", '...

PHP SOAP client and SOAP server errors

I have a web server which is acting as a SOAP client to communicate with a third party SOAP server. My client is implemented in PHP using php::soapclient. What is the best way to verify the SOAP server is functioning so I can provide the client browser with the site otherwise if if the SOAP server is down or not responding inform the ...

get file names from uploadify jquery plugin

Hi, that is my first post I am trying here, to get the names of the files that are uploaded, so that the user can delete it if desired, the same way as yahoo. $("#uploadifysub1").uploadify({ 'uploader' : 'JS/uploadify.swf', 'script' : 'JS/uploadify.php', 'cancelImg' : 'cancel.png',...

Passing values from ajax page to calling page javascript function

One part of my page is being loaded via ajax using jquery. For example this initial page has a name first.php. It has a div with it's innerHTML generated from ajax called script (for example ajax is calling second.php). Is it possible to pass some values from ajax executed script (second.php) to original site. I need to access this value...

PHP external page

Want to grab list of players from http://www.atpworldtour.com/Rankings/Singles.aspx There is a table with class "bioTableAlt", we have to grab all the <tr> after the first one (class "bioTableHead"), which is used for table heading. Wanted content looks like: <tr class="oddRow"> <td>2</td> <td> <a href="/Tennis/Players/Top-Players...

Sensing an Action View Helper call in a Zend Controller unit test

I'd like to implement widget-ized Zend controllers in a test-driven way. By widget-ized I mean, for instance, a list controller that outputs elements, calling for each of them $this->action('element', …) view helper in its view script (list.phtml). Thus, the rendering of each element in the list is handled by a dedicated “element” contro...

Finding text content references in MySQL database.

Hi. There's a site containing dozens of text snippets, each of them may have links and I need to build connections between snippets. Snippets are stored in database, database layout is following: snippet: id primary key, title varchar(255), url varchar(400), body text references: snippet_id, crc32_sum backlinks: snippet_id, links_to p...

Problem merging/sorting arrays in PHP

I have 3 arrays like so, that can contain an infinite number of items: Weight Array ( [0] => 20 [1] => 250 [2] => 400 ) Price Array ( [0] => 1.20 [1] => 6.00 [2] => 9.50 ) Courier Array ( [0] => DHL [1] => DHL [2] => UPS ) I'd like to merge them and sort them like so: Array ( [0] => 20 [1] => 1.20 [2] => D...

PHP how to remove extra characters at the end and beginning of a string.

How can I get rid of extra hyphens at the end and beginning of user submitted text for example. I want visual-studio-2008 instead of -visual-studio-2008- is there a way I can remove the extra hyphens using PHP? ...