php

google check out cart customisation in place order page

hai I know we can customise the cart place order page by either customize the UI, or customize the cart itself via the API. iam interested in fisr method (UI) But i have still more doubts. I am using XML api. so where i put that code, otherwise any more answer.. Does any one tell me a solution ? ...

using prepared mysqli statements to bind parameters into the SELECT section of a query

I am building a web app that imports data from data feeds in php/mysql. I import the data into a buffer/temp holding table. As each data format is different I choose the column to select based on the particular source. I am having trouble getting this query to work in this context : $stmt = $this->dbObj->prepare("SELECT mk.PK_phone_mak...

what is the difference between php.ini and .httdaccess

assume if i want to change the value of php_value post_max_size 20M in .htaccess post_max_size 20M in php.ini both will do same operation , so what is the difference between php.ini and .htaccess Thanks ...

PHP to calculate the number of office hours between two dates

We run a service that's based on a 2 business day SLA, so if the request is submitted at 1pm on Monday it should be completed by 1pm of Wednesday. So in the database I have two MySQL timestamps YYYY/MM/DD HH:MM:SS, and need some way of working out the time between the two dates in working time, based on office hours of 9am till 5pm. Ca...

How can I integrate xajax with CakePHP?

Did anybody successfully integrate xajax with CakePHP? I've found 'Cakex plugin', but I'd like to hear some options. ...

Why do most PHP frameworks use set/get for Session variables?

I am very curious as to why all the main PHP frameworks like zend use setter and getter methods to set and get basic $_SESSION['user'] variables? I am doing it myself right now but I really don't know why I am, other then the fact that I see it being done fairly often by others now. So in theory at least, it seems like wrapping these i...

How to determine whether a variable is a decimal and it is less than 0.01 in PHP?

How to determine whether a variable is a decimal and it is less than 0.01 in PHP? If I write if($balance<0.01) Will a true value be returned if $balance is not a decimal at all? ...

Most efficient, safe way of dealing with a large number of $_REQUEST variables in php

I have a form that submits a large number of inputs... <input type="hidden" name="searchTag_happy" value="0" /> <input type="hidden" name="searchTag_sad" value="0" /> <input type="hidden" name="searchTag_ambivalent" value="0" /> etc . . . The value attributes for these inputs can be either "0" or "1". I would like to use this informa...

Confusing PDO-only problem : Can't connect through socket/Access denied/Can't connect to server (shared host)

Hi, folks ! So the problem changed from what it was, i'll leave the original question below to prevent bad reviews on answers like I had after someone editing his question I answered : So I am working on a (really lame) shared hosting which has PDO installed, but it doesn't work. With default parameters <?php try { $dbh = new PDO(...

LAMP Whitescreen on Magento

First off, sorry if this shouldn't be on Stack Overflow, and instead should be on Server Fault / Super User. I am pretty sure it is a programming issue... I am getting a whitescreen on a Magento install for a PDF generation script. I usually attribute whitescreens to memory issues on Apache, but: I am getting no visible errors (disp...

Is it possible to insert a comment tag into an xml using simplexml?

I am using SimpleXML to build a document, and wondering whether it is possible to insert comment tag to the document like this: <root> <!-- some comment --> <value> </root> EDIT: The comment is somewhere in the middle of the document. <root> <tag1 /> <!-- some comment --> <value /> </root> ...

Encrypt jQuery javascript file

Hello, I have a whole range of jQuery code, how do I stop users from seeing the actual code, or how can I encrypt the .js file. Please suggest opensource Thanks Jean [edit] I don't want users to know how I have coded or copy my code [edit] Once I use the base62 encode, can it be reverse engineered? ...

insert then update inside loop

Hi Guys, I have a php script, I use it to be run in as cron job. When this script running it takes about 13 minutes on 16000 user records. Please advice me to make this script running with the best performance. I need to know that if there is any problem if i put update then insert inside a loop, or insert then update inside a loop. ...

javascript array to php

i want to send a javascript array to php using jquery ajax. $.post("controllers/ajaxcalls/users.php", { links: links }); where the second 'links' is a javascript array. when i've got this array: '1' ... '1' => "comment1" '2' => "link1" '3' => "link2" '4' => "link3" '2' ... '1' => "comment2" '2' => "link4"...

Treemap visualisation with PHP?

There seem to be examples for TreeMaps for almost every language but PHP. Has anyone got a link to some basic code? ...

Replace non-html links with <A> tags

I have a block of code that will take a block of text like the following: Sample text sample text http://www.google.com sample text Using the preg_replace_callback method and the following regular expression: preg_replace_callback('/http:\/\/([,\%\w.\-_\/\?\=\+\&\~\#\$]+)/', create_function( '$matches', '$url =...

Post serialized form data and extra variables using JQuery

I am trying to use this piece of code to serialize a form AND send an extra variable not found in the form, at the same time. The following line of code is what I expected, but sadly does not work. var thePage = theFilename(); $.post("pagedetail.php", { $("#PageDetailForm").serialize(), thePage: thePage }, function(data) { a...

Compare domains in php

I wrote a small script that provided a URL (For example: code.google.com/ajax/123/1235/214) Would tell you that the actual domain is: code.google.com When this is compared to code.google.com it return true of course, i want it to return true when it is compared to (anything).google.com So, i want it to return true whenever the actual do...

Is there a more efficient method than transactions?

insert into table1 ...; update table2 set count=count+1; The above inserts something into table1, and if it succeeds, updates the count field of table2. Of course this kind of thing can be handled by transactions, but transactions need to lock the table, which will be not efficient in a high concurrent system. And it can be even wors...

Downloaded file not opening in correct format.

Hi everybody I have two php files 1. List_files ->show all uploaded files 2. Get_file ->to download files from listed files... Now when i download any image or any text document and try to open it it is not getting opened, Error is format not supported everytime. My image is .jpeg I am using Windows Vista with Firefox. No problem...