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?
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
"पाउजु त राम्रो ",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.
उकाली उकालीमा जादा जादै by Hemanta Sharma
उकाली उकालीमा जादा जादै by Hemanta Sharma ,ukali ukalima jada jadai, hemanta, sharma, उकाली उकालीमा जादा जादै by Hemanta Sharma
Popular posts
-
Damber Nepali Songs
Top & Famous Songs Aja Aakash Ma Euta Tara Tara Antim Palta Bhetna Aau Sabai Sathi Gaye Bigreko Manche Ma Ke Samjhi Khelyau Timro Pauju ...
-
ACKNOWLEDGEMENT and table of content of E-shopping
ACKNOWLEDGEMENT This report has been prepared for the Final Year Project on topic “E-shoppin...
-
Questions for boring minds
1) Without touching,how will you kill a Plant ? a) By Knife b) By Rope and Gun c) By Scolding d) None 2) I was in Dream. In Dream I visited ...
Featured Post
If Something Happened to You, Could Your Family Find Your Money?
Nobody likes this question, so let's get it over with quickly. If you were seriously ill or died tomorrow, would your family know whe...
Popular Posts
-
Your Loan History Follows You: CIB Reports and Blacklisting in Nepal
Every time you apply for a loan from a bank or financial institution in Nepal, someone checks your record with the Credit Information Bur...
-
What a Share Trade Really Costs: Commission, Fees and Capital Gains Tax
You buy a share at Rs 500 and sell it at Rs 540. That's Rs 40 profit per share, right? Not quite. By the time the broker, SEBON, the ...
-
SIP in Nepal: Investing a Fixed Amount Every Month in Mutual Funds
A question I get a lot: "I don't have a big sum to invest. Is it even worth starting?" Yes. In fact, for most salaried peop...
-
EPF, CIT and SSF: Where the Retirement Deduction on Your Payslip Goes
If you have a salaried job in Nepal, your payslip probably has a line that quietly takes a chunk of your pay before you see it. It might ...
-
Festival Spending Without the Hangover: Start Saving for Next Dashain Now
Dashain is just behind us and Tihar is a couple of weeks away. If you're like most Nepali households, this is the most expensive stre...
-
Drupal JavaScripts to hide and show resources
{# 1. Main slider paragraph template #} {# File: templates/paragraph--slider-with-resources.html.twig #} <div class="slider-with-res...
-
Reading Your Salary Slip: Where Your Pay Goes Before It Reaches You
Your offer letter said Rs 60,000 a month. Your bank account says something smaller. Most people shrug and assume "tax," but a s...
-
Small Scans, Big Leaks: Getting Control of Your Wallet and QR Spending
A few years ago, paying for tea meant opening your purse and seeing the notes get thinner. Now it's a scan, a beep, done. eSewa, Khal...
-
Buying Gold This Tihar? Jewellery Isn't the Same as Investing in Gold
In most Nepali families, gold isn't really a financial decision. It's a wedding gift, a mother's security, something you buy ...
-
Before You Sign for That Loan: What an EMI Really Costs You
Festival season is loan season. The scooter ads, the "zero down payment" phone offers, the cousin who just got a personal loan ...