WebTechKitchen; Your Web Technology Kitchen, contact us to create, or maintain your websites and other digital properties.

Drupal 7 connect to Drupal with curl and use rest services

Submitted by barnettech on Tue, 05/10/2011 - 15:16
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://base_drupal_url/drupal7/user/login");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERAGENT, 'PHP script');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 
"name=username&pass=password&form_id=user_login");
ob_start();  //dont print out this output
curl_exec ($ch);

Writing regular old JQuery the regular way in Drupal 7

Submitted by barnettech on Thu, 04/21/2011 - 10:34

This doesn't use the Drupal behaviors or attach detach stuff, just plain old jquery straight up:

(function($) {
   $().ready(function() {
     alert('hello');
   });
   $('#submit').live('click', function(){
	      alert('ack!');
	    });
})(jQuery);

this works and says hello to you on page load, and upon clicking a submit button wrapped in a div with an id of #submit:
it says 'ack!' to you

Note you only need to wrap your javascript one time with the

Setup for running stored procedures and sql from php / ubuntu on sql server

Submitted by barnettech on Fri, 04/15/2011 - 10:15

1.)

sudo apt-get install php5-sybase

2.)

sudo /etc/init.d/apache2 restart

3.) Third you need to do this: (copied from the internet -- tested it and it works, it will allow you to run stored procs)

“Figured it out...

In researching the problem before posting I saw references to configuration changes needed to FreeTDS, but apparently I was implementing the change wrong, but that is the solution.