Drupal 4.6.x

simple way for synchronize data without mysql access

i have found that there is very bad idea that when we cant access to mysql from remote client (because of any reason e.g dynamic ip of client) we use xml output because xml output have many boring laws for special character and this can make many problems especially for utf-8 charset.

so i use this simple methed for transfering data from a server to another server and synchronize second server with first server:

this code in first server was ran:

<?php
function data_export($parameters){
$prices=array();
$r=db_query('select * from mytable where %s',$parameters);
while(
$row=db_fetch_array($r)) $data[$row['pk_table']]=$row[]
var_export($data);
}
data_export();
?>

and this code in second server was ran:

<?php
    $handle
= fopen("http://firstserver/file_path", "r");
   
$xml = "";
    if (
$handle)
    {
       while (!
feof($handle))
       {
          
$xml .= fread($handle, 100000);
       }
       
fclose($handle);
    }
   
$xml='return '.$xml.';';
   
$func_name=create_function('',$xml);
   
$data=call_user_func($func_name);
print_r($data);
?>

data was transfered!
keywords may be you use for find this:

print_f output

,

var_export

,

array to xml

,

xml to array

website creation

whyte - July 15, 2008 - 19:41

I am creating a website for the first time. But I want to creat a thank you url that will appear immidiately after registion intor the site, but I do not want this thank you url to be included in my page, so that others can not have access to the page except after completing there registration. Can someone help on how to go abou this please.

where do people here sit with the DNS flaw?

I was listening to the excellent TWIT TV podcast earlier and a topic popped up about a serious DNS flaw that, potentially, would allow malicious people to impersonate almost any website on the Internet.

Just curious to how Drupal admins are taking this? is there need for concern or is this a hosting thing?

The podcast pointed people to http://www.doxpara.com/ which was setup by the guy who discovered the flaw in DNS.

Add Mibbit AJAX IRC client with nickname auto-completion

This snippet is a quick way to add real-time chat to your drupal using the Mibbit AJAX IRC client from http://mibbit.com/widget.html

It has been tested on 5.7, but should work on any drupal version that stores user information in $user and sets $user-uid > 0 for logged-in users.

<?php
global $user;

// If the user is logged in, set IRC nickname to their username, else an anonymous one.

if($user->uid > 0) {
   
$nickname = check_plain($user->name);
} else {
   
$nickname = 'Agent%3F%3F%3F';
}

?>


<iframe width=695 height=500 scrolling=no style="border:0" src="http://embed.mibbit.com/?server=[your server spec]&channel=%23[your channel]&nick=<?php print "$nickname"; ?>"></iframe>

Need help with book pages...

Joseph_24 - July 10, 2008 - 17:22

Hi everyone,

I am a staff member at the University of Calgary who is reasonably familiar with Drupal. I currently maintain this site:

http://www.ucalgary.ca/GSA/

I worked with an architect in our IT department when I migrated this site over from FrontPage last year. I would like to know how to delete one of the red main tabs on the top of the page (specifically, the "Activities" tab). How do I do this?

Thanks! Any help would be much appreciated.

Cheers,

Joseph Bardsley
The University of Calgary
gsaco@ucalgary.ca

Syndicate content
 
 

Drupal is a registered trademark of Dries Buytaert.