Posted by: Anil Kumar Panigrahi in: ● August 15, 2010
Hi friends,
This post is to change the order in admin and display those content depends on order. Today i want to share with you all.
Take table that
CREATE TABLE tblOrder (
`post_id` int(11) ,
`sortorder` int(11) NOT NULL default ‘0′,
)
At the admin section: PHP Code
manageorder.php
<?php
$query = "SELECT * FROM tblOrder order [...]
Posted by: Anil Kumar Panigrahi in: ● July 2, 2010
Hi friends,
In this post i want to explain how to create rss feeds using php code and get the data from mysql table.
1) Connect to database:
We already discussed about how to connect database using php code.See the following code to connect database:
1
2
3
4
5
6
7
8
9
10
11
<?php
DEFINE (’DB_USER’, ‘root’);
DEFINE (’DB_PASSWORD’, ‘root’);
DEFINE (’DB_HOST’, ‘localhost’);
DEFINE (’DB_NAME’, ‘rss’);
// Make the connnection and then [...]
Posted by: Anil Kumar Panigrahi in: ● June 27, 2010
The following script to copy the text from remote url using php code.
<?php
$regex = ‘/]*>(.*<\/body>/smi’;
/*END config, BEGIN html*/
$data = file_get_contents($siteName) or die(’Cannot read ‘ . $siteName);
preg_match($regex, $data, $cleanData);
if(!empty($cleanData))
$data = $cleanData[1];
echo $data;
?>
<!– HTML Footer Data here… –>
This is simple copy text from another site, but it will be useful for who are new to php.
Posted by: Anil Kumar Panigrahi in: ● June 19, 2010
In this post, i want to explain download any file using php script.It will useful when we are developing a website like In that website have list of files and users can download those files.
Script is as follows:
<?php
$filename = ‘[file name].[extension]‘;
$ctype=”application/[extension]“;
// required for IE, otherwise Content-disposition is ignored
if(ini_get(‘zlib.output_compression’))
ini_set(‘zlib.output_compression’, ‘Off’);
header(“Pragma: public”); // required
header(“Expires: 0″);
header(“Cache-Control: must-revalidate, post-check=0, [...]
Comments