php

PHP rename array keys in multidimensional array

In an array such as the one below, how could I rename "fee_id" to "id"? Array ( [0] => Array ( [fee_id] => 15 [fee_amount] => 308.5 [year] => 2009 ) [1] => Array ( [fee_id] => 14 [fee_amount] => 308.5 [year] => 2009 ...

Security implications of session strings that are not stored in a server database?

This time I am going to be brief :-) Instead of issuing randomly generated session strings to a user and inserting them into database, mapping these to user identifiers, for subsequent lookup on every authentication, why not do the following, with the intention to avoid database access on every request and distribute the session store i...

AJAX UPDATE + PHP + IE = Fail?

Following from this thread: http://stackoverflow.com/questions/2209260/another-ie-jquery-ajax-post-problem (please read the thread to understand this one) Now i've got an solution for the thread above.. But, the ok.php (the site it updates each 10 seconds, with AJAX script) Doesn't show in IE if the response contain HTML code. With this...

PHP's array_merge_recursive behaviour on integer keys

Evening all, Can someone suggest an approach for recursively merging arrays, in the same way as PHP's array_merge_recursive() function does, except that integer keys are treated the same as string keys? (its important for the process that the keys remain parse-able as integers) For example: $a = array( 'a' => array(1) ); $b = arr...

Password is not getting changed in php.Plz check the code..

I have link change password in my home page..NOw i am telling you what i am doing... First of all i creating a html form named edit_profile.php in which i have three textboxes old password,new password,confirm password.I have attcahed this page as a link to home page for changing password. Next page i have designed named edit_profile1...

Do the math sum of a text variable? (E.g 5865/100 )

I have a variable that is... $whatever = "5865/100"; This is a text variable. I want it to calculate 5865/100 , so that I can add it to other numbers and do a calculation. Number_format doesn't work, as it just returns "5,865". Whereas I want it to return 58.65 I could do... $explode=explode("/",$whatever); if(count($explode)=="2")...

How do I map different server names to differrent DirectoryIndex in PHP Symfony?

Symfony uses the following typical .htaccess file: Options +FollowSymLinks +ExecCGI <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [QSA,L] </IfModule> and I have this as my vhost: <VirtualHost 1...

Sharing Servlet session with PHP

I want to use a Java EE application server (GlassFish 3) as SSO service for both Java applications and PHP applications. If a user gets authenticated by GlassFish he should also be logged into the PHP applications. Is there a best practise to share the Servlet session (more precise: authentication status) with PHP? ...

Update Facebook status externally using PHP with username and password of an User

Is it possibile to update the status of facebook externally using a user's username and password with PHP. without any user interaction(like facebook connect). Also without using curl. I know there are come facebook mobile clients like snaptu. how do they access inbox, wall and our status just knowing the username and password.?? Than...

Can't get all values from mysql table

I have this table: option_values table: option_id (FK) value_id (PK) classified_id (FK) value example: option_id (FK) value_id (PK) classified_id (FK) value 1 1 22 'Petrol' 2 2 22 'Manual' 3 ...

PHP mail with attachment - extra file: part 1.4

Hi. I'm using the following code to send an email with attachments: $mime_boundary = "<<<--==+X[".md5(time())."]"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: multipart/mixed;\r\n"; $headers .= " boundary=\"".$mime_boundary."\""; $message .= "This is a multi-part message in MIME format.\r\n\r\n...

Request to php file from Flash hangs in Safari

The last two days we've been going over this problem for several hours to figure out what's going on and we can't find any clues. Here's what's happening; We have a Flash application that allows people to place orders. Users configure a product and an image of that product is generated by Flash on the fly and presented to the user. When ...

PHP Configuration: It is not safe to rely on the system's timezone settings.

Here a weird one. I just upgrade to php 5.3.0 and since the upgrade I'm getting the following warning: Warning: getdate() [function.getdate]: It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of tho...

pulling data out of many to many relationship

I've been grappling with this one for a couple of days now, but I've reached the limits of my admittedly limited mysql knowledge. I have two tables, groups and parties, using a lookup table groupparty with two columns groupid and partyid. Given a particular party, I simply want to pull out the groups associated with that party. Here i...

Svn hook encoding problem

Hey! I created a svn hook that calls a php script to send some emails. The problem is that I am getting incorrect encoded msg's (I think that's what you can call it) This is what I get in my mail: Modified files - /base/view.php Mais umas actualiza?\195?\167?\195?\181es This is what I get when the h...

How to get Content-type using html simple dom?

I tried find('meta[http-equiv="Content-type"]') but it failed to retrieve that information. ...

Reading EXIF/MetaData from CRW (or other RAW files) with PHP

Hi, Pretty much as the title says, I've had a search around but been unable to find anything. I can read TIFF and JPEG files, but I've not found anything to read RAW files. Does anyone know of anything PHP or otherwise that can do this (if otherwise, then something I can use with PHP). Many thanks, Mike. ...

Execute JAR in PHP

Hi Currently I have a website on my local computer that uses PHP to make a call to a .jar program. It works fine when I run it on my local machine. When I upload it to my host and try to run the same .jar file, I get no output... Do you know why this is? Do I have to change the PHP.ini on my remote host to allow jars to be executable ...

Dead-simple introduction to TDD (Test driven development)

Hello. Even though there are plenty introductions to TDD (even in PHP, my primary programming language now), I'm feeling a bit stuck about it. My friend introduced me TDD a while ago, but I wasn't actually able to understand it - what's the point in writing tests to everything first - even the simplest tasks - when in the end, it looks...

what programming language to learn, php, asp.net or jsp?

Possible Duplicates: Which Programming Language Should I Learn? Best language to learn (for a solo web designer looking to program) Is there a general guideline of which dynamic programming language to choose to start with? ...