Monday, January 4, 2010
The register_globals php.ini Directive Is Disabled
Versions of PHP prior to 4.2 shipped with the php.ini register_globals directive set to 'Yes' by default. This caused submitted parameters ('user' and 'address' in Listing 10.2) to be generated as global variables ($user, $address). This functionality is now disabled by default, and register_globals is set to 'No'. You can reverse this setting yourself by setting register_globals back to 'Yes' in the php.ini file, but use of automatic globals is now actively discouraged because of the potential security risks involved.
The superglobal variables $_GET, $_SET, and $_REQUEST are unaffected by the register_globals directive.
Reading Input from the Form
Reading Input from the Form in Listing 10.2
1:
2: "-//W3C//DTD XHTML 1.0 Strict//EN"
3: "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4:
5:
6:<a class="docLink" href="#ch10list03">Listing 10.3</a> Reading Input from the Form in <a class="docLink" href="#ch10list02">Listing 10.2</a>
7:
8:
9:15:
10: 11: print "Welcome ".$_GET['user']."
\n\n";
12: print "Your address is:
".$_GET['address']."";
13: ?>
14:
16:
Some Common $_SERVER Elements Variable
$_SERVER['PHP_SELF']
The current script. Suitable for use in links and form element action arguments.
/phpbook/source/listing10.1.php
$_SERVER['HTTP_USER_AGENT']
The name and version of the client.
Mozilla/4.6 –(X11; I;Linux2.2. 6-15apmac ppc)
$_SERVER['REMOTE_ADDR']
The IP address of the client.
158.152.55.35
$_SERVER['REQUEST_METHOD']
Whether the request was GET or POST.
POST
$_SERVER['QUERY_STRING']
For GET requests, the encoded data sent appended to the URL.
name=matt&address=unknown
$_SERVER['REQUEST_URI']
The full address of the request, including query string.
/phpbook/source/listing10.1.php? name=matt
$_SERVER['HTTP_REFERER']
The address of the page from which the request was made.
http://p24.corrosive.co.uk/ref.html
PHP Superglobal Arrays Array
Description
$_COOKIE
Contains keys and values set as browser cookies
$_ENV
Contains keys and values set by the script's shell context
$_FILES
Contains information about uploaded files
$_GET
Contains keys and values submitted to the script using the HTTP get method
$_POST
Contains keys and values submitted to the script using the HTTP post method
$_REQUEST
A combined array containing values from the $_GET, $_POST, and $_COOKIES superglobal arrays
$_SERVER
Variables made available by the server
$GLOBALS
Contains all global variables associated with the current script
Working with Forms
How to access information from form fields?
How to work with form elements that allow multiple selections?
How to create a single document that contains both an HTML form and the PHP code that handles its submission?
How to save state with hidden fields?
How to redirect the user to a new page?
How to build HTML forms that upload files and how to write the PHP code to handle them?
Sunday, January 3, 2010
Php and mysql
<html>
<head>
<title>Untitled Page</title>
<script type="text/javascript">
<!--
function BatchValidation()
{
var validationMessage="";
if(document.form1.txtFName.value=="")
{
validationMessage+="\n First Name is the required field!";
}
if(document.form1.txtLName.value=="")
{
validationMessage+="\n Last Name is the required field!";
}
if(!IsCorrectEmailFormat(document.form1.txtEmail.value))
{
validationMessage+="\n Email address is not valid format!";
}
if(isNaN(document.form1.txtPhoneNo.value))
{
validationMessage+="\n Phone number is number!";
}
if(isNaN(document.form1.txtMobileNo.value))
{
validationMessage+="\n Mobile number is number!";
}
if(validationMessage.length>0)
{
alert(validationMessage);
return false;
}
else
{
return true;
}
}
function IsCorrectEmailFormat(strEmail)
{
var at="@"
var dot="."
var atPos=strEmail.indexOf(at)
var lstr=strEmail.length
var dotPos=strEmail.indexOf(dot)
if (atPos==-1 || atPos==0 || atPos==lstr){
return false
}
if (dotPos==-1 || dotPos==0 || dotPos==lstr){
return false
}
if (strEmail.indexOf(at,(atPos+1))!=-1){
return false
}
if (strEmail.substring(atPos+1,atPos+2)==dot){
return false
}
if (strEmail.indexOf(dot,(atPos+2))==-1){
return false
}
if (strEmail.indexOf(" ")!=-1){
return false
}
if(dotPos<atPos)
{
return false;
}
return true
}
function CheckRequiredField(strFieldName,tag)
{
if(tag.value=="")
{
ErrorMessage.innerHTML=strFieldName + " is Required field!";
}
}
function RealTimeEmailValidation(strEmail)
{
if(strEmail.toString().length>0)
{
if(!IsCorrectEmailFormat(strEmail))
{
ErrorMessage.innerHTML="Email is not in correct format!";
}
}
}
function RealTimeNumberValidation(num)
{
if(isNaN(num))
{
ErrorMessage.innerHTML="Phone no is number!";
}
}
function NumberOnly(aTexField,e)
{
var keyCode = window.event? window.event.keyCode : e.which;
if(keyCode>47 && keyCode<58)
{
}
else
{
window.setTimeout("RemoveLastChar('"+aTexField.id+"')",100);
}
}
function RemoveLastChar(aTextFieldID)
{
var aTextField=document.getElementById(aTextFieldID);
var val=aTextField.value.toString();
var len=val.length;
val=val.substring(0,len-1);
aTextField.value=val;
}
function IsEmpty(aTextField) {
if ((aTextField.value.length==0) ||
(aTextField.value==null)) {
return true;
}
else
{
return false;
}
}
function IsValidEmail(aTextField)
{
var emailRegxp = /^[a-zA-Z\.][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/
if(emailRegxp.test(aTextField.value)!=true)
{
return false;
}
else
{
return true;
}
}
// -->
</script>
</head>
<body>
<form id="form1" name="form1" onsubmit="return BatchValidation();">
<table>
<tr>
<td>
First Name:
</td>
<td>
<input type="text" name="txtFName" id="txtFName" onblur="CheckRequiredField('First Name',this);" />
</td>
</tr>
<tr>
<td>
Last Name:
</td>
<td>
<input type="text" name="txtLName" id="txtLName" onblur="CheckRequiredField('Last Name',this);" />
</td>
</tr>
<tr>
<td>
Address:
</td>
<td>
<input type="text" name="txtAddress" id="txtAddress" />
</td>
</tr>
<tr>
<td>
Email:
</td>
<td>
<input type="text" name="txtEmail" id="txtEmail" onblur="RealTimeEmailValidation(this.value);" />
</td>
</tr>
<tr>
<td>
Phone No:
</td>
<td>
<input type="text" name="txtPhoneNo" id="txtPhoneNo" onblur="RealTimeNumberValidation(this.value)"/>
</td>
</tr>
<tr>
<td>
Mobile No:
</td>
<td>
<input type="text" name="txtMobileNo" id="txtMobileNo" onkeydown="NumberOnly(this,event)" />
</td>
</tr>
<tr>
<td colspan="2"><span id="ErrorMessage" style="color:Red;"></span></td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="Save" /> <input type="reset" value="Cancel" />
</td>
</tr>
</table>
</form>
</body>
</html>
php and mysql, web application development with php and mysql download, cbtnuggets php and mysql megaupload, php and mysql video training, php and mysql video training livelessons prentice, practical php and mysql, free download php and mysql livelessons prentice, learning mysql and php, cbt nuggets php and mysql megaupload, ebook php and mysql simon stobart and david parsons, free php and mysql hosting,php and mysql livelessons prentice, php and mysql simon stobart and david parsons,, javascript form validation, excell inventory validation form, frontpage form validation, software validation form, apache form validation, form validation java script, form validation libraries, java swing form validation, swt form validation, appframework form validation, good and scates validation form, how to handle javascript form validation com automation, jquery validation disabling form, netbeans platform form validation, open source rich form validation, php form validation
Saturday, January 2, 2010
"पाउजु त राम्रो ",hemant sharma new nepali song
hemant sharma, nepal नेपाली nepalese song, music folk dohori, culture pop, rock love, video kathmandu, beni bazar, myagdi, latest, lok, modern, rap, movie, hip, hop, film, jyamrukot, baglung, dhaulagiri, pokhara, everest, mechi, mahakali, kali, gandaki, dipen, malla, remix, new, hq, official
जाले रुमाल उडेर मेरो जाले...Hemant Sharma.
nepali music video, hemanत sharma,उडेर मेरो जाले,Nepali Pop Song. Hemant Sharma."BISES" थाप न थाप हाथै मा माया को चिनो मायालु जाला उडेर मेरो जाले...
ल हौ भने रसाइ देउ..Hemant Sharma
nepali pop song.hemant sharma, "आत्मीय" हेमन्त शर्मा,मुल हौ भने रसाइ देउ..Hemant Sharma.
-
Why do niggers wear wide brimmed hats? So birds won't shit on their lips. How do you stop black kids from jumping on your bed? Put Velcr...
-
php, tutorial, sql, video, css, user, login, cookies, lifeg0eson666, marcus, recck, youtube, online, science, A PHP Tutorial creating a User...
-
Building a CMS with PHP and MYSQL Pat 2 video, php tutorials video, php and mysql to make cms video