php

SQL Query to find ID's with as many hits as possible from an Array.

Hi everyone, English is not my native language so i'll try to explain as good as i can. I have a table with ID's in this table i also have account numbers. something like this: ID ACCOUNT 1 1000 1 1001 1 1002 2 1000 2 1001 3 1003 then i have an array (Posted from a form, like name="array[0]",name="array[1]",name="array[...

PHP gettext() in Norwegian

Hi there! I'm using PHP's gettext() for simply transform a website to an other language. The solution worked fine (English/Hungarian) until now because i need to add a Norwegian translation to a new site. When i set the Norwegian locale with setlocale(LC_ALL, "nb_NO.ISO8859-1"); gettext() only returns the base string not the translated...

Consuming a php soap web service with excel2007

Hi all, I'm trying to figure out how to connect Excel 2007 to php5 based web services. I found this pretty interessting article on the topic. Ok, so it seems to be doable. Now, php5 soap services don't accept parameters in url form, so a RESTesque call like http://domain.org/service.php?getme=something won't work out since there are ...

Get date for monday and friday for the current week (PHP)

Hello guys, How can I get the date for monday and friday for the current week? I have the following code, but it fails if current day is sunday or saturday. $current_day = date("N"); $days_to_friday = 5 - $current_day; $days_from_monday = $current_day - 1; $monday = date("Y-m-d", strtotime("- {$days_from_monday} Days")); $friday = da...

How can i see what variables are sent from flash to a php script?

Hello i was wandering how i could see what variables my flash sends to my php sccript. Is that possible? Maybe an extension or something else? i don`t know if my flash is sending any variables. My problem is that i have a flash wich i can`t change and i the flash has a form. in that form the variables are sent to a php script.. we had t...

Best place to get PHP generic code examples

Aside from the PEAR repository, which I find often has quite messy code with a lot of it using old or deprecated methods and techniques, I was wondering if there was a great place to find simple (and not so simple) PHP examples of some generic functions and good pieces that people have written. A good example would be the PEAR spreadsh...

How to implement is_empty() in PHP?

The empty() native in PHP will fail if the string is "0" or something like that. So how to implement the exact is_empty() function in PHP? ...

Organisational chart class in PHP

Hi Guys, Does anyone know where I could find a PHP class to generate organizational charts? ...

How to manage answers directly on email notifications

Hi, I would like to know what's the best way to manage answers to email notifications. eg. The user receive an email notification, and instead of having to click on a link to go on the website and answer it he could directly reply to the email. ...

Database / PHP security question

Hello, We are developing a very simple first stage GUI for a company database. At the moment our time to deliver is rather limited. So we thought about using a simple SQL stored procedure and retrieve all data. The data the users are allowed to see is depending on security levels defined in the database and also in our Active Directory....

How do I script a php file to display an image like <img src="/img.php?imageID=32" />?

Hi everyone, I'm storing banner ads in a mysql table or I should say just the file name e.g: 'imagename.jpg' or 'banner3.gif'. Obviously I am wanting to track when these banners are loaded so I'm thinking to create a php file called img.php and call it like so <img src="/img/img.php?imageID=3" /> And that would pull out the image w...

Information required - PHP application distribution based on user signup

Take for instance Yahoo Mail or Twitter. When someone signs up to use their service, they'll need to automatically deploy a new database, application folder and so on - I assume! I am planning to write an PHP application to let people add and edit invoices. Good examples would be Zoho Invoice, http://www.getballpark.com/, etc. They sure...

Zend_Form: Element should only be required if a checkbox is checked

Hey there, I've got a Form where the user can check a checkbox "create new address" and can then fill out the fields for this new address in the same form. Now I want to validate the fields of this new address ONLY if the checkbox has been checked. Otherwise, they should be ignored. How can I do that using Zend_Form with Zend_Validate...

Zend Framework setup

Hai I want to create a project in Zend framework, but I don't know any idea about how to include this zend framework in to wamp server. Any one please helps me...? Thanks in advance.. ...

Remove unwanted line feeds from an HTML file.

I have a lot of HTML files which have unwanted line-feeds. These break things like inline javascript and formatting within the pages. I want to come up with a way to strip out all line feeds from the pages that do not appear directly after an html tag e.g </div>. Does anyone know of a regex and/or program that may be able to acheive this...

Easier way of doing this?

I have this code public function getList() { $array = array(); $r = mysql_query( "SELECT * FROM hobby ORDER BY hobby_name ASC" ); while( $ro = mysql_fetch_object( $r ) ) { array_push( $array , $ro ); } if ( count( $array ) > 0 ) return $array; else return false; } And was wondering if there is an easier way of doing thi...

Character Format in php

Sorry I can’t log in claim ID is having server issues (im normally Arthur Gibbs) Data from my database currently outputs this when there are strange charecters... This is just a example What I get: De&#8730;ilscrat™ What I want: De√ilscrat™ It seems that some characters are being translated into character code by the other guys syste...

Namespacing/Scoping in CSS

I want to apply the rules in a CSS file to a certain div/class so, for example, the contents of events.css is only applied to the contents of a class called .events and not outside this scope without the need to add the class .events to the start of each css rule. I am thinking this is not possible though - but you never know. If not I...

session-start warning

on my pages I get the following warning: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/com10002/public_html/compo/index.php:1) in /home/com10002/public_html/compo/index.php on line 1 My code says: <?php session_start(); require_once("lib/lib.inc...

MySQL status swap for bitwise operators

I am looking for a solution/best practice to do a swap of values for a status flag. The status INT(3) in mysql has a few values, and I'd like to be able to swap the LIVE and NOT_LIVE values around, without interrupting what other bitwise values are in there. If it was a flag field, as in 0 or 1, it is easy: 'status' NOT 'status' I w...