Download Excel File containing Multiple Sheets
I want to download an excel file which contains three sheets using PHP. Can any one help me? ...
I want to download an excel file which contains three sheets using PHP. Can any one help me? ...
My main problem is that some output is coming on the page with a space character written as " ". I want to replace it back with a space. I tried str_replace(" "," ",$mystr) and even preg_replace("/( )/", " ", $mystr) but to no avail. How do I do this? And more generally, if there are other html codes coming as output, like ...
Hello everyone. Here's my question for today. I'm building (for fun) a simple templating engine. The basic idea is that I have a tag like this {blog:content} and I break it in a method and a action. The problem is when I want to call a static variable dynamically, I get the following error . Parse error: parse error, expecting `','' or ...
Someone has spoofed my site (taking the .org and putting in pitures of aborted fetuses), and I'm unable to get it down. But the idiot kept all the links on the front page, so as soon as someone clicks a link, they're taken from that site to mine. I want to display some code that says "NOTICE: YOU HAVE COME FROM A SPOOFED VERSION OF OUR...
Hi all! I'm writing an MSN client in PHP. This is my code for so far: $socket = fsockopen("messenger.hotmail.com", 1863); echo '<b>Connected to 1st server.</b><br />'; //Send MSNP version fputs($socket, "VER 0 MSNP10 CVR0\r\n"); echo fread($socket, 5000) . '<br />'; //Send user-agent fputs($socket, "CVR 1 0x0409 php ".phpversion()." i3...
I need to get the keys from values that are duplicates. I tried to use array_search and that worked fine, BUT I only got the first value as a hit. I need to get both keys from the duplicate values, in this case 0 and 2. The search result output as an array would be good. Is there a PHP function to do this or do I need to write some mul...
I am trying to get my install of PHP under IIS to display errors, but I'm having no luck at all. I tried error_reporting(E_ALL); in the script, and nothing shows up, just a blank screen. I tried editing my PHP.ini file and setting error_reporting = E_ALL display_errors = On Also tried error_reporting = E_ALL display_errors = st...
Hi , i think i cant see the tree in the wood.. Iam using Zend Framework, with an layout.phtml wich is rendering and partial <?php echo $this->partial('_header.phtml') ?> My goal is to render an form from my IndexController into the "_header.phtml" with <?php echo $this->form; ?> How can i pass the form to the partial view? ...
Hi. I have this very simple function... function send_mail($to, $from, $from_mail, $subject, $message) { if ( empty($from) || empty($from_mail) || empty($subject) || empty($message) ) { return -1; } if ( isset ($_SESSION['last_mailed']) ) { if ( $_SESSION['last_mailed'] + 180 < time() ) return -2; } $_SE...
I've got an instance of a DB object that's passed to a Session object, because the Session object has several methods that make use of DB object to execute SQL statements I had plan to store this DB object in Session object property. Through testing I found that print_r exposed the DB object stored in the Session object property; includ...
In my project I get back a name of a person through a php response. And I store that name in a variable. So the name could be like James Smith or Sakhu Ali Khan or anything else. I want to replace the spaces between the names with "." Suppose I get the James Smith and I will save it in $userName Now I want to parse $userName and th...
In C# and other languages, I can do something like this $value = $obj->getArray()[0]; But not in PHP. Any workarounds or am I doomed to do this all the time? $array = $obj->getArray(); $value = $array[0]; ...
I have a string Action - [N]ew, [U]pdate, or [D]elete : N that I need to replace with "Action - [N]ew, [U]pdate, or [D]elete : U" somhow by using preg_replace I can't get it working. It remains the same. My code looks like this $action = Action - '[N]ew, [U]pdate, or [D]elete : U'; $line = preg_replace("/(Action - [N]ew, [U]pdate, or [...
The website is http://www.ipalaces.org/support/ The code I use for the status indicators is <img src="http://big.oscar.aol.com/imperialpalaces?on_url=http://www.ipalaces.org/support/widget/status_green.gif&off_url=http://www.ipalaces.org/support/widget/status_offline.gif"> which is a neat thing that big.oscar.aol.com lets yo...
Hello, I currently have the following query: SELECT group_concat(DISTINCT usrFirst, usrLast) as receiver_name //etc When using PHP, it outputs my list of names as follows: <?php echo $row['receiver_name']; //Outputs: JohnDoe,BillSmith,DaveJones //Desired ouput: John Doe, Bill Smith, and Dave Jones Basically, I nee...
Hi all! I'm making an MSN client in PHP. I have this code, which connects to a server and logs in to MSN: $server2 = explode(":", $xfr[3]); $socket2 = pfsockopen($server2[0], (int)$server2[1]); $_SESSION["socket"] = $socket; echo '<b>Connected to 2nd server.</b><br />'; //Send MSNP version fputs($socket2, "VER 0 MSNP10 CVR0\r\n"); echo...
I'm starting to move some sites to WordPress hosted in IIS7 using PHP 5.3 & FastCGI. I'm quickly finding that while the core of WordPress seems to work just fine out of the box, there are a number of plugins that have issues running in IIS and I'd like to be able to debug them, fix them, and submit patches. The only solution I've found ...
Hi, I need to parse PHP & JavaScript documents structure to get the info about document functions & their parameters, classes & their methods, variables, and so on ... I'm wondering if there is any solution for doing that (no regular expressions) ... I've heard about something called "lexing" however I was unable to find any examples eve...
Hello, I've inherited a significantly sized internal app at the company I work for. It has two parts. One runs on a LAMP server, the other runs on a WAMP server. There is no source control to be seen. Currently, developers will log into each server via FTP and just directly edit the PHP files that are there. Or log into phpMyAdmin ...
Hi, I have an includes.php page that I load at the start of every page of my website. As I develop the website, the number of classes that I am using is growing. So I end up with something like this: $db = new DB($config); $login = new Login($db, $config); $form = new Form($db, $config); And the list goes on and on. I have two questi...