php

Which XML-RPC Library?

There are at least two implementations of XML-RPC for PHP. Which is best and why? I've been using the one based on Edd Dumbill's work in the O'Reilly jellyfish book, but I find it extraordinarily awkward and verbose and very hard to debug. The version built into PHP looks a bit cleaner, but contains warnings that the extension is exper...

Validation of tab delimited csv file

I've a page where in I ask users to upload tab separated csv file. But how do i ensure that tab separated csv file is uploaded. I need php validation for this. Can anyone help? Thanks in advance. ...

PHP dynamic object property is there a way to make it work?

So I know I can do something like this in PHP: <?php $x = 'a'; $a = 5; echo $$x; Which will output 5; But it doesn't work with objects/properties. Is there a way to make this code work? <?php class FooBar { public $foo; public $bar; public function __construct() { $this->foo = 'foo'; $this->bar = 'bar'; } } ...

Maximum length for MD5 encryption

What is the maximum length of the string that can have md5 encription or Is it has no limit, and if so what will be the max lendth of the md5 encripted value? ...

How to paginate multiple results in CakePHP?

How can I use the paginatation helper in cakePHP to show more than one result set on the same page? They would page independently. EDIT: I found out one reason why it can't do that is because the pagination helper would get its URL from the controller/action and then appends its parameters at the end. If it pulled the url from the add...

Concatenate some Array Elements among many in PHP

I have an array "$abc" which has 9 elements, as:- Array ( [a] => Jack [b] => went [c] => up [d] => the [e] => hill [f] => but [g] => never [h] => came [i] => back ) Now I need to concat only the 4 elements starting from the "b" index to the "e" index only. But I don't know what to do. I used the "im...

need updation for mysql query for choosing date range for reservation of a hotel room or any thing

Hi every one, i had a situation in my project that is as follows. while checking for the available rooms $sel_from_bookings="SELECT room_no FROM `booking` WHERE (('".$_POST['req_tdate']."' BETWEEN check_indate AND check_outdate) OR ('".$_POST['req_fdate']."' BETWEEN check_indate AND check_outdate)"; $sel_from_reserv="SELECT room_no ...

How do I use JSON objects from Facebook with PHP?

Hiya! http://developers.facebook.com/docs/reference/api/event I'm trying to grab some values from a Facebook JSON even object in PHP. Namely, title of event, location, and people attending. Using the Graph API. <?php $jsonurl = "https://graph.facebook.com/331218348435?access_token=2227470867|2.rtBZMkVIVgKGZ7Xr4px3Dw__.3600.1280822400-...

Why I'm getting "cannot modify header information headers already sent by registration_model" error in codeigniter?

Hi there. I have a problem with model in my codeigniter app. I'm getting this error of sending headers information. Basically, codeigniter is complaining about my registration model sending header information before anything else. How is it possible? I thought that models are only for holding db queries methods and nothing more. Can some...

Generating XML from PHP

Hello, i need to generate XML structures on the fly using PHP. I've seen many different ways and libraries, but i would like to know which is the most efficient. In general i have arrays and its content has to be returned as XML structure. Thanks in advance. Greetings ! c. ...

Fetching data from server

Hi, i can use https to post data to apache2 server, is there any way of using https to retrieve some data from the server, running php script or something to return Thanks ...

Creating a table using jquery - can I then populate a field automatically once the first function is done???

I'm probably doing this all wrong but here goes.... I'm calling a php function with ajax to create a table with three columns. Currently the php function fetches all the data and creates a table which it loads into a div once the function is finished. The third column can only be created using data from the first two columns. Is ther...

how to find out if csv file fields are tab delimited or comma delimited

how to find out if csv file fields are tab delimited or comma delimited. I need php validation for this. Can anyone plz help. Thanks in advance. ...

PHP script ending early, no evidence of an error and timeout set to 0

Hi guys, time for another brain teaser of something I guess is quite rare. Is there a hard limit in PHP? Or in Apache? I had a script running last night which lasted around 20 hours. Then it just stopped, mid script on a random line with no errors that I could find. set_time_limit(0); was set in the script but I'm starting to wonder if...

How to calculate correctly in php ?

$total = 30 - $nr1 / 13 - $nr2 - 6 * $nr3 - 3 I know we learned that in school but what is first (+ or - or * or /), where are the brackets or do i even need them ? ...

Can you find which part of drupal handles form submit automatically?

No matter where the form is submited, the submited handler is called. Anyone knows this? ...

download gmail attachements from php

Hi guys, can you please tell , how to download attachments from gmail account using php ? thanks ...

Generating {$num} inside {foreach}

Hello, I working on smarty template. I need to have numbers to my list array So I tried {foreach} {$num} {/foreach} Which prints 0 1 2 3 4 5 ........ I want my numbers to starts from 1 & not 0 How can I achieve this? OR Is there any other way to do it ? Thanks ...

Doctrine - how to get the SQL INSERT query, in the postSave() event?

I would like to get the exact SQL INSERT query that Doctrine generates when an object's save() method is called. Preferably, I would like to get it in the postSave() event of the model and log it in a txt file. For instance: <?php $user = new User(); // A Doctrine Model with timestampable behavior enabled $user->first_name = 'Manny';...

SQL and PHP - Submit form with an ID in URL (in wordpress)

I've been trying to find the best way to do this for a while now but cannot figure it out. I have a simple dropdown which auto populates based on an SQL query. When you press "search" I need it to go to a page with the url extension ?id=x where x is the id of the option they selected. $locations = $wpdb->get_results( $wpdb->prepare( ...