php

How to trigger an event on payment received in magento?

Greetings, in Magento I want to trigger an event, once an order has been set to processing (by gateway confirmation or manually) that, example: If a general customer (id 1) spends over 100$ and the payment has been confirmed, set his group id to 4 (silver VIP, which by promotion rule gets 2% discount globally) I would give a bounty to th...

openinviter plugin problem

Hi, I am using openinviter plugin which i got from http://openinviter.com. It works fine. But it does not show anything when contacts are more..like 2000 When i pull contacts from twitter,it only shows some latest contacts..i dont know where are other contacts.. can anyone help me with this?This is the critical part of my site..Ple...

How do I get response codes from Authorize.net with Koahana's payment module?

that's about everything I need to ask: after u call the process() method, I want to get Authorize.net response codes and text. Or is that not included in the library. All I can see are set_field() and process() methods ...

PHP readdir and sort

I'm making a little gallery. I want to read the file names off a directory and print the file names below after I've stripped some leading numerals and file extensions. I have two versions of the code. Version 1 doesn't sort $current_dir = "$DOCUMENT_ROOT"."/weddings2/"; $dir = opendir($current_dir); // Open the sucker whil...

accessing speicific array elements with jquery

If my PHP returns a array with 6 elements how would I access each of them specifically in jquery? For example I want to create: var itemOne = value of first array element; var itemTwo = value of second array element; ... $.get('ajax/employee_menu.php', { job: $('#job').val() }, function(data) { //i want to ...

Do headers slow down PHP code?

If you have a large class that executes after output(headers/text) is already sent, will that have any affect on your applications performance? Edit: To clear things up, when output is sent, default headers are sent with it. ...

CakePHP: Numbered Paginated Results

The title is a bit wonky but it's the best I could come up with at 4 in the morn'. I have a table of links that I am paginating, nothing fancy. Let's say there are 100 links that are displayed 20 a page for 5 pages. How can I number each link starting with 1 and ending with 20 on the first page and if we skipped to the last page would...

PHP, set bounce back email address

When using PHP to send email, how can I set the return path for receiving bounced back emails? ...

Can somebody illustrate what is "Pixel Tracking" in php?

Well, I encountered this new term in programming. What is it? How does it works and how to use it? Can somebody illustrate in php? I have a website, full flash. That site is for signup, enter username and email. The button is in flash. An user visit my site, www.domain.com/index.php?var=string Can I use pixel tracking method to pass t...

regex: match string only if not part of a tag

Hi, I am trying to match a string only if it is not part of an html tag. For example when searching for the string: "abc". <a href="foo.html">abc def</a> should match <p> foo bar foo abc foo bar</p> should match but <a href="abc.html">foo</a> should not match. Thanks for the help! ...

Automating HTML font embedding PHP backend

Hi, I understand that css3.0 supports the Font-Face tag, correctly in the latest Opera, Safari, and Firefox browsers, but that Internet Explorer still requires the microsoft .eot format. Is there a reliable way to generate an eot file server side from a .ttf given that the hosting server may not be Windows? I need the entire process a...

Writing data-accessing code in PHP

I am a frontend developer who also does some backend work. I want to write an entire web app in php. Somehow, my backend team is hell-bent on using EJB, Struts etc... Their reason for not using php is this -> "it is not advisable to write data-accessing code, that has queries etc.. in php. the backend is better written in ejb it is more...

script for cropping images

Hi! I have many (about 1000) images (printscreens), and I need to crop these images (all cropped images are in the same region in the full image). How can I do this in php? Or maybe GIMP is supporting some macro scripts to do this? Thanks in advance. ...

Problem retreiving array values in jquery

My code: $.get('ajax/time_menus.php', { shift: $('#shifts').val() }, function(data) { //load the array into a test element so we can see what is returned $("#test").html( data ); //set the hour menu var startHour = data[0]; alert( startHour ); $('#from_hours').val( data[0] ); ...

PHP Simplexml failing on localhost

Hi. I'm editing a mashup of mine where I fetch last.fm data through their API (xml). For some reason, my localhost can't connect to the file: it gives the following error. failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection ...

Make Automatic Links in a Text from File : Like Internal Wikipedia - PHP

Hello, I want help on this script I am making... I want my website to be a wikipedia in itself... take for example I have a php website... I publish daily articles on it. Suppose I publish 2 articles on Jenna Bush and Michael Jackson respectively now I save into text/xml/database text and link example jenna bush, http://www.domain....

How does the PHP IteratorIterator class work?

Try as I might I cannot get my head around what the IteratorIterator class actually does. I understand that classes can implement Traversable so the engine knows it can loop using foreach and I realise that IteratorIterator is supposed to convert anything that is Traversable into an Iterator but I cannot for the life of me understand how...

Regular expression problems

I need some help with some regular expression problems I am having. First off, double quotes ". Anything between "" needs to be matched. Next problem I need to match anything that starts with a ' till the end of a line \n or <br />. I've tried all sorts, but nothing seems to match it. Any ideas? Sorry guys, just realised I need the qu...

Secure authentication in PHP

Let me rephrase my last question, what PHP library or framework can I use for professional and secure authentication? Extra points if your idea helps implement account Control Panel features (change password, edit profile). How do you pros do it? Have you ever done trustworthy authentication using PHP? ...

Select the correct entry in a drop down list on the basis of database entry?

I have a simple Crud application where there is one filed called Category. During Creation , for Category I have provided a simple drop down box which lists all categories. During Editing, I need to get the same drop down box with the entry in the database chosen.How do i do this. For creation i used say <p><b>Category:</b>&nbsp;&nbsp;...