php

Excel with Macro

Hai i want to download an excel sheet which contain Macro. But i use Php script to downlaod the excel. Is it Possible to download an excel sheet with macro in php? ...

PHP Logic - Return False of one or two out of three are not set

Hi all, I have a form that collects information, one piece of which is a phone number. The phone number data comes from three fields, one for an area code, for the first 3 digits, and for the last four, so that numbers are in this format: xxx-xxx-xxxx (basic U.S. format). These three fields are not required, but I would like to do some...

PHP IDE with extract function like Eclipse Java Refactor->Extract Method

Is there any (free or cheap) IDE, which can extract part from a function as another function? ...

ebay like API interface for a web portal

We have developed a B2B Web portal for Graphics Job Work which is similar to Camera Ready Art (www.camerareadyart.com). It is targeted for people wanting to convert bitmap to vector Graphics, Logo Designing and general image processing like coloring B/W images to color,etc. We want to add facility so that people (our clients) can use a ...

How to figure out the location of a keyword in an HTML document?

I have an HTML document as a string I want to search for a keyword in this document and figure out where did it appear in the document I mean in which tag did it appear did it appear in H1,H2 or TITLE tag lets say my document is $string = "<html> <head> <title>bar , this is an example<...

In an MVC Context, Where Do I Put A Class?

straight to the point : I am using Kohana, and I am looking at another script written in plain PHP. In the script, I have a class ShoppingCart. If I am to convert the script to Kohana, where am I to put the class, its methods and its properties? Is it in my existing default controller? Or should I put it in a separate controller? Or a...

How to find the last HTML tag which has not closed using regular expressions?

Lets say I have this string $string = "<html> <body> <h1> <b>aaa</b> bbbb "; I want the result to be "h1" because it is the latest unclosed tag another example if the string is $string = "<body> <img src='' alt= "; the r...

Should I use php mail function or phpmailer?

Well, so far, I have been using php built in function, mail(), and I have no problems with it, even I sent a blast to 1000+ users. But then, lately I found this phpmailer, which is specially design to send email. Q1: Should I change to this phpmailer? Q2: What are the advantages of using phpmailer? Q3: I found other products on phpm...

PHP - include a php file and also send query parameters

Hi I have to show a page from my php script based on certain conditions. I have an if condition and am doing an "include" if the condition is satisfied. if(condition here){ include "myFile.php?id='$someVar'"; } Now the problem is the server has a file "myFile.php" but I want to make a call to this file with an argument (id) and the ...

Netbeans-esque retrospective auto-comment/phpDocumentor tool (for Eclipse or standalone)

Is there anything similar to netbean's Javadoc auto comment tool for PHP/phpDocumentor/Eclipse? In the netbeans implementation: A dialog pops up and allows you to run through all the members of your class and enter comments, which are added to the source file. It even verifies that there are no parameters you have not accou...

Best way to test for databases/connections

Is there a way to unit-test classes wich require database connections? e.g. User-Classes (DB-)Object mocking didn't quite help ...

Listing categories with the latest comments/activities with MYSQL

I am developping a site where users can post comments and each comment is categorized. I have a page where users can go and see a list of all the categories on the site with the latest 5 comments posted in them. The information I need to retrieve from the database is: A list of categories 5 comments in each categories This is what...

__construct() { issue for PHP4 and PHP5. maybe an another reason...

Hi friends, I have weird issue with CodeIgniter, here is a start part of my controller class Home extends Controller { /** * Constructor */ public function __construct() { parent::Controller(); } ... everything is working fine at localhost, but when I try same at server, I come cross with an error like b...

JSON Parse Error using Adobe Flex - PHP - SQL

I am trying to return results from my SQL database, using PHP to convert it into JSON, which is then read by Flex. Here is the parse error I receive - JSONParseError: Unexpected < encountered at com.adobe.serialization.json::JSONTokenizer/parseError()[/Users/mesh/src/as3corelib/src/com/adobe/serialization/json/JSONTokenizer.as:579] at ...

auto completion for built in functions in eclipse php

hello im writing php code in eclipse PDT (PHP Development Tools), but for some reason it does'nt auto-complete php built-in functions, such as "isset". unline komodo - which also shows the arguments the function recieves. the only thing eclipse auto-completes is my variables. hwo can i make eclipse auto-complete functions ? thanks ...

Save loop result to a string

Hi everyone! Is it possible to save loop results to a string? $sql = "SELECT SUBSTR(a.`title`, 1,1) FROM articles a WHERE a.`tag` = 'human_resources'"; $results = db_query($sql); while ($fields = db_fetch_array($results)) { foreach($fields as $key => $value) { echo $value; } } The code above outputs titles of art...

How to get the content-type of a file in PHP?

I'm using PHP to send an email with an attachment. The attachment could be any of several different file types (pdf, txt, doc, swf, etc). First, the script gets the file using "file_get_contents". Later, the script echoes in the header: Content-Type: <?php echo $the_content_type; ?>; name="<?php echo $the_file_name; ?>" How to I set...

Opposite of array_filter to keep certain values and preserving keys.

Hi, I've got an array, indexed by keys, eg: array( 'key1' => 'value1', 'key2' => 'value2', ... 'key57' => 'value57' ) How to "filter" that array, in order to only have, for example: array( 'key2' => 'value2', 'key57' => 'value57' ) and preserve keys. I know array_filter() function, but I do NOT want to EXC...

jquery plugin to edit table cells in place and save to file (also select diff kinds of inputs)

I am generating a html table from a mysql query (generates a new flat html page) Is there a plugin that i can use that will let me click/edit individual cells and save that data and refresh the content (important, cause i scrape the page and write to file later) but i also need to be able to select individual input types, some are simpl...

Making sure PHP substr finishes on a word not a character.

Hi I know how to use the substr function but this will happy end a string halfway through a word. I want the string to end at the end of a word how would I go about doing this? Would it involve regular expression? Any help very much appreciated. This is what I have so far. Just the SubStr... echo substr("$body",0,260); Cheers ...