php

Trees in Symfony

Does someone know a stable tree adminstration plugin (nested set etc.) for the symfony framework, which is able to operate on separated database tables? ...

How do I cache a web page in PHP?

how do I cache a web page in php so that if a page has not been updated viewers should get a cached copy? Thanks for your help. PS: I am beginner in php. ...

Not able to enable LDAP on PHP 5.2.10 on 64 bit machine

I am trying to enable the LDAP extension for PHP 5.2.10 on a 64 bit windows 2003 server. I have followed the mandatory steps: Enabling the dll in php.ini Checking extensions directory. Ensuring that the dll is present in the extensions directory. Restarted the web server. However i have not been successful. Any help on how to procee...

Get every Friday, Saturday and Sunday in a given time frame

What is an easy way to get every Friday, Saturday and Sunday betwee two dates, without using the datetime object of PHP5.0. Because of the speed I don't want to traverse every date between 1/1 and 31/12. (per page I have to calculate it at least 50 times :) as part of a result view.) ...

What features to be included into an e-commerce system written in php?

Hi, we are planning to buid an e-commerce system in php. We will not ship the products but offer them as download. What, in your opinion, are the technical must-haves of such a project? (databases, php modules, server ...). Thanks very much for your suggestions and tips ;9 best, heinrich ...

How to execute a command line from php

Hi friends, I need to convert the html file into PDF, I am having command line for this process C:\Program Files\Software602\Print2PDF/print2pdf.exe /iniconvert C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/BPO/Praveen/OCT_08/html_files/file.ini This is the command line to convert. But i dont know how to run this in ph...

Zend Cache Core and APC - I don't understand how old cache entries get invalidated

For Zend_Cache_Frontend_Core you can define a lifetime and, according to the documentation, a "automatic_cleaning_factor". According to the manual, this property specifies on how many writes to the cache old cache entries get invalid. When I use APC as backend shouldn't the cache invalidate itself automatically without having to write ...

Which characters make a url invalid?

I am writting bbcode for my own forum (based on php); how to find out if it is an invalid url provided in the the [url] tag? Which characters make a url invalid? ...

single sign on multiple sub domains

I have implemented single sign on multiple sub domains like: www.abc.com my.abc.com support.com using cookies or called session cookies(it will expire as browsers close). syntax: setcookie("VARIABLE_NAME", VALUE , 0, '/' , '.domain.com'); parameter are name of cookie variable name , value , time of cookie expire(zero means it will de...

Revision system - Help improve my code

A section of a site I am building needs some form of revision system and so decided to keep it simple and go with one similar to Stack Overflow. I quickly created the following which works although seems a little messy. I know I can use beforeSave and afterSave but I have no idea how I could implement it. I know I could probably move ...

how to add a second path to the same namespace in the zend autoloader

We are working on a new zend framework project and most things are going fine with the bootstrap: <?php class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { protected function _initAutoload() { $autoloader = new Zend_Application_Module_Autoloader(array( 'namespace' => 'List8D', 'basePat...

PHP - How to send an array to another page ?

Hello, I'm trying to send an array to another page. What I tryed before was: page1 <input type='hidden' name='input_name' value='<?php print_r($array_name); ?>' /> And page2 <?php $passed_array = $_POST['input_name']; ?> Now how do I make $passed_array act like an array? Or do you know of any other way of solving this problem? ...

Multiple sites in same MySQL database

I'm planning to have 20 or more sites in the same database tables. Like a structure similar to this: cms_config cms_pages cms_users cms_modules I have been thinking that each of these tables should have a customer_id column, so I easily could select and call rows that is for the given customer. But is this the best way of doing it when...

jquery ajax POST size limit?

I’m using jquery to send text back to my ajax.php controller like this: var dataString = "1234567890"; $.post( '../ajax/save', { data: dataString }, function(){ alert("success"); }, "text"); It works well, that is until the dataString gets to be ~3500 characters long. At that upper limit (~3.5 KB), t...

Best XML DB for a PHP website?

Hello, I'm planning on writing a RSS Feed Aggregator with a team, but I'm wondering what XML Database we should use. The server currently runs IIS 6.0 with PHP 5.3.0 x64, I understand already that I need both a server application and a PHP extension. What I've discovered already: Galax Have previously used this at university, but I ...

Add HTML to wordpress database

Hey, how do I insert raw HTML in Wordpress's database? I'm using add_option to add values to wp_options table of Wordpress. But Wordpress escapes everything before inserting to the database, so will it pose a problem? If so, what is the correct way ...

Can you have nested classes in PHP?

I'm not talking about inheritance. And I'm not talking about nested objects. I'm talking: System::Web::Templating(...) kind of nesting. These are classes of which you shouldn't create instances.. so... ...

PHP - Replace colour within image

I hope someone can help, I have made a script that masks images... however it is reliant on a colour to mask with ( 'green screen' style). The trouble is if the image that I am masking contains that colour it is ruined. What I am looking to do is prior to masking the image replace any occurance of my keying colour (0,0,255) with a simi...

HTTP authenticate a file download ... how to? [SOLVED]

In my website I've a php script that launches a file download without showing the full path of the file, the code look like this: $path = '../examples/test.zip'; $type = "application/zip"; header("Expires: 0"); header("Pragma: no-cache"); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: pre-check=0, ...

application/force-download

I'm creating a script to only upload zip files and I have the following validation allready: if($itemtype != "application/x-zip-compressed" && $itemtype != "application/zip" && $itemtype != "application/octet-stream") { throw new exception("Your file should be a zip file!"); } but I have a file with file type application/force-do...