Амжилт хүсье

Бараг л ВАРЕЗ юм даа

Үүнээс салахын тулд ob_start();-г вэбийн толгой хэсэг харин ob_end_flush();-г вэбийн төгсгөлд бичиж өгөх нь.

<?php
ob_start();

//Таны вэбийн мэдээлэл энд байрлана

ob_end_flush();
?>

Маш жижигхэн функц бичье

function илд_бамбай($value)
{
if (get_magic_quotes_gpc())
{
$value = stripslashes($value);
}

if (!is_numeric($value))
{
$value = “” . mysql_real_escape_string($value) . “”;
}
return $value;
}

За одоо үүнийгээ хэрхэн ашиглах вэ?

$формоос_дамжих_утга= илд_бамбай($_POST['формоос_дамжих_утга']);

Ингээд бага ч гэсэн аюулгүй боллоо

Дараах хэлбэрээр зургийн галлерей үүсгэх функцээ үүсгэнэ

function Create_Gallery($dir, $width, $height) {

$folder=dir($dir);

$gallery_html = ‘<div> ‘;

while($folderEntry=$folder->read())
{
if ($folderEntry != “.” && $folderEntry != “..”){
$gallery_html .= ‘ <a href=”‘.$dir.’/’.$folderEntry.’”>
<img
style=”border: 6px double rgb(84, 85, 101);”
src=”‘.$dir.’/’.$folderEntry.’”
alt=”The thumb” width=”‘.$width.’” height=”‘.$height.’”/>
</a>’;
}
}

$gallery_html .= ‘ </div> ‘;
$folder->close();

echo $gallery_html;

return;
}

За одоо үүнийгээ вэб дээрээ хэвлэж гаргах л үлдлээ.

Create_Gallery(”gallery”, “200″, “140″);

gallery - н оронд таны зургаад байрлаж байгаа хавтасын нэрийг бичнэ. 200 болон 140 нь таны зургийн харагдах хэлбэр буюу өргөн, өндөр нь юм.

Вэбийн толгой элсэл ямар нэгэн зураг санамсаргүйгээр сольж харуулах хамгийн энгийн нэг арга байна.

та эхлээд зурагаа бэлдэх хэрэгтэй тэгээд зурагаа дараах хэлбэрээр нэрлэж хадгална.

зураг_1.jpg
зураг_2.jpg
зураг_3.jpg
зураг_4.jpg
зураг_5.jpg

Хадгалсан зураг маань дээрх хэлбэрээр харагдах нь ээ. Одоо вэб дээрээ үүнийг харуулах л үлдлээ.

<img 
src="http://таны зураг байрлаж байгаа хавтас,
хаяг/зураг_<?php echo(rand(1,5)); ?>.jpg" 
width="image_width" 
height="image_height" 
alt="image_alt_text" /> 

Ингээд болоо.

Интернетийн хөгжлийн хурдацын хэрээр интернэтэд суурилсан мөнгө олох болмжууд ихэсч байна. Үүний нэг жишээ бол АФФИЛЭТ програм юм. Энэ нь тухайн байгууллагын бараа бүтээгдэхүүн болон үйлчилгээг сурталчилсанаар тухайн бараа бүтээгдэхүүн болон үйлчилгээний орлогоос авах боломжтой болж байгаа юм. Монголд одоогоор энэ үйлчилгээ байхгүй байгаа хэдий ч энэ хэлбэрийн үйлчилгээг интернэтээс ” affiliate program ” гээд хайхад олдоно.

Тун удахгүй AB Media Works компаниас та бүхэнд энэхүү боломжийг удахгүй хүргэх гэж байна.


[ Download ]

Монголд маань бүх зүйл үнэгүй байна. Бид бүгдийг аль болох төлбөргүй эсвэл төлбөр багатайгаар шийдэх/хийлгэх гэж ядаж байна. Ах дүү хамаатан садан эсвэл найз нөхдийн нэрийг барьж бүх зүйлийг үнэ төлбөргүй хийдэг/хийлгэдэг зуршилтай. За энэ хэд нь болохгүй бол улсаасаа үнэгүй юм нэхдэг заншилтай. Мөнгөгүй хийсээр хийлгэсээр байгаад тэрэндээ ч дасчихсан илүү хямдханаар хийлгэх, илүү олон зүйлийг үнэгүй авахын төлөө улайрсаар байгаад бүх зүйлийг ҮНЭГҮЙдүүлчихсэн. Read the rest of this entry »

