Archive for the ‘PHP’ Category

punBB plugin - Remove Users

I wrote a punBB plugin for one of my forum. This administrator plugin allows you to remove multiple users along with their posts. You can download the plugin from http://www.ninethsense.com/content/view/57/51/
VN:F [1.1.6_502]Rating: 0.0/5 (0 votes cast)

Leave a Comment

Dynamic varialbes from text file - PHP

This code snippet demonstrates how to read a resource file and convert them to php variables:
< ?_php
$arr = file("resource.txt");
foreach ($arr as $key => $value) {
$arr = split(”t”,$value); // tab delimeted. You can use any.
$$arr[0] = $arr[1];
}
//Example - “name” is a word in text tile with ‘tab’ delimeted sample text.
echo $name;
?>
Sample resource.txt file: (tab delimeted)

txt_title hello world
txt_message this [...]

Leave a Comment

Microsoft Access Database (MDB) from PHP

This code demonstrates how to access a Microsoft Access Database (MDB) from PHP. Here I used PHP 5 for testing.

< ?_php
/* This example shows how to open and do operations on a Microsoft Access Database using PHP odbc functions */
$db_connection = odbc_connect(”DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=E:rootphpDataBase.mdb”, “ADODB.Connection”, “password”, “SQL_CUR_USE_ODBC”);
echo ”
Show all tables
“;
$result = odbc_tables($db_connection);
while (odbc_fetch_row($result)) [...]

Leave a Comment

New PHP Website for Kerala

Registered new php-kerala webiste - www.phpkerala.com. Also integrated a forum - forum.phpkerala.com.
Money donated by my friend Sajeer!
VN:F [1.1.6_502]Rating: 0.0/5 (0 votes cast)

Leave a Comment

Dynamic loading of content in a Dropdown box - without Ajax - Part II

This is same as my previous blog “Dynamic loading of content in a Dropdown box - without Ajax - Part I”, but I have used PHP with MySQL connectiviry for doing this.

< ?_php
require_once “db_common.inc”;
db_connect();
$res = mysql_query(”select * from category where parent_id=0 and language_id=1″);
$i=0;
echo “n”;
while($row = mysql_fetch_assoc($res)){
echo “cmbBusiCategory.options[$i] = [...]

Leave a Comment

Dynamic loading of content in a Dropdown box - without Ajax - Part I

This code demonstrates a depricated way (my words) of dynamically filling dropdown list boxes based on the input value from another dropdown box.

Categories

Sub Categories

var Category = new Array()
Category[0] = “FtFesT1″;
Category[1] = “teFsT2″;
Category[2] = “teFsT3″;
var First = new Array()
First[0] = “FtFesT1″;
First[1] = “teFsT2″;
First[2] [...]

Leave a Comment

Simple Paging feature with PHP and MySQL

This is not a full-featured code, but you can develop it to one.
Simple Paging feature with PHP and MySQL

< _?php
$db = mysql_connect("localhost","root");
mysql_select_db("test");
$pagesize = 2;
$res = mysql_query("select *from test");
$totalrecs = mysql_num_rows($res);
if (!isset($firstrec)) $firstrec = 0;
if (isset($_REQUEST['action'])) {
$firstrec = $_REQUEST['firstrec'];
switch ($_REQUEST['action']) {
case "prev":
if ($firstrec > 0)
$firstrec-= $pagesize ;
break;
case “next”:
if ($firstrec < $totalrecs-$pagesize )
$firstrec+=$pagesize;
break;
}
}
$res = mysql_query(”select *from [...]

Leave a Comment

PHP Pagerank

I have a script for you to determine the page rank of a website.
Use this: http://www.ninethsense.com/misc/pagerank.php?url=www.ninethsense.com
VN:F [1.1.6_502]Rating: 0.0/5 (0 votes cast)

Leave a Comment

.:: NinethSense’s Paste Bin ::. v1.2

.:: NinethSense’s Paste Bin ::. v1.2 is now ready for use. You can reach there by http://www.ninethsense.com/pastebin/.
I retained the old version 1.1 at the same place, for my old uses - which was http://www.ninethsense.com/praveen/pastebin/
Change Log
* No much changes
* Added some javascript for title focus
* Aligned to Center.
* Added text requesting comments & suggestions

Dont know what [...]

Leave a Comment