মঙ্গলবার, ২৮ মে, ২০১৩

<?php
class loginregistration{
public function login(){
?>
<div class="content">
<form method="post" action="">
Name:
<input type="text" name="" /><br/>
Password:
<input type="password" name=""/><br/>
</form>
</div>
<?php
}
public function registration(){
?>
<div class="content">
<form method="post" action="">
Name:
<input type="text" name="" /><br/>
Email:
<input type="text" name=""/><br/>
Contact:
<input type="text" name=""/><br/>
</form>
</div>
<?php
}
}

class page{
public function home(){
?>
<div class="content">
<p>This is a home page</p>
</div>
<?php
}
public function contact(){
?>
<div class="content">
<p>This is a contact page</p>
</div>
<?php
}
public function about(){
?>
<div class="content">
<p>This is a about page</p>
</div>
<?php
}
public function blog(){
?>
<div class="content">
<p>This is a Blog page</p>
</div>
<?php
}
}
class menues{
public function menu(){
?>
<ul>
<li><a href="t.php">Home</a></li>
<li><a href="t.php?page=contact">Contact</a></li>
<li><a href="t.php?page=about">About</a></li>
<li><a href="t.php?page=blog">Blog</a></li>
</ul>
<p><a href="t.php?page=login">Login</a></p>
<p><a href="t.php?page=registration">Registration</a></p>
<?php
}
}
?>
<html>
<head>
<style type="text/css">
.content {height:200px; background-color:E1E1E1;}
</style>
</head>
<body>
<?php
//For Menu
$menu = new menues;
$menu -> menu();
//For Login
$login = new loginregistration;
// if(isset($_GET['type'])=="login"){
// $login->login();
// }else if($_GET['type']=="registration"){
// $login->registration();
// }

//For Page
$page = new page;
if(!isset($_GET['page'])){
$page->home();
}else if($_GET['page']=="contact"){
$page->contact();
}else if($_GET['page']=="about"){
$page->about();
}else if($_GET['page']=="blog"){
$page->blog();
}else if($_GET['page']=="login"){
$login->login();
}else if($_GET['page']=="registration"){
$login->registration();
}else{
$page->home();
}
?>
</body>
</html>

মঙ্গলবার, ১৪ মে, ২০১৩

jquery backend form design by tab


<html lang="en">
<head>
  <meta charset="utf-8" />
  <title>jQuery UI Accordion - Default functionality</title>
  <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<style type="text/css">
#ulid {
background-color:red;
}
#ulid li{
background-color:green;
color:white;
}
</style>
 <script>
$(document).ready(function() {
$(function() {
$( "#CreatingQuotation" ).tabs();
$( "#CreatingQuotation" ).tabs( "option", "disabled", [ 1, 2, 3 ] );
});

$("#clickid").click(function() {
if($("#inputfield").val() === ''){
$("#inputfield").css("border", "1px solid red");
}else{
$("#CreatingQuotation").tabs( "enable", 1 );
$("#CreatingQuotation").tabs( "option", "active", 1 );
document.getElementById("number").innerHTML=3;
$( "#formid" )[0].reset();
}
});
$("#preview").click(function() {
$("#CreatingQuotation").tabs( "option", "active", 0 );

});
});
</script>
 
</head>
<body>
<p id="number">1</p>
<div id="CreatingQuotation">
<ul id="ulid">
<li id="p1"><a href="#tabs1">Contact Info</a></li>
<li id="p2"><a href="#tabs2">Education</a></li>
<li id="p3"><a href="#tabs3">Professional Experience</a></li>
<li id="p4"><a href="#tabs4">Additional Skills</a></li>
</ul>

<div id="tabs1">
<form id="formid">
<input type="text" id="inputfield"/>
<input type="button" id="clickid" value="Test" />
</form>
</div>
<div id="tabs2">
Tabs 2
<p id="preview">Preview</p>
</div>
<div id="tabs3">
Tabs 3
</div>
<div id="tabs4">
Tabs 4
</div>
</div><!--end of tabs-->
</body>
</html>

