php

Connecting to 3rd party databse in Joomla!?

I need to connect to another database in Joomla! that's on another server. This is for a plugin and I need to pull some data from a table. Now what I don't want is to use this database to run Joomla!, I already have Joomla! installed and running on its own database on its server but I want to connect to another database (ON TOP of the c...

PHP - Database schema: version control, branching, migrations.

I'm trying to come up with (or find) a reusable system for database schema versioning in php projects. There are a number of Rails-style migration projects available for php. http://code.google.com/p/mysql-php-migrations/ is a good example. It uses timestamps for migration files, which helps with conflicts between branches. General pro...

Regex to parse youtube yid

Example URLs http://www.youtube.com/user/Scobleizer#p/u/1/1p3vcRhsYGo http://www.youtube.com/watch?v=cKZDdG9FTKY&feature=channel http://www.youtube.com/watch?v=yZ-K7nCVnBI&playnext_from=TL&videos=osPknwzXEas&feature=sub http://www.youtube.com/ytscreeningroom?v=NRHVzbJVx8I Any regex that will pull the correct YID from a...

Good reasons to migrate PHP libraries to namespaces

I have a significant number of object libraries written for PHP 5.2.5, and I'm trying to weigh the benefits of retrofitting them for namespaces. I don't have any concerns about the server PHP version at the moment, since any relevant machines are under my control, so I'm not worried about backwards compatibility. As far as the structure ...

CakePHP form $options['options']

Hey! Total CakePHP noob here. Updated at bottom \/ This is sort of a two fold question. In a view that is used for adding user objects I would like to use a drop down (selection) field in the form. Each user belongs to a group so when I add a user I want a drop down that contains all of the groups that the user could possibly join. ...

Cannot run file_get_contents() on PHP 5.2.9-2

Hello, I am having the same problem as described below. http://marc.info/?l=php-general&m=124104032703506 That is, I can't run file_get_contents() on PHP 5.2.9-2. The guy answered his own question by: "Sorry, didn't pay attention to the registered streams :-( You need to install a PHP package with ssl or compile it with --with-...

Regex for capturing a character between a group but ignoring the ones in a nested group.

This is for make something similar to "templates" in MediaWiki with PHP in order to make the parameters between nested templates work. Is possible with a regex to capture all occurrences of a character between braces but ignoring occurrences of it if it occurs in a nested group of braces? | {{ | {{ | }} | | }} | Highlighted: | {{ *|...

Multiple GET arguments

Hello, I've been working with PHP lately, and I came across something I couldn't solve. So basically, I have a form: <form method="get"> <fieldset class="display-options" style="float: left"> Search by name or ip: <input type="text" name="key" value="" />&nbsp; <input type="submit" class="button2" value="Search...

PHP getting blank pages after submit a form + signal Segmentation fault (11)

I few days ago I update my macbook pro to snow leopard, and since then some php files are not showing. This is what happens: I created a php form, when going to 'http://localhost/webform.php' I can see the form just fine. Then, once I submit the form, I just get a blank page. I enable error and warnings reporting under php.ini to mak...

widget within module in Yii

I'm trying to create a widget within the module and then load that widget from 'outside' of the module. More particularly I'm using user module written by someone else. I don't want to have a separate page for displaying a login form, therefore I tried to make a CPortlet/widget (confusion) displaying the login form. Basically, I've moved...

Why can i not rewrite parent class?

I want to rewrite core/adminthtml/block/widget/tabs.php class which is a super class for core/adminhtml/block/sales/order/view/tabs.php class. Here is config code for both scenarios: <blocks> <adminhtml> <rewrite> <sales_order_view_tabs>Jimmy_SalesAffil_Block_Widget_Tabs</sales_order_view_tabs> <widget_ta...

Technologies required for connectedTv

Can anyone help me suggesting which technologies will be useful to implement a ConnectedTv. In ConnectedTv where the Internet is configured in TV, while watching TV, users can browse the TV. ...

How to do SoapClient on php

I'm new in soapclient, I have tried to do some study online and also tried coding on soap, but seem this is still not working to me, just wandering anyone here can point out and perhaps give me some example how can I actually use the soapclint to get the feedback from the following web server? POST /webservices/tempconvert.asmx HTTP/1.1...

problem with logout script in php

I'm a beginner in php, and I am trying to create a login and logout. But I am having problems in logging out. My logout just calls for the login form which is this: <? session_start(); session_destroy(); ?> <table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <form name="form1" method="pos...

Suggest me solution to track the change in test DB and replicate in Another DB

Suggest me solution to track the change in test DB and replicate in Another DB... My Client need a script or any solution, if he has two Database, One Test DB in which he tests his data on test portal and if he find it appropriate he can use those changes to be done in main DB to display on Live site.. Fior this he needs the solution to...

Getting WSDL with local certificate authority

I need to connect my SOAP to service that requires to use local CA, but i don't seem to be able to find the WSDL, witch also needs the local CA. Can't PHP5's SOAP use local CA for WSDL calls? I'm using Zend Framework. Here is the code that I'm using. $soapClient = new Zend_Soap_Client("https://webservice/wsdl", array( 'local...

How can I build a tar from stdin?

How can I pipe information into tar specifying the names of the file? ...

{PHP} Fatal error: Using $this when not in object context (Joomla)

Hi all, i don't really know php and have hit a brick wall. The problem is that my site is showing the following error... Fatal error: Using $this when not in object context in /hermes/web07/b2350/pow.thefoodie/htdocs/index.php on line 11 This is the begining of my index.php file... <?php /* Joomla templates by Joomladesigns.co.uk...

encrypt array in php

Does anyone know do there have any way that I can encrypt the array in php?? for example: $arr_value = array("1","2","3","4"); any way that I can encrypt $arr_value, also decrypt it later ini php? ...

mail sent with php's mail() has blank From field

Hi, I'm sending email with PHP's mail function. It works just as it should except all email clients show blank From-field. Here's how i'm using the function: mail( '[email protected]', 'Example subject', $msg, implode( '\r\n', array( 'Content-Type: text/html; charset=UTF-8', 'From: [email protected]') ) ); As i said everything ...