php

Zipping .htaccess files

Hi. I zip some files on the server with kohanaphp and the archive module, all works fine but the zipped .htaccess files are gone after unzipping. Thanx for help. ...

htaccess not called when the url point to an existing folder

Hi, I'm running zend server on windows 7. I'm using the htaccess from jooml: Options +FollowSymLinks RewriteEngine On RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR] RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR] RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR] RewriteCond %{QUERY_STRING} GL...

CakePHP 1.3 inflections?

Where do I put my inflections in CakePHP 1.3? I am new to Cake ...

Is there a way to get `true`/`false` values from a Boolean in PHP

When I cast to Boolean (using (bool)), is there a built in way to get PHP to actually return the constants true or false. At the moment I'm getting 1 or blank, which evaluate to true and false respectively. I want the value returned for clearer semantics. However, if I can't get it, I'll just settle with 1 and blank. Update I've reali...

Can get move_uploaded_file to work

Cant seem to make php move_uploaded_file function to work. $MAX_FILESIZE = 5 * 1024 * 1024; $rEFileTypes = "/^\.(jpg|jpeg|gif|png|pdf|xls|xlsx|ppt|pptx){1}$/i"; $isFile = is_uploaded_file($_FILES["prodImage"]["tmp_name"]); if($isFile) { ...

How to proxy a page and step out of the loop?

I have a service (in PHP): A User browser accesses Private URL at the Service Service decodes Private URL and fetches page from a Client Server (Curl) Service modifies page from Server according to Private URL info in a database Response headers (content length, set-cookie[server-domain]) Add a <base> tag for relative href's Add javas...

Method as target of {if} in Smarty

Is there a way to use a method call of an object as the target of a conditional in a Smarty template? As a concrete example, I have an object $user with a method loggedIn(). I want to use this method to show extra info if the user is logged in. I can assign the return value of this method to a temporary variable and use this as the tar...

Drupal: Duplicate search block?

I want to duplicate the default search box and put it between some blocks on my left sidebar: so it would show up on every page twice ( top where it already is and on the left mid-sidebar ). Is there an easy way to clone it and then make sure the IDs arent duplicates? ...

PHP sending emails

In my application we have a lengthy script that writes multiple records to a database, copies multiple files from one location on the server to another then sends multiple emails. Weve noticed that intermittently the process will timeout. After some debugging we noted the timeouts generally occur during sending the mail, we are using PH...

How to use anonymous functions in PHP5.3

I recently really wanted to us anonymous functions in PHP. Unfortunately my host is still on 5.2. I automatically thought this would work: uasort($array, function($a, $b) { return $a > $b; }); Is this how they work? Simply passed in as an argument instead of a callback? The docs don't say specifically that's how they do, but I hav...

setting maximum value for a text box in php

hi how to set a max value for a text box in javascript ..... eg.. the value must be with in 100... no greater value must be entered i my task i am using two text box where i am inserting marks ... the first text box my marks will be out of 80 the second will be out of 20 i am calculating the total of 1st and 2nd mark and the r...

Htaccess Rewrite Not Found

I'm using Mod Rewrite to remove index.php. I do not want to use queries. I want foo.com/bar to be interpreted as foo.com/index.php/bar. It does this fine, but gives me Not Found error. The requested URL /home/foo/www/index.php/bar was not found on this server. Why!! ...

function behaving differently in diff environments

Environment 1: Working PHP(5.2.4) MySQL(5.1.30) Environment 2: Not Working PHP(5.2.6) MySQL(4.1.25-log) What is it about this function that makes it work in environment 1, and not in environment 2? No errors, just not returning anything. function GetPrice($type, $level){ $result = mysql_query("SELECT * FROM `types` WHERE id = '$typ...

String in between an array?

ok so I have an array with an unknown array amount. so like it can be $array[0] = "a" $array[1] = "b" $array[2] = "c" and what I want is the possibility to make an extra array in between each one, so like $array[0] = "a" $array[1] = "1" $array[2] = "b" $array[3] = "1" $array[4] = "c" $array[5] = "1" ...

Magento guest checkout won't make it to shipping info

For some odd reason when people try to use guest checkout it just allows them to enter billing information then when it supposed to go to shipping... it just loops back to the first checkout page... the the process keeps repeating anyone know where this may be coming from? the site is a2iwheels.com/checkout/onepage/ ...

Could browsing the PHP source code help a PHP developer learn C?

I've started checking out the source code for PHP. I have just started trying to learn C, and since I have a good working knowledge of PHP, would dissecting typical functions I use daily be of great benefit? Or is this likely to be too in-depth for a C beginner? Also, where are most of the functions defined in that source I linked to a...

how to count total number of divs with in a div using javascript

how to count total number of divs with in a div using javascript ...

click pay now in paypal page update my database too

I have a table to store my credit from user has been paid. credit +id +amount My goal is when you user click on button pay now in paypal page I have abiltity to update my table the amount field. Anybody know the ways to do this, thanks EDIT: look at this code http://www.micahcarrick.com/04-19-2005/php-paypal-ipn-integration-c...

How to update the cookie value using Jqury?I dont want to update the cookie expire time?

I have the cookie for delete Option.But wheen the user undo the i want to upadte the cookie.The cookie when created its expire is 5 min. ...

How to encode 2 dimentional PHP array to Javascript Array?

Here's my problem, i have a php array like this: $output = array(array(1,1,1,1),array(2,2,2,2),array(3,3,3,3)); after the array was encoded to json i got this: $output = {"1":[1,1,1,1],"2":[2,2,2,2],"3":[3,3,3,3]} all i want is to pass the PHP array to Javascript so that the JS looks like this: var output = [[1,1,1,1],[2,2,2,2],[3...