Archive for April, 2008

allow /Denay

<?
include”config.php”;
include”opendb.php”;
//$status_id = $_REQUEST['id'];
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Untitled Document</title>
<style type=”text/css”>

A:link {text-decoration: none}
A:visited {text-decoration: none}
A:active {text-decoration: none}
A:hover {text-decoration: underline; color: red;}

A:link {text-decoration: none}
A:visited {text-decoration: none}
A:active {text-decoration: none}
A:hover {font-size:24; font-weight:bold; color: red;
}

A:link {background: #F5F805; text-decoration: none}
A:visited {background:#F5F805; text-decoration: none}
A:ctive {background: #F5F805; text-decoration: none}
A:hover {background: #F5F805; font-weight:bold; color: red;}

.tab{
border-bottom:dotted #000066 1px;
border-left:dotted #000066 1px;
border-top:dotted #000066 1px;
border-right:dotted #000066 1px;
font-family:Trebuchet MS;
font-size:12px;
color:#003366;
}
</style>
<script language=”JavaScript1.2″>
top.window.moveTo(0,0);
if (document.all) {
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById) {
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
//
</script>
</head>
<body>
<form id=”form1″ name=”form1″ method=”post” action=”">
<div align=”center”>
<table width=”768″ border=”0″ cellspacing=”2″ cellpadding=”10″ class=”tab”>
<tr>
<td width=”56″ bgcolor=”#33CCFF”>First Name</td>
<td width=”71″ bgcolor=”#33CCFF”>Middle Name</td>
<td width=”47″ bgcolor=”#33CCFF”>Last Name</td>
<td width=”86″ bgcolor=”#33CCFF”>Date Of Birth </td>
<td width=”27″ bgcolor=”#33CCFF”>Email</td>
<td width=”54″ bgcolor=”#33CCFF”>Phone</td>
<td width=”54″ bgcolor=”#33CCFF”>Allow/Deny</td>
<td width=”73″ bgcolor=”#33CCFF”>Edit</td>
<td width=”75″ bgcolor=”#33CCFF”>Delete</td>
</tr>
<?
$reg_query=”select * from register”;
$reg_result=mysql_query($reg_query);

while($reg_row=mysql_fetch_array($reg_result))
{
echo $id=$reg_row['reg_id'];

$status=$reg_row['status'];
//echo  $status=$reg_row['status'];
?>
<tr>
<td><? echo $reg_row['first'];?></td>
<td><div align=”center”><? echo $reg_row['middle'];?></div></td>
<td><div align=”center”><? echo $reg_row['last'];?></div></td>
<td><div align=”center”><? echo $reg_row['dob'];?></div></td>
<td><div align=”center”><? echo $reg_row['email'];?></div></td>
<td><div align=”center”><? echo $reg_row['phone'];?></div></td>
<?php
if($status==0)
{
?>
<td><a href=”allow.php?id=<?php echo $id;?>&status=1″>Allow</a></td>
<?
}else
{
?>
<td><a href=”allow.php?id=<?php echo $id;?>&status=0″>Deny</a></td>
<?php
}
?>
<td><a href=”edit.php?id=<? echo $id; ?>”>Edit</a></td>
<td><a href=”delete.php?id=<? echo $id; ?>”>Delete</a></td>

</tr>
<?php
}
?>
</table>
</div>
</form>
</body>
</html>

JavaScript: Format a post.

Make it bold:

javascript:ls=document.forms[1].elements[4].value;ls=”" + ls + “”;void(0)

Italics:

javascript:ls=document.forms[1].elements[4].value;ls=”” + ls + ““;void(0)

Underline:

javascript:ls=document.forms[1].elements[4].value;ls=”” + ls + ““;void(0)

For all three:

javascript:ls=document.forms[1].elements[4].value;ls=”” + ls + ““;void(0)

JavaScript: Detect current URL

javascript:prompt(”The current URL is:”, location.href);void(0)

JavaScript: Validate phone number

Validates a phone number against the regular expression: (555) 555-1234

function isPhoneNumber(s)
{

// Check for correct phone number
rePhoneNumber = new RegExp(/^\([1-9]\d{2}\)\s?\d{3}\-\d{4}$/);

if (!rePhoneNumber.test(s)) {
alert(”Phone Number Must Be Entered As: (555) 555-1234″);
return false;
}

return true;
}

dropdown-js

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Untitled Document</title>
<script language=”javascript” type=”text/javascript”>
<!– Downloadables - Xanga.com/afaridi/
// - ©2006 This code is free to use provided you do not remove this notice.
function Go() {
if (document.thepcman.website[document.thepcman.website.selectedIndex].value != “”) {
location = document.thepcman.website[document.thepcman.website.selectedIndex].value
}
}//–></script>
</head>

<body>
<form name=”Downloadables”><select name=”website”>
<option value=”" selected>Choose a Destination</option>
<option value=”">—————————-</option>
<option value=”www.xanga.com/naumanrafi”>EX:naumanrafi</option>
<option value=”">—————————-</option>
<option value=”Xanga.com/afaridi”>Downloadables</option>
</select><input type=”button” value=”Go!” onClick=”Go()”></form>
</body>
</html>

multiple file upload at the same time

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Untitled Document</title>
<script language=”javascript”>
function addFileInput()
{
var upload_number = document.getElementById(’attachments’).value;
var d = document.createElement(”div”);
var l = document.createElement(”a”);
var file = document.createElement(”input”);
file.setAttribute(”type”, “file”);
file.setAttribute(”name”, “attachment”+upload_number);
file.setAttribute(’id’,'file_’+upload_number);
l.setAttribute(”href”, “javascript:removeFileInput(’file”+upload_number+”‘);”);
l.appendChild(document.createTextNode(”Remove”));
d.setAttribute(”id”, “file”+upload_number);
d.appendChild(file);
d.appendChild(l);
document.getElementById(”moreUploads”).appendChild(d);
document.getElementById(”attachments”).value = upload_number;
upload_number++;
}
function removeFileInput(i)
{
var elm = document.getElementById(i);
document.getElementById(”moreUploads”).removeChild(elm);
upload_number = upload_number - 1;
}
</script>
</head>
<body>
<div class=”fieldset”>
<div class=”fieldhead”>Photos/Videos:</div>
<div class=”fieldinput”><input type=”file” name=”image[temp_image]” id=”attachment” onchange = “document.getElementById(’moreUploadsLink’).style.display = ‘block’;” /></div>
<div id=”moreUploads”></div>
<div id=”moreUploadsLink” style=”display:none;”>
<a href=”javascript:addFileInput();”>Attach another file</a></div>
<input type=”hidden” name=”attachments” id=”attachments” value=”1″ />
</div>
</body>
</html>

Cat subCat

category.php

<?php
include”config.php”;
include”opendb.php”;

if(isset($_POST['Submit']))
{
$catname = $_POST['catname'];

$qry = “INSERT INTO category(cat_name) VALUES(’$catname’)”;
$result = mysql_query($qry);
}
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Untitled Document</title>
</head>
<body>
<form id=”form1″ name=”form1″ method=”post” action=”#”>
<table width=”500″ border=”1″ cellspacing=”2″ cellpadding=”2″ align=”center”>
<tr>
<td colspan=”3″><label><strong>Category</strong></label>
<strong></strong></td>
</tr>
<tr>
<td width=”123″><label></label>
Category Name: </td>
<td width=”357″><label>
<input name=”catname” type=”text” id=”catname” />
</label></td>
</tr>
<tr>
<td colspan=”2″><label>
<div align=”center”>
<input type=”submit” name=”Submit” value=”Submit” />
</div>
</label></td>
</tr>
</table>
</form>
</body>
</html>

subcategory.php

<?php
include “config.php”;
include “opendb.php”;

if(isset($_POST['Submit']))
{
$cat_name = $_POST['cat'];
$subcatname = $_POST['sub_name'];
$qry = “INSERT INTO subcategory(cat_id,subcat_name) VALUES(’$cat_name’, ‘$subcatname’)”;
$query_rs=mysql_query($qry);
}
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Untitled Document</title>
</head>

<body>
<form id=”form1″ name=”form1″ method=”post” action=”#”>

<table width=”500″ border=”0″ cellspacing=”2″ cellpadding=”2″>
<tr>
<td>Cat_Name</td>
<td><?php
$cat_qry = “SELECT * FROM category”;
$cat_result = mysql_query($cat_qry) or die(mysql_error());
?>
<select name=”cat” id=”cat”>
<?php
while($output = mysql_fetch_array($cat_result))
{
?>
<option value=”<? echo $output['cat_name'];?>”><? echo $output['cat_name'];?></option>
<?php
}
?>
</select></td>
</tr>
<tr>
<td>Sub_Cat_Name</td>
<td><input name=”sub_name” type=”text” id=”sub_name” /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type=”submit” name=”Submit” value=”Submit” /></td>
</tr>
</table>
</form>
</body>
</html>

popup


web links for scripts

how to install and configure:
———————————————————————————-
http://www.php.net/downloads.php
http://itmanagement.earthweb.com/osrc/article.php/3689281
http://www.globalguideline.com
http://www.javascriptfreecode.com/
http://javaboutique.internet.com/
http://www.geocities.com/SiliconValley/Station/4320/
http://www.javascript.com/
http://www.javascriptsearch.com/

http://www.white-hat-web-design.co.uk/articles/php-captcha.php

Getting information from database and display on the screen

http://www.php.happycodings.com/
http://www.daniweb.com/forums/thread112526.html
http://www.javascripter.net/
http://www.the-art-of-web.com/php/
http://www.the-art-of-web.com/javascript/
http://www.programmerskit.com/
javascript :

http://tom.me.uk/scripting/dropdowns.html

redirect page:
http://www.getfreesofts.com/script/146/9850/Simple_Redirect.html

scroll up and down:

http://en.allexperts.com/q/Javascript-1520/fix-layer-position-2.htm
http://ww.smashits.com/player/ra/ondemand/raplayer.asp?16616
http://www.mag4you.com/english_mp3_songs/britney-spears.asp#download
page generation:
http://www.webmasterworld.com/forum21/4800.htm

PHP Functions Essential Reference:
http://www.phpdig.net/ref/
http://www.severnsolutions.co.uk/twblog/archive/2003/11/10/phpsessionmanage
http://www.phpdig.net/ref/rn56.html
http://www-eleves-isia.cma.fr/documentation/PhpDoc/index.html
http://www-eleves-isia.cma.fr/documentation/PhpDoc/language.variables.predefined.html
sunil.guru@gmail.com
www.srishtisoft.com
http://www.webscriptexpert.com/items/php/
http://www.onlamp.com/pub/a/onlamp/excerpt/mysqlckbk/index1.html
http://www.onlamp.com/pub/a/php/2004/08/26/PHPformhandling.html
http://www.trans4mind.com/personal_development/phpTutorial/sessionStart.htm
http://www.freewebmasterhelp.com/tutorials/cookies/2
http://www.phpreg.com/index.php?option=com_content&task=view&id=151&Itemid=25

mysql :
http://sql-info.de/mysql/examples/CREATE-TABLE-examples.html
http://wiki.forum.nokia.com/index.php/Database_use_with_PHP_and_mySQL
http://www.oreilly.com/catalog/mysqlspp/
http://www.webpronews.com/topnews/2003/09/09/creating-a-secure-php-login-script
http://htmlfixit.com/
http://www.webreference.com

PHP/MYSQL Configuration:

Contents

* 1 Desktop session management
* 2 Browser session management
* 3 Web server session management

———————————————————————————————————————————–
Variables-Predefined Variables, Server Variables, Global Variables.
———————————————————————————————————————————–
Predefined Variables: or PHP Superglobals:
————————————————–
$GLOBALS:
Contains a reference to every variable which is currently available within the global scope of the script. The keys of this array are the names of the global variables. $GLOBALS has existed since PHP 3.

$_SERVER:
Variables set by the web server or otherwise directly related to the execution environment of the current script. Analogous to the old $HTTP_SERVER_VARS array (which is still available, but deprecated).

$_GET:
Variables provided to the script via URL query string. Analogous to the old $HTTP_GET_VARS array (which is still available, but deprecated).

$_POST:
Variables provided to the script via HTTP POST. Analogous to the old $HTTP_POST_VARS array (which is still available, but deprecated).

$_COOKIE:
Variables provided to the script via HTTP cookies. Analogous to the old $HTTP_COOKIE_VARS array (which is still available, but deprecated).

$_FILES:
Variables provided to the script via HTTP post file uploads. Analogous to the old $HTTP_POST_FILES array (which is still available, but deprecated). See POST method uploads for more information.

$_ENV:
Variables provided to the script via the environment. Analogous to the old $HTTP_ENV_VARS array (which is still available, but deprecated).

$_REQUEST:
Variables provided to the script via the GET, POST, and COOKIE input mechanisms, and which therefore cannot be trusted. The presence and order of variable inclusion in this array is defined according to the PHP variables_order configuration directive. This array has no direct analogue in versions of PHP

$_SESSION :
Variables which are currently registered to a script’s session. Analogous to the old $HTTP_SESSION_VARS array (which is still available, but deprecated). See the Session handling functions section for more information.

Apache variables:

$GATEWAY_INTERFACE

What revision of the CGI specification the server is using; i.e. ‘CGI/1.1′.
$SERVER_NAME

The name of the server host under which the current script is executing. If the script is running on a virtual host, this will be the value defined for that virtual host.
$SERVER_SOFTWARE

Server identification string, given in the headers when responding to requests.
$SERVER_PROTOCOL

Name and revision of the information protocol via which the page was requested; i.e. ‘HTTP/1.0′;
$REQUEST_METHOD

Which request method was used to access the page; i.e. ‘GET’, ‘HEAD’, ‘POST’, ‘PUT’.
$QUERY_STRING

The query string, if any, via which the page was accessed.
$DOCUMENT_ROOT

The document root directory under which the current script is executing, as defined in the server’s configuration file.
$HTTP_ACCEPT

Contents of the Accept: header from the current request, if there is one.
$HTTP_ACCEPT_CHARSET

Contents of the Accept-Charset: header from the current request, if there is one. Example: ‘iso-8859-1,*,utf-8′.
$HTTP_ACCEPT_ENCODING

Contents of the Accept-Encoding: header from the current request, if there is one. Example: ‘gzip’.
$HTTP_ACCEPT_LANGUAGE

Contents of the Accept-Language: header from the current request, if there is one. Example: ‘en’.
$HTTP_CONNECTION

Contents of the Connection: header from the current request, if there is one. Example: ‘Keep-Alive’.
$HTTP_HOST

Contents of the Host: header from the current request, if there is one.
$HTTP_REFERER

The address of the page (if any) which referred the browser to the current page. This is set by the user’s browser; not all browsers will set this.
$HTTP_USER_AGENT

Contents of the User_Agent: header from the current request, if there is one. This is a string denoting the browser software being used to view the current page; i.e. Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586). Among other things, you can use this value with get_browser() to tailor your page’s functionality to the capabilities of the user’s browser.
$REMOTE_ADDR

The IP address from which the user is viewing the current page.
$REMOTE_PORT

The port being used on the user’s machine to communicate with the web server.
$SCRIPT_FILENAME

The absolute pathname of the currently executing script.
$SERVER_ADMIN

The value given to the SERVER_ADMIN (for Apache) directive in the web server configuration file. If the script is running on a virtual host, this will be the value defined for that virtual host.
$SERVER_PORT

The port on the server machine being used by the web server for communication. For default setups, this will be ‘80′; using SSL, for instance, will change this to whatever your defined secure HTTP port is.
$SERVER_SIGNATURE

String containing the server version and virtual host name which are added to server-generated pages, if enabled.
$PATH_TRANSLATED

Filesystem- (not document root-) based path to the current script, after the server has done any virtual-to-real mapping.
$SCRIPT_NAME

Contains the current script’s path. This is useful for pages which need to point to themselves.
$REQUEST_URI

The URI which was given in order to access this page; for instance, ‘/index.html’.

———————————————————————————————————————————–
Functions-Array Functions, String Functions:
———————————————————————————————————————————–
Types of Errors:  [warning] [notices] [fatal errors.]
———————————————————————————————————————————–
Session Management
———————————————————————————————————————————–

Php: Opensource Tools:

joomla [cms]
os-commerce [shopping cart]
moodle [learning site]
drupal
——————————————————-
http://scripts.franciscocharrua.com/mysql-login.php

php:

snippets:

http://www.scriptsearch.com/PHP/

http://www.jonasjohn.de/snippets/php/
http://php.snippetdb.com/
http://www.spoono.com/php/snippets/
http://www.joomlaresource.com/Webmaster_Tutorials/PHP_Tutorials/

http://www.activewidgets.com/javascript.forum.12393.22/simple-php-mysql-example.html
http://www.webgeekworld.com/index.php?id_category=37&action=descend

ecommerce:

1. Adding, modifying, deleting products to the database from the admin console
2. Viewing the latest orders from the database, viewing past orders
3. Displaying the products online
4. Maintaining a shopping cart (add, delete, update)
5. User registration and updation
6. Passing the amount to the gateway

- Contact -
VINAYAK INFOTECH
#80/96 Chamiers Road, Teynampet, Chennai
Tamil Nadu, South India

Phone +91 44 2435 9585

Fax
+91 44 4211 2084

maximize window

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Untitled Document</title>
<script language=”JavaScript1.2″>

/***********************************************
* Auto Maximize Window Script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for this script and 100’s more.
***********************************************/

top.window.moveTo(0,0);
if (document.all) {
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById) {
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}

</script>
</head>

<body>
</body>
</html>

« Previous entries