Install unrar command

Under Debian Linux, you need to type apt-get as follows to install unrar program:
# apt-get install unrar

If you are using Fedora core Linux then use yum command as follows (see discussion below):
# yum install unrar

If you are using FreeBSD, use:
# pkg_add -v -r unrar

If any of above, methods is not working for you, download binary package from official rarlab site:
$ cd /tmp
$ wget http://www.rarlab.com/rar/rarlinux-3.6.0.tar.gz

Untar file
$ tar -zxvf rarlinux-3.6.0.tar.gz

Both unrar and rar commands are located in rar sub-directory. Just go to rar directory:
$ cd rar
$ ./unrar

Now copy rar and unrar to /bin directory:
# cp rar unrar /bin

How to use unrar

unrar command supports various options below are common options that you need to use everyday.

Task: To open rar (unpack) file in current directory type command:

$ unrar e file.rar

Please note that replace file.rar filename with your actual filename.

Task: List (l) file inside rar archive:

$ unrar l file.rar

Task: To extract (x) files with full path type command:

$ unrar x file.rar

(D) To test (t) integrity of archive, file type command:
$ unrar t file.rar

[ Additional information ]

copy your rar file into the tmp/rar

unrar file

Go to My computer / System / tmp / rar

copy your file into your folder

Using unrar
Fetch and install unrar tools from fedora extra repository -
[root@cafe moon]#yum install unrar
To see unrar help pages-
[root@cafe moon]# unrar ?
To extract a rar file -
[root@cafe moon]# unrar x file.rar
To extract a password protected rar file -
[root@cafe moon]#unrar x -p[password] file.rar

Using rarlinux
download rarlinux tool from win-rar website and Gunzip the downloaded rarlinux-3.7.1.tar.gzip file
[root@cafe moon]#gunzip rarlinux-3.7.1.tar.gzip
To extract the gunzipped but .tar file
[root@cafe moon]#tar xvf rarlinux-3.7.1.tar
The above will extract the tar file to a folder in your present working directory called rar.
enter tho the rar dir
[root@cafe moon]# cd ./rar
long list the rar folder -
[root@cafe moon]# ls -l ./rar
You should see an executable file called unrar. There you go -
To unrar a file -
[root@cafe moon]# ./unrar x file.rar
To extract a password protected rar file -
[root@cafe moon]#./unrar x -p[password] file.rar

[ Save following script named include.php ]

<?php

// Gather variable data from the URI
// eg. filename.php?page=index
$page = (isset($_GET['page'])) ? $_GET['page'] : ‘index’;

// Determine whether or not the requested file exists
if (!file_exists(‘includes/’ . $page . ‘.php’))
{
echo
“File could not be included, no file exists.”;
exit;
}

switch ($page)
{
/**
* I’m sure you’re aware that you can duplicate this case.
* If you’d like to add more page includes, just change the relevant
* data in each case.
*/
case ‘about’:
include(
‘includes/about.inc.php’);
break;

// If no variable is set in the URI, or no case matches, include index
default:
include(
‘includes/index.inc.php’);
}

?>

[ Save following script index.php ]

<!DOCTYPE HTML PUBLIC ”-//W3C//DTD HTML 4.01//EN”
“http://www.w3.org/TR/html4/strict.dtd”>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<title>Your Page Title</title>
<script language=”javascript” type=”text/javascript”>
<!–

function requestPage(page) {

var request = false;

try {
request = new XMLHttpRequest();
} catch (e) {
try{
request = new ActiveXObject(”Msxml2.XMLHTTP”);
} catch (e) {
try{
request = new ActiveXObject(”Microsoft.XMLHTTP”);
} catch (e) {
alert(”Unable to complete your request.”);
return false;
}
}
}

request.onreadystatechange = function() {
if(request.readyState == 4) {
if(request.status == 200) {
document.getElementById(’content’).innerHTML = request.responseText;
}
}
}

request.open(”GET”, ”include.php?page=” + page, true);
request.send(null);
}

//–>
</script>

<style>
a {
cursor: pointer;
}
</style>
</head>

<body>

<ul>
<!– Use the filename, without its extention, as a function parameter –>
<a onclick=”javascript:requestPage(’index’)”><li>Index</li></a>
<a onclick=”javascript:requestPage(’about’)”><li>About</li></a>
</ul>

<div id=”content”><?php include(‘includes/index.inc.php’); ?></div>

</body>
</html>