বৃহস্পতিবার, ২ মে, ২০১৩


<html lang="en">
<head>
  <meta charset="utf-8" />
  <title>jQuery UI Accordion - Default functionality</title>
  <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<style type="text/css">
body {font-family:Arial;}
h2 {font-size:1.6em;}
.newsItem {
border:solid 1px red;
padding:10px;  
}
.newsTeaser{
border:solid 5px green;
padding:10px;  
}

.collapsible{
display:none;
border:solid 5px blue;
padding:10px;

}
.more {cursor:pointer;}
</style>
  <script>
$(document).ready(function() {
$(".more").click(function() {
$(".collapsible").hide();
$(this).parent().parent().find(".collapsible").show();
});
});
  </script>
 
</head>
<body>
<?php
for($i=1;$i<=3;$i++){
$demo='

<div>
    <h2>Title</h2>
    <div id="newsTeaser">
  <button class="btn more">more</button>
    </div>
<div style="clear:both;"></div>
<div class="btn collapsible" style="display:none;">
    <table>
        <p>Full body goes here...Full body goes here...Full body goes here...Full body goes here...Full body goes here...Full body goes here...Full body goes here...Full body goes here...Full body goes here...Full body goes here...Full body goes here...Full body goes here...Full body goes here...Full body goes here...Full body goes here...Full body goes here...Full body goes here...Full body goes here...</p>
<p class="less">less</p>
</table>
    </div>
</div>


';
echo $demo;
}
?>
</body>
</html>

শনিবার, ২৭ এপ্রিল, ২০১৩

Jquery TAB


In this tutorial you can make more page by jquery tab.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test</title>

<style type="text/css">
ul.ul_requests { text-decoration:none;}
ul.ul_requests li {display:inline; margin-right:20px;}
ul.ul_requests li a { color:Green; text-decoration:none;}
ul.ul_requests li a:hover { color:red; text-decoration:none;}

html ul.ul_requests li.active, html ul.ul_requests li.active a:hover  {
background: red;
border:none;
color:white;
}
</style>
<script  src="js/jquery.js"></script>
<script>
$(document).ready(function() {
//Hide all content
$(".tab_content_bid").hide();
//Activate first tab
$("ul.ul_requests li:first").addClass("active").show();
//Show first tab content
$(".tab_content_bid:first").show();

//On Click Event
$("ul.ul_requests li").click(function() {
//Remove any "active" class
$("ul.ul_requests li").removeClass("active");

//Add "active" class to selected tab
$(this).addClass("active");

//Hide all tab content
$(".tab_content_bid").hide();

//Find the rel attribute value to identify the active tab + content
var activeTab = $(this).find("a").attr("href");

//Fade in the active content
$(activeTab).fadeIn();
return false;
});
});
</script>
</head>
<body>
<ul class="ul_requests">
<li><a href="#tabrequesta">Cover Letter</a></li>
<li><a href="#tabrequestb">Attachment</a></li>
</ul>
<div class="tab_container_request">
<div id="tabrequesta" class="tab_content_bid" style="margin-top:0px; padding:0px;">
<p>This is a first Tab
</div>
<div style="clear:both"></div>

<div id="tabrequestb" class="tab_content_bid">
<h2>About</h2>
<p>This is a about page</p>
</div>
</div>
</body>
</html>

বুধবার, ৫ ডিসেম্বর, ২০১২

php এবং mysql এর ধারাবাহিক পর্ব(ডাটাবেজ এর জন্য টেবিল বানানো।)। ৩য় দিন।

এখানে একটা বিষয় বলে রাখি। আমাদের আগের পার্টগুলি ঠিকভাবে শেষ না হলে টেবিল বানানো যাবে না। টাই আগে কোন সমস্যা থাকলে তা কমেন্টস করে জানাবেন।

