php

Variable Operators in PHP

Given this example, how would I return the result of the equation rather than the equation itself as a string? $operator = '+'; foreach($resultSet as $item){ $result = $item[$this->orderField] . $operator . 1; echo $result; } ...

How to fetch message body and attachments in XML format using php/linux from Lotus Domino server?

Has anybody some information about accessing Lotus Domino server to fetch entire mail contents by http(s) requests from php linux server? The article by Andrei Kouvchinnikov describes well how to fetch message list in notes mail folders; after obtaining session id during login one can for example select top 100 messages by calling: htt...

Image save in database

I want to save an uploaded image to database. Now my question is: What should be the data type for SQL Server 2000 for image? a. image b. varbinary what is the code for saving image in database? How to retrieve the image from database and show? Please refer me any tutorial or guidline. Or if you can please share with me. Thanks in a...

post image and other data using mulipart form data in iphone

Hi all I am sending some data and and an image to the server using multipart/form-data in objective C. kindly give me some Php code that how can i save the image on the server i am able to get the other variables on the server that i am passing with the image. kindly see my obj C code and php and tell me where i am wrong. your help wi...

Access XML file using PHP

Hello, I have a xml file which has an entry <content type="html"></content> Can I access it as echo $result->content; If not let me know , coz the above does not seem to be working, there are pics, which I want to display. Thanks Jean ...

MySQLi prepared statements error reporting

I'm trying to get my head around MySQli and I'm confused by the error reporting. I am using the return value of the MySQLi 'prepare' statement to detect errors when executing SQL, like this: $stmt_test = $mysqliDatabaseConnection->stmt_init(); if($stmt_test->prepare("INSERT INTO testtable VALUES (23,44,56)")) { $stmt_test->execute(); ...

how to get key value of array with curl (php)

Hello I want to make use of an API but it print alot of info and i don't know how i can get a few key values of the array. <?php $query = "SELECT * FROM kvk WHERE adres='Wit-geellaan 158'"; $host = "http://api.openkvk.nl/php/"; $url = $host ."/". rawurlencode($query); $curl = curl_init(); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, ...

PHP - Creating a simple array

Yes I'm a n00b! Now that's out of the way, I have the following code: $page=3; $i=1; while($i<=$pages) { $urls .= "'"."http://twitter.com/favorites.xml?page=" . $i ."',"; $i++; } What I need to create is this array: $data = array('http://twitter.com/favorites.xml?page=1','http://twitter.com/favorites.xml?page=2...

Datamining on a mysql database

Hello, I Begin with textmining. I have two database tables with thousands of data.. a table for "skills" and a table for "skills categories" every "skill" belongs to a skills categorie. a "skill" is , physicaly, a varchar(200) field in the database, where there is some text describing the skill. Here are some skills extracted from ...

Problem getting Params in injected controller Zend Framework

I have a layout 'profile' <div> <div> $this->action(action1, controller1, module1)<div> <div> $this->layout()->content </div> <div> $this->action(someotheraction, soController,soModule ); </div And the problem starts when I want to get the $request->Params() from the action1 , controller1 module1 , it is empty. I looked a...

How to get the page in a variable which is going to be displayed in Wordpress ?

I want to get the content which are displayed by a particular page in WordPress back-end. Say, for [ROOT]/wp-admin/profile.php I want to remove the First Name and Last Name fields from this page. So, I can run a str_replace() to remove the lines. In this case, I have $search and $replace ... but I need $subject [Ref - http://php.net/m...

Pass associative arrays in call_user_func_array(...)

Hey all, I'm building a templating system and I'm running in to an issue with calling functions on the fly. When I try the following: $args = array( 4, 'test' => 'hello', 'hi' ); You know.. some numerical elements some associative elements, call_user_func_array($function, $args); converts the array to something like ...

\w in PHP preg_replace covers only second byte of UTF-8 chars

we have this code: $value = preg_replace("/[^\w]/", '', $value); where $value is in utf-8. After this transformation first byte of multibyte characters is stripped. How to make \w cover UTF-8 chars completely? Sorry, i am not very well in PHP ...

Explanation of this SQL sanitization code

I got this from for a login form tutorial: function sanitize($securitystring) { $securitystring = @trim($str); if(get_magic_quotes_gpc()) { $securitystring = stripslashes($str); } return mysql_real_escape_string($securitystring); } Could some one explain exactly what this does? I know th...

WAMP phpundercontrol installation guide / tutorial

Our team just thinking to start using php unit test for our problem. I not able to find a complete tutorial or installation which is install phpundercontrol in WAMP environment, I have no any experience about php unit test, but we know we need it. Our goal is everyday we would like to build the project, so we know where is the bug happ...

PHP script to send email invitations to join a site

Hi, Are there any popular scripts to send invitations to join a website, to user's address book contacts? When he enters email ID and password, it should grab all contacts and email each one using swiftmailer. I only need the grabbing part :) thanks ...

shell_exec(),exec() on php is not working

i disabled safe_mode by off value and tried with shell_exec(),exec() both functions on 1and1 dedicated server its not working, even its working in another server. ...

Stub PHP native methods

In my unit test, i'm looking to stub the behaviour of php's inbuilt file_get_contents() method. Is there a way to stub native methods in PHP (such as file_get_contents() or print_r()) and the likes? ...

PHP: Splitting an array into a deeper array

Hello, I have the following array: Array( [0] => 0,0 [1] => 0,1 [2] => 0,2 [3] => 0,3 [4] => 1,0 [5] => 1,1 [6] => 1,2 [7] => 2,0 [8] => 2,1 [9] => 2,2 [10] => 2,3 ) And I would like to split it into the following structure: Array( [0] => Array ( [0] => 0 [1] => 1 [2] => 2 ...

Facebook application, how to check if inside Facebook canvas / standalone using PHP?

Hi there, I want to develop a Facebook connect application that can operate both inside a Facebook canvas or standalone. Can I check if the user is using Facebook canvas / not using the official Facebook PHP client library? Thanks, Andree ...