{ Don't Repeat Yourself ! }

Have you tried to create a paypal button and pass a return URL to paypal that includes some paramters and experienced that paypal will only return visitors to your main page, ignoring your GET parameters ?

something like:

<input type=”hidden” name=”return” value=””>

will not work unless you also specify this parameter:

<input type=”hidden” name=”rm” value=”2″>

this will instruct paypal to post its own parameters as POST and keep your parameters as GET.

Or as explained in the Paypal documentation:

“a value of 2 means: the payer’s browser is redirected to the return URL by the POST method, and all transaction variables are also posted”

Hope this will help someone.

I created a simple Joomla! component. It’s purpose is to demonstrate how a Flex Application can be integrated into a component. The Flex Application is communicating with its Joomla! backend through AMFPHP. AMFPHP1.9 is included in this example setup.

You can download and install this component via the Joomla Administration Interface and link a menu item to it, to see it in action.

You can also download the source code for the simple Flex Application to see how it connects to the gateway.

download joomla component

download flex example source code

Here is a screenshot of the installed component:

  1. Go to the Apple Menu > System Preferences > Network
  2. Click the “+” symbol on the bottom left
  3. Under “Interface” choose “Bluetooth PAN“. Under “Service Name” put what ever you want. Click Create. Close the Network screen.
  4. Ensure Bluetooth tethering is On within your iPhone 3G/3GS and that Bluetooth is On within your Mac.
  5. Navigate to the Bluetooth menu item on the Apple Menu Bar and highlight your iPhone 3G/3GS and click “Connect to Network”.

It is not possible to use self closing div tags.
Browsers will interpret <div /> just as <div> , which will result in missing end tags.

So dont even think about something like:
<div style="clear: both;" />

Quite often Joomla views need information from more then one model. It is a bit unclear from the joomla documentation how to achieve this.

In a Joomla View Class, a call to:
$defaultModel = $this->getModel()
retrieves the associated default model instance. Joomla expects the model to have the same name as the view.

To retrieve another model instance it is possible to pass a model name as parameter:
$otherModel = $this->getModel('myothermodel')

But without additional instructions this will lead to an error because the view does not yet know about “myothermodel”. Before the above code will return a valid model, the view needs first to be informed about this model.

The only logical place to do this is in the controller class. Before instructing the controller to display the view in question, add the following lines:

$view = $this->getView('myview', 'html') ;
$view->setModel( $this->getModel( 'myothermodel' )) ;

replace “myview” and “myothermodel” with the appropriate names and now the view
should be able to retrieve a valid instance of “myothermodel”

one important thing to note:
I could only get it to work when the actual model filename is all lowercase.
E.g. MyModel.php could not be recognized by Joomla’s getModel method on my Linux system.
Only after changing the filename to mymodel.php is would work.

After some testing I found that the EncodeFile function within the phpmailer class is doing some strange magic_quotes stuff. It seems to screw up something and this results in missing content when sending mails with attachments using phpmailer with amfphp.

I just removed all the magic quotes stuff and this simple function seems to work fine for me now:

/* fix for using phpmailer and amfphp together on php5 **/
private function EncodeFile($path, $encoding = 'base64') {
return $file_buffer = $this->EncodeString( file_get_contents($path) , $encoding);

I tried to install the pecl oauth extension on my debian box today with the command:

pecl install Oauth-0.99.9

and ran into a few problems:

  1. ERROR: `phpize’ failed – Solution:  apt-get install php5-dev
  2. sh: make: command not found – Solution:  apt-get install make
  3. make: *** [oauth.lo] Error 1 – Solution:   apt-get install libcurl4-openssl-dev

After that everything installed fine.

If you want a secure channel when visiting unencrypted websites you can use an ssh port forwarding to tunnel all
browser traffic through ssh.

ssh -D localhost:5555

Then configure your browser to use manual network settings and
enter localhost and port 5555 as SOCKS host.

Download and install the PHP Apache Module provided by Marc Liyanage

This package comes in handy if you want to use some advanced features like ZipArchive, XSLT, curl, etc
Apples default PHP  installation lacks all these useful extensions.
If you don’t want to spend time compiling PHP first, this package is a great time saver.

This does not seem to work with snow leopard.

After upgrading to Snow Leopard and a couple of hours headache, I finally got my custom AMP running again.
These are the problems I encountered and what I had to do to fix them:

  1. My Apache configuration files were completely overwritten. I had to recreate my vhost settings under /etc/apache2/extra
  2. MySql did not work anymore. I had to download and install the latest dmg image for 10.6 and then copy my databases into the new data directory under /usr/local/mysql-5.1.45-osx10.6-x86_64/data
  3. PHP was installed without php.ini and gave warnings about timezone settings – had to copy /usr/local/php5/lib/php.ini-recommended to /etc and set the date.timezone to my local timezone

I found this page quite helpful.

Get Adobe Flash player