<?php  //আমরা আগের মত কানেকশন পেইজ টাকে এখানে প্রবেশ করালাম। require_once "connect_to_mysql.php"; // Create an sql command structure for creating a table $tableCreate "CREATE TABLE members ( 
                id int(11) NOT NULL auto_increment, 
                username varchar(255) NOT NULL, 
                email varchar(255) NOT NULL, 
                password varchar(255) NOT NULL, 
                website varchar(255) NULL, 
                account_type enum('a','b','c') NOT NULL default 'a', 
                PRIMARY KEY (id), 
                UNIQUE KEY email (email) 
                )"
; // This line uses the mysql_query() function to create the table now $queryResult mysql_query($tableCreate); // Create a conditional to see if the query executed successfully or not if ($queryResult === TRUE) { 
        print 
"<br /><br />Success in TABLE creation! Happy Coding!"; 
} else { 
        print 
"<br /><br />No TABLE created. Check"; 
} 
// close mysql connection mysql_close(); ?>

সোমবার, ৩ ডিসেম্বর, ২০১২

php এবং mysql এর ধারাবাহিক পর্ব(ডাটাবেজ কানেকশন বন্ধ করা।)। ২য় দিন।

গত কাল আমরা কি করে ডাটাবেস কানেক্ট করতে হয়, তা জেনেছি। আজকে ওপেন করার পড়ে কি করে বন্ধ করতে হয় তা শিখব।
<?php  //আমরা ১ম কানেকশন পেজটাকে আমাদের নতুন পেজ এ নিয়ে আসলাম। require_once "connect_to_mysql.php"
//এখানে আমরা আমাদের কোডের কাজ করব। এবং শেষ হলে নিচের mysql_close দিয়ে কানেকশন বন্ধ করব 

mysql_close();
//তাহলে আমাদের বন্ধ করার কাজ শেষ।  

?>

php এবং mysql এর ধারাবাহিক পর্ব। 


১ম দিন।

  এটা আমার প্রথম ব্লগ, ভুল হলে অবশ্যই আমাকে কমেন্টস করে জানাবেন।
<?php  

১ম এ আমার কাজ হল আমার নাম, পাসওয়াড সবকিছু ভেরিয়াবেল এর মধ্যে নিয়া আসা। আমার হোস্ট হল localhost ।  

বিঃ দ্রঃ $সাইন দিয়া ভেরিয়েবেল লেখা হয়।

$db_host "লোকালহোস্ট";
 এখানে আমার ইউজার নাম রাখতে হবে।

$db_username "রুট" 
এখানে আমার লোকালহোস্ট এর পাসওয়াড দিতে হবে।  
$db_pass "আমার পাসওয়াড নাই"
আর এটা আমার ডাটাবেস এর নাম। 

$db_name "টেস্ট";
এখন মান গুলোকে mysql_connect কিওয়াড দিয়া কানেক্ট করা হবে। তারপর mysql_select_bd দিয়া ডাতাবেশ চিনহিত করতে হবে।  


mysql_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql"); mysql_select_db("$db_name") or die ("no database");               

?>

এবার পেজ টাকে connect_to_mysql.php নামে সেভ করুন।
<?php 
$db_host "localhost";  

$db_username "root";  
$db_pass "";  
$db_name "test";
mysql_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql"); mysql_select_db("$db_name") or die ("no database");               

?>


 এবার নিচের কোড দিয়ে আমরা কানেকশন ঠিক আছে কিনা চেক করব।
<?php   require বা include দিয়া অন্য পেজ নতুন পেজ এ নিয়া আসে।  require "connect_to_mysql.php"
echo ba print dia output বা স্ক্রীন এ লেখা দেখায়। এখানে উপরের পেজ এর সবকিছু ঠিক থাকলে নিচের কোড ব্রাউজার এ ভিসিট করলে দেখাবে। আর ঠিক না থাকলে ওটা দেখাবে না।
echo 
"<h1>Success in database connection! Happy Coding!</h1>";    ?>
  mysql_quicktest.php নামে সেভ করুন।
<?php   require "connect_to_mysql.php"
echo 
"<h1>Success in database connection! Happy Coding!</h1>";   ?>