Skip to content

Instantly share code, notes, and snippets.

View INDIAN2020's full-sized avatar

Gogula Sivannarayana INDIAN2020

View GitHub Profile
@INDIAN2020
INDIAN2020 / gist:5495493
Created May 1, 2013 14:15
wordpress: table shortcode
function simple_table( $atts ) {
extract( shortcode_atts( array(
'cols' => 'none',
'data' => 'none',
), $atts ) );
$cols = explode(',',$cols);
$data = explode('<data>',$data);
$total = count($cols);
$output .= '<table class="mytable"><tr class="th">';
foreach($cols as $col):
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<?php
//defining the values
@INDIAN2020
INDIAN2020 / index.php
Created May 3, 2013 19:43
working form
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<?php
ini_set("display_errors","1");
ERROR_REPORTING(E_ALL);
$objConnect = mysql_connect("localhost","root","") or die(mysql_error());
$objDB = mysql_select_db("bollywood");
small, sub, sup { font-size: .83em }
sub { vertical-align: sub }
sup { vertical-align: super }
@INDIAN2020
INDIAN2020 / gist:5559566
Created May 11, 2013 10:30
superfish: parent nav menu style
/*superfish menu parent style*/
.sf-menu > li:hover > a{}
.sf-menu > li.sfHover > a{}
.sf-menu > li li:hover > a{}
.sf-menu > li li.sfHover > a {color: #fe681b;}
@INDIAN2020
INDIAN2020 / gist:5566607
Created May 13, 2013 07:03
php: session login
session_start();
if ( !isset($_SESSION['logged-in']) || $_SESSION['logged-in'] !== true) {
header('Location: login.php');
exit;
}
@INDIAN2020
INDIAN2020 / .htaccess
Created May 13, 2013 12:32
php: extension hider for .php
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
@INDIAN2020
INDIAN2020 / step.php
Created May 15, 2013 05:01
php: multistep form
<?php
//http://codingcyber.com/creating-multistep-form-processing-using-php-228/
session_start();
if(isset($_POST['sign_up'])){
if($_POST['sign_up'] == "Search"){
$_SESSION['zip_code'] = $_POST['zip_code'];
}
if($_POST['sign_up'] == "Submit"){
$_SESSION['state'] = $_POST['state'];
//create a new theater
INSERT INTO `mydb`.`theater` (`theater_id`, `theater_name`) VALUES (NULL, 'Bollywood'), (NULL, 'Hollywood');
//creating movie
INSERT INTO `mydb`.`movie` (`movie_id`, `movie_name`, `movie_released`, `movie_end`, `movie_budget`, `movie_status`, `theater_theater_id`) VALUES (NULL, 'Gundejari Gallantainde', '2013-05-01', NULL, 'high', '1', '1'), (NULL, 'Siva', '2013-04-01', '2013-04-30', 'low', '1', '1');
http://stackoverflow.com/questions/6446288/php-mysql-search-code-and-logic-for-relational-database-schema
http://www.sitepoint.com/understanding-sql-joins-mysql-database/
http://www.9lessons.info/2010/07/database-sql-searching-techniques.html
http://coddswallop.wordpress.com/
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>reports</title>
</head>
<body>
<table class="mytable">
<tr>
<th width="100">Class</th>