php

Integrating external scripts with Zend Framework

What is the best way to integrate an external script into the Zend Framework? Let me explain because I may be asking this the wrong way. I have a script that downloads and parses an XML file. This script, which runs as a daily cron job, needs to dump its data into the database. I am using Zend Framework for the site which uses this scri...

POST data to a PHP page from C# WinForm

I have a winForms NET3.5SP1 app, and want to POST data to a PHP page. I'm also going to be passing it as JSON, but wanted to get straight POST working first. Here is the code: Person p = new Person(); p.firstName = "Bill"; p.lastName = "Gates"; p.email = "[email protected]"; p.deviceUUID = "abcdefghijklmnopqrstuvwxy...

Zend Framework Updates?

How long do you normally test an update for Zend Framework before pushing it out into a productions project. We can break this question up into minor updates 1.6.0 -> 1.6.1 or maybe a major update 1.6.2 -> 1.7.0. Obviously you don't release it if it add bugs to your code. Also, as with most other server software updates normally peopl...

Most efficient way to delimit key.

Say I have a string of 16 numeric characters (i.e. 0123456789012345) what is the most efficient way to delimit it into sets like : 0123-4567-8901-2345, in PHP? Note: I am rewriting an existing system that is painfully slow. ...

What is the best way of converting a Microsoft Word document into XHTML?

I would like to programatically convert a Microsoft Word document into XHTML. The language of choice is PHP, so I would appreciate any suggestions with PHP. The initial idea is trying to convert the doc file into odt, and then use the Odt2Xhtml PHP class to get it into XHTML format. Any better way to do this? ...

Variable variable class extensions in PHP--is it possible?

Is something like the following possible in PHP? $blah = 'foo1'; class foo2 extends $blah { //... } class foo1 { //... } This gives an error. I want to dynamically set $blah so I can extend whatever class I want. Edit: The reason for wanting to do this because I wanted to use a function out of another class in a related cl...

How to send serialize form data using JQuery if the input element is an array

I have this piece of code in my PHP code: while ($row = mysqli_fetch_assoc($result)) { extract($row); echo "<tr>"; echo "<td bgcolor='#FFFFFF'><input id='bookArray[]' name='bookArray[]' type='checkbox' value='$book_id' />$book_id</td>"; echo "<td bgcolor='#FFFFFF'>$threat_name</td>"; echo "</tr>"; } In HTML page, I...

PHP can't open local file when called externally

I'm using the WorldPay payment gateway on a website I'm working on. It handles all the credit card authorisation, and then calls a PHP file on my server with information about the transaction. It grabs the output from my script and displays it in the WorldPay chrome. I don't know the inner workings, but I imagine that they'd be using so...

ASP.NET vs. PHP

What is the biggest advantage of ASP.NET over the PHP. Why should I switch to ASP.NET? EDIT: I just want to understand the point behind the Joel's example: If ASP.NET is a Lexus, then PHP is a bicycle. ...

Updating Zend_Auth_Storage after edit users profile

Hi, I have following situation: I have loged user, standard authentication with DB table $authAdapter = new Zend_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter()); $authAdapter->setTableName('users'); $authAdapter->setIdentityColumn('user_name'); $authAdapter->setCredentialColumn('password'); When user edits his profile, I ...

Is there a way to see a prepared query as it will be executed on the database?

I'm using the mysqli extension in PHP and I'm wondering, is there possibly any way to see a prepared query as it will be executed on the server, e.g. The query is something like this select * from table1 where id = ? and name = ? but I want to see the query after the values are filled in, like this: select * from table1 where id = 20...

How to do HTTP POST in Utf-8 -> php script -> mysql

I am using Delphi 7 and ICS components to communicate with php script and insert some data in mysql database... How to post unicode data using http post ? After using utf8encode from tnt controls I am doing it to post to PHP script <?php echo "Note = ". $_POST['note']; if($_POST['action'] == 'i') { /* * This code will add ...

php being called from JavaScript

hello, i have a html file calling this JavaScript. var xmlHttp function GetEmployee() { xmlHttp=GetXmlHttpObject() if(xmlHttp==null) { alert("Your browser is not supported?") } var url="get_employee.php?" url=url+"cmd=GetEmployee" url=url+"&sid="+Math.random() xmlHttp.open("GET",url,true) xmlHttp.send(null) } function FetchComplete() {...

WINMOBILE uploading a file from C# to a php webservice

I need to upload a file using C# from a windows mobile app to a website. It's running PHP as the webservice on the other side, though I guess it really doesn't have to if there's another way to be able to get the file up there. There is no server-side ASP support, however. My problem really isn't the PHP, it's the mobile C# code. Also,...

Can I stop settings in vimrc from being overwritten by plugins?

This question follows on from this vim search question I have a setting in my .vimrc which excludes $ as a valid part of a word: set iskeyword-=$ This works fine for most files but isn't working in PHP. I assume it is being overwritten by a php plugin, but since plugins are loaded after .vimrc I can't work out how to overwrite this s...

What PHP-specific questions would you ask in a job interview?

We're having a PHP freelancer come by next week, and are assuming he knows his way around PHP. But of course, we would like to make sure. What questions would you ask a candidate in a PHP job interview? Would you have them write some sort of bubblesort op paper, without the aid of a computer? Would you ask array-specific questions, OOP ...

When should you start using Memcached?

Hi, I'm starting to learn about using Memcached with PHP and I was wondering; is there a point at which you should start using it? Is it always more efficient to cache data or does it only become effective once your site gets a certain number of hits? Presumably there is an overhead associated with Memcached, so when does the speed bene...

PHP Form not showing up in recipient's mailbox

Form does not go to recipient when submitted! I changed the file mail.tpl.txt to direct to my own email address as a test and I got the email just fine. Client has checked junk mail folder as well and he is just not getting information. Below is the form code, followed by the code from mail.tpl.txt and then the form's index.php code. ...

PHP session problem *only in IE* *(??? really strange problem)

I have a site made with php which uses server side sessions throughout the site. In fact, it's a site with a user login which depends on session variables and if there were a problem with all session variables, no pages would load at all. On the site, there's an iframe that holds a feed of little messages from other users. Those lit...

How do I create a dispatch table within a class in PHP?

Say I have a class with a private dispatch table. $this->dispatch = array( 1 => $this->someFunction, 2 => $this->anotherFunction ); If I then call $this->dispatch[1](); I get an error that the method is not a string. When I make it a string like this: $this->dispatch = array( 1 => '$this->someFunction' ); This pro...