php

how to protect against LDAP Injection

We are building an application which utilizes LDAP via php and I got to thinking is there anything you can do with injecting into LDAP and better yet how does one protect against LDAP injections ? ...

Clickable Elements in pchart?

I've been looking for a good open-source tool for creating graphs in PHP, and pChart is looking like a great candidate. One need I have is to be able to click on certain elements of the graph, like a category label or an individual bar, to drill-down into the data, and display new data and new graphs on a new page. Is this something th...

file_get_contents subtitute function or methods ?

In one's server, file_get_contents is disabled for security reasons. I need to retrieve xml data. So, what is the best thing to do to : Verify that file_get_contents is supported by a server ? Is there any subtitute methods of file_get_contents ? ...

Zend Framework Common Layout and Modules

I have a next structure of my project: /application /modules /default /layouts ... /news ... /configs /layouts common.phtml Header and footer on all pages are the same. I have a block with changing content for different modules. It is not work now. Can you help me. May be you did th...

PHP background process

Hi, I've wrote a php irc bot, but i need it to work in the background. With this there'd be no quits or so. What is the best way to do this? Thanks and Regards. ...

Nested output buffering with external class dependencies [please help]

Thanks in advance for any and all advice. I have one file (content file) where an array is created like so: $config['plugins']['BannerRotate'] = array( 'container' => 'abroadView', 'arrows' => true, 'auto' => true, 'speed' => '15000', 'width' => '300px', 'height' => ...

Convert Excel spreadsheet to PHP script

I have an excel spreadsheet that contains some formulas to calculate ROI for an upcoming product of a client. Is it possible to convert this into a php script whereby a user would type into some boxes and then submit it working out the same. The excel spreadsheet is here: http://www.solidcamxpress.co.uk/roi.xls ...

Determine if a file has more than X lines?

Hi there, as I was not able to find a function which retrieves the amount of lines a file has, do I need to use $handle = fopen("file.txt"); For($Line=1; $Line<=10; $Line=$Line+1){ fgets($handle); } If feof($handle){ echo "File has 10 lines or more."; }Else{ echo "File has less than 10 lines."; } fclose($handle) or something si...

Why is my e-mail still being picked up as spam? Using mail() function.

I've been getting very annoyed at this as no matter what it seems spam filters are still calling my websites auto responder as spam. I've set all my headers correctly and this is what I have so far! $headers = "From: Name<[email protected]>\r\n" ."Return-Path: Name<[email protected]>\r\n" ."Reply-To: Name<[email protected]>...

kohana framework, using Security:xss_clean in validation filters

Hello! I have this part of code: ->filter('username', 'Security::xss_clean') ->filter('url', 'Security::xss_clean') ->filter('text', 'Security::xss_clean') but it not works and after validation parametres will be inserted via ORM into table columns with html tags. so, what i do wrong? or this metho...

How can I access an object property named as a variable in php?

A Google APIs encoded in JSON returned an object such as this [updated] => stdClass Object ( [$t] => 2010-08-18T19:17:42.026Z ) Anyone knows how can I access the $t value? $object->$t obviously returns Notice: Undefined variable: t in /usr/local/... Fatal error: Cannot access empty property in /.... ...

Reading Google docs spreadsheet

Is it possible to pull rows from a Google Docs spreadsheet using PHP? In SQL I would use something like: SELECT * FROM table WHERE field = 'value' LIMIT 1 Is there a way to do this? I've heard you are supposed to use a 'Zend' framework, but I haven't been able to figure that out either. Any help would be appreciated ...

php, manipulate arrays, combine array, associative

I have an array like $array = Manufacturer => BMW Miles => 10000 and I would like to use this to create a new array with a specific name/value like this : $array = st_selval_0_0 => Manufacturer st_tmdata_0_0 => BMW st_selval_0_1 => Miles st_tmdata_0_1 => 10000 As you can see the last digit mu...

Merge 2 associative arrays of different lengths where a key (datetime) matches in both arrays.

I have 2 arrays, each with a date string and a string value representing 'amount'. The first array has a row for every day between start_date and end_date, but has nothing for 'amount'. The second array has fewer rows, but has the amount. I need to merge the 2 arrays so that I end up with a row for every day, with an amount for that day,...

HTaccess rewrite rule

Hi all. I have a webpage http://mydomain.com/form.php?id=123 , I need to keep this format for old functionality , and to implement a new functionality so the user could access this page like this http://mydomain.com/123. So the client will see this http://mydomain.com/123. And the server will understand as old version http://mydomain....

Apache mod_rewrite: RewriteMap directive using PHP script on Windows machine

This has been driving me insane. I can't seem to get the RewriteMap directive to work for a php script on windows. Here is the relevant snippet from my httpd.conf file: <IfModule mod_rewrite.c> RewriteEngine on RewriteMap router "prg:C:/dev/web/www/routing.php" RewriteRule (.*) ${router:$1} </IfModule> My simpl...

CodeIgniter controllers being called twice.

It is entirely possible that I've made a huge mistake someplace, but for some reason, my controllers are being called twice. This is breaking DX_Auth's captcha's on Chrome, but somehow, Firefox and IE can handle it. The problem is, every controller is getting called twice milliseconds apart. I used log_message() to print every key/valu...

Sort array starting with given value

Hi, I would like to sort a php array starting with a value I set Example: $array = array(); $array['test'] = 'banana'; $array['test2'] = 'apple'; $array['test3'] = 'pineapple'; $array['test4'] = 'orange'; How do I sort it so that 'orange' is the first result then it sorts alphabetical from then on. So it would be orange ap...

Magento custom module - where to store includes

Hi, I am creating a custom magento module and cant decide the best place to store some config files i require with the module? Anyone out there suggest the best place for this? Should it be in the root of the module or in with the helpers maybe? Edit: Along the same lines as this question: is it acceptable to have a folder in the root...

Creating a secured rss feed with Zend_Feed

I was wondering if it was at all possible to create a rss(or atom) feed with Zend_Feed that would be on a secured website (With Zend_Auth). How would users be able to subscribe to my feed? How would feedreaders handle authentification? Is there any pitfalls I should be aware of (one I can think of is users who use outlook, IE, and ot...