Entries Tagged as 'OUR web'

mod_rewrite enabling url reqriting on apache and iss server windows and linux

URL reqriting is Simple Rewriting Your URLS (links) Also Redirecting Them To Known URLS.e.g you’ll make the link : view_my_profile.html –> Is Redirected to function.php?op=3
so instead of the link “function.php?op=3″ Which isn’t enough describing itself we’ll make the link “view_my_profile.html” Which is very describtive.Why using mod_reqrite?. Now see if your site has more than 10,000 Links (Dynamic Website) , do you think we would make 10,000 html files ??

=>Of course Not , and here’s the Use Of Mod-Rewrite. We can achive dynamic pages from code and rewrite their URL using this module.

=>well simply This is Very very useful for search Engines to correctly index Your website and gather keywords, we’ll talk about this in details in “Search Engine Optimization Tips”

How to Enable Mod_rewrite:-
how to configure mod_reqrite to work It Depends On Your Operating System (Server’s Software) .

  • For Linux It’s Supported By Default (in Most Of The Servers) – ModRewrite Is An Apache Module You Don’t Have To Setup Anything And We wont Go On How To Install The Mod-Rewrite On Your Linux Server Cause It’s little Advanced And Complicated.However you can have mod_rewrite module loaded in apache.
  • For windows : A lot of developers think that it’s not supported by windows server but infact it is.I’ll Describe How You Can Set it Up On windows (Assuming That You Have IIS installed On Your PC/Server).But If You Haven’t Then You Can Refer To This Post: showthread.php?t=1 (http://www.phpegypt.net/forum/showthread.php?t=1)
    • For Windows XP / 2003 Server
      • You Must Download The Files From ( http://www.iismods.com/download.htm ) also I Attached It to This Post .. [It's Free Released under the GNU General Public License (v2)](May be this link is not working sometimes.)
      • Place It Somewhere on your H.D.D let’s Say “c:\mod_rewrite”
      • Goto Control Panel -> Administrative Tools -> Internet Information Services
      • You’ll Find Your Computer name And bet ween 2 Brackets (localhost) Click it -> open “Web Sites” -> “Default Website”.
      • Right click on “Default Website” Choose “properties”.
      • You’ll Find Many Tabs At The Top Click “ISAPI Filters”.
      • Click Add, Enter “MOD_REWRITE” As The filert name And For The executable Click “Browse” And Choose The file “c:\mod_rewrite\mod_rewrite.dll” or just choose The file “mod_rewrite.dll” Which You Extracted In The Desired Folder.
      • Now Click “Ok” ,Mod Rewrite Should Appear In The List now With Empty Status , and Filername = “MOD_REWRITE” and priority *unknown*..
      • Now You’re Ready To Run The MOD_REWRITE, Click Start->Run
      • Enter the following “iisreset” and click O.K It’ll Perform 4 Quick Operations (restart the iis server) And The window Will Close After That You’re Ready To Test Your ModRewriteNow Assuming That Everything Goes Right.
  • Apache/Wamp PHP based:-
    • For apache windows WAMP server you can turn the mod_rewrite extension on by
      • Right clicking on wamp icon click on mod_rewrite.
      • Restart wamp server.
  • Apache Linux/Windows Without WAMP:-
    • RewriteRule Source Destintion [options]

      Description:

      RewriteRule: Syntax Keyword That Must Exist Before Any Rule

      Source: The Source Link That Will Appear In Browser & For Users

      Destintion: The Translated (Replaced) Link That Will Appear To The Server.

      [options]: Some Extra Options That Can Be Left Empty

      e.g. [L] To make This Rule The Last And Server Shouldn’t Continue Fetching Rules After it . . . And many Other Options That Will Come Later

      Now Let’s Make Our First Example:

      RewriteRule ^helloworld.html index.php?module=hello

    • Now You Can Play Around With URLs Like :

      RewriteRule ^contactus.html index.php?oper=contactus

      RewriteRule ^aboutus.html index.php?mod=about

      RewriteRule ^login.html index.php?do=login

      .

      .

      .

      etc.

      * Just Remember

      Your .htaccess (apache) should be looking like this :

      RewriteEngine On

      RewriteRule ^login.html index.php?do=login

      Or your mod_rewrite.ini (IIS with mod_rewrite FILTER):

      Debug 0 # This Line Isn’t Important

      Reload 500 # This Line Isn’t Important

      RewriteRule ^login.html index.php?do=login

=>In Windows Your Rules Will be Written In The file “c:\mod_rewrite\mod_rewrite.ini” And In Linux (Apache) Rules Will be written in “.htaccess” (A File That Will/May be located on the root of your website).

So Configuring PHP on iss server is simple..!


Firefox EC2 UI Elasticfox plugin extension for Managing Amazon EC2 Images

Firefox EC2 UI for Managing Amazon EC2 Images

Firefox provides easy plugin for managing EC2 images in a GUI method.You can download elastiic fox extension from firefox site.
The instructions for creating an Amazon EC2 image walk through the use of command line tools which is really great. Learning how to do it this way is important because it helps you understand more about what you’re actually doing. But once you understand it all, it can be a headache to have to remember all the commands and options because they’re all rather similar. So quickly after learning all about Amazon EC2, my buddy Hiram told me about the Firefox Extension for Amazon EC2.

This Firefox extension is such an incredible time saver for most of the tasks of managing images. Starting and stopping images, grabbing the public DNS name of an image, etc. are as easy as clicking a button. After you’ve taken the time to understand how to create and work with images from the command line, it is definitely worth using this extension.

Prerequisites

  • This extension requires Mozilla Firefox version 1.5.0 or later.

Running the Extension

Install the extension by clicking on the following link with Mozilla Firefox:

Download link removed…

Firefox guides you through the installation process. You may need to configure Firefox to install software from this domain.

Documentation

Read the ElasticFox Getting Started Guide for information on using the extension.


Node List Javascript | Traverse nodes Dom Elements In javascript

The NodeList object represents a live collection of Node objects. This means that any alterations to the number or properties of nodes is immediately reflected in the list. This list permits indexed access to individual nodes as well as iteration through the collection. To demonstrate this Object we shall use the following simple XML file ‘library.xml’.

<library>
<book>
<category>fiction</category>
<title>Eyeless in Gaza</title>
<author>Aldous Huxley</author>
</book>
<book>
<category>classics</category>
<title>John Barleycorn</title>
<author>Jack London</author>
</book>
</library>

We shall now create a NodeList object of all the ‘title’ elements using the document’s getElementsByTagName method. The number of nodes in the collection is determined using the length property, and their nodeValue properties are displayed by accessing each in turn through the item method.

Code (JavaScript):
var xml_doc = new ActiveXObject(“Microsoft.XMLDOM”);
xml_doc.async = false;
xml_doc.load(“library.xml”);

var title_nodes = xml_doc.getElementsByTagName(“title”);
var n_titles = title_nodes.length
for (i = 0; i < n_titles; i++)
document.write(title_nodes.item(i).text + “<br>”);

Output:
Eyeless in Gaza
John Barleycorn

There are also Microsoft extensions for this object.
PROPERTIES

length Property
This property returns the number of items in the NodeList collection.

Syntax: NodeList.length

METHODS

item Method
This method returns the item at the specified index of the Node collection. These are numbered from 0 to one less than the value of the length property. Using an invalid index returns null.

Syntax: NodeList.item(index)


What is a Web browser? Understanding and explaining term “Web Browser”

Few Definitions for browser:-

  • Browser is an application, which helps us to view the Web sites and the web content.
  • Web sites are located in some remote systems, which needs a special kind of program or an application to access them, such an application is called browser.
  • A browser is an application which you can use to retrieve web pages from web sites and view.
  • When you type a URL in the browser, the browser will convert it into a web request which web server can understand. Browser will send the request to web server using the HTTP protocol.
  • When a web server returns a web page as a Response, the browser will understand the response and display the body of the response to the user in browser.
  • In simple terms a browser can be defined as “A software application used to locate and display Web pages”
  • You can create your own simple browser application using C++, C#, VB.NET or any other language you like. All you need to know is, how to compose a request which web server can understand, how to parse and display the response from web server and communicate with webserver using HTTP protocol.
  • Even though the basic job of browser is just send requests to web server and receive response from the server, modern browser provide several other enhanced features including Back/Forward buttons, save viewed files to disk so that they can be viewed later, cache images so that the same images need not be downloaded again and again etc.
  • Internet Explorer, Netspace, Mozilla are some of the popular web browsers currently available in the market.
  • Netscape was the most popular web browser till 4-5 years back, but currently more than 90% of the internet users use “Internet Explorer” to browse the websites.

Understanding ASP.NET Validation Controls

ASP.NET validation controls provide an easy-to-use but powerful mechanism of ensuring that data is entered correctly on the forms. There are 6 validation controls included in the ASP.NET 2.0 and ASP.NET 3.5 versions


<script type="text/javascript">
function ValidateCheckBox()
{

}
</script>
<asp:Button ID="btnPost" runat="server" Text="Post"
OnClientClick="javascript:return ValidateCheckBox();"  OnClick="btnPost_Click" />

In this article, let us see some tips and tricks that can be applied to the validation controls. This article is for beginner and intermediate users who have been using validation controls. There is something for everyone!!
Tip 1: Always use Page.IsValid before submitting data. Apart from the other benefits, using it prevents submitting data from old browsers that do not support javascript.
Tip 2: The display property for the ASP.NET validation controls has 3 settings: None, Static(default), and Dynamic. ‘Static outputs HTML code (related to error) at all times even when no error has occurred. So when there is more than one validation control placed next to the field, the first validation control occupies screen space even when there is no error. In case the second validation control fires an error message, the message is pushed away from the control since the first validation control is occupying screen space.
Set the ‘display’ property of a validation control to ‘Dynamic’. This property renders the error message with the attribute display:none; It helps you to display the error message next to the control .
Tip 3: To prevent validation to occur on the click of the Cancel button, set the ‘CausesValidation’ property to false
<asp:Button ID=”btnCancel” Runat=”server” CausesValidation=”False” Text=”Cancel” />
Tip 4: Use the ‘InitialValue’ property of the RequiredFieldValidator to validate controls like combobox which have a default value.
For eg: If your combobox has a default item called “–Select –“ and you want that the user should select a value other than the default value before submitting the form, then set the ‘InitialValue’ property of the RequiredFieldValidator to “–Select–“.
<asp:DropDownList ID=”DropDownList1″ runat=”server”>
<asp:ListItem Value=”–Select–” />
<asp:ListItem Value=”Item1″ />
<asp:ListItem Value=”Item2″ />
<asp:ListItem Value=”Item3″ />
</asp:DropDownList>
<asp:RequiredFieldValidator ID=”RequiredFieldValidator1″ runat=”server” ErrorMessage=”RequiredFieldValidator” ControlToValidate=”DropDownList1″ InitialValue=”–Select–”></asp:RequiredFieldValidator>
Tip 5: A RegularExpressionValidator can be used to handle string patterns. For eg: A Name textbox that should accept a maximum of 30 characters with only alphabets, space, fullstop(.) and a ‘(apostrophe). A regularexpression like ‘^([a-zA-z.'\s]{2,30})$’ does the trick.
However when you are using Localization and using a language like Arabic, you have to often provide for validating characters in a different dialect. You can solve this using the following technique:
- In the Resource.resx file, create a resourcekey called ValidName giving it a value of ^([a-zA-z.'\s]{2,30})$
- In the Resource.ar-EG.resx file, use the same key but with a diff value ^([
\u0600-\u06FF.'\s]{2,30})$
Use it in your page using the following way. Observe the bold text:

<asp:RegularExpressionValidatorID=’regEVFname’ runat=’server’ControlToValidate
=’txtName’
Display=’Dynamic’ErrorMessage
=’Invalid’
ValidationExpression
=’<%$ Resources:Resource, ValidName %>SetFocusOnError=’True’></asp:RegularExpressionValidator>

When the user selects English, he can enter only A-Za-z. Similarly for Arabic, he can enter only the Arabic characters and not English.
Tip 6: The validation controls provide both Server and Client Side validation. To turn off client-side validation, set the ‘EnableClientScript = false’
<asp:RequiredFieldValidator ID=”RequiredFieldValidator2″ Runat=”server”
Text=”Error” ControlToValidate=”TextBox1″ EnableClientScript=”false”/>
Tip 7: Use CompareValidator to validate date with format of “dd/MM/yyyy”.
The validator uses the CultureInfo object of the thread to determine date format. So what you need to do is to set the desired culture format in the Page directive
<%@ Page culture=”your culture” %>
This tip was shared by PeterBlum in the asp.net forums. By the way, Peter has an amazing suite of data entry and validation controls on his site at a reasonable price.
Tip 8: Instead of the textual error message, you can even add an image or sound to your validator control. The Text and Error Message property accepts HTML tags.
<asp:TextBox ID=”TextBox1″ runat=”server”></asp:TextBox>
<br />
<asp:RequiredFieldValidator ControlToValidate=”TextBox1″ EnableClientScript=”false” ID=”RequiredFieldValidator1″ runat=”server” Text=”<bgsound src=’C:\Windows\Media\Windows Error.wav’>”></asp:RequiredFieldValidator>
Just make sure that the EnableClientScript=”false” when you want a sound instead of a text message.
Tip 9: If you have two set of forms (eg: Login and Registration) in a single page and want to keep the validation of the two groups separate, use ‘ValidationGroups’. All you need to do, is to specify a common group name for a set of controls that you want to validate separately.
<div>
<asp:TextBox ID=”TextBox1″ ValidationGroup=”Group1″ runat=”server”></asp:TextBox>
<br />
<asp:RequiredFieldValidator ControlToValidate=”TextBox1″ ValidationGroup=”Group1″ ID=”RequiredFieldValidator1″ runat=”server” Text=”Error”></asp:RequiredFieldValidator>
<asp:Button ID=”Button1″ runat=”server” ValidationGroup=”Group1″ Text=”Button” />
</div>
<br />
<br />
<div>
<asp:TextBox ID=”TextBox2″ ValidationGroup=”Group2″ runat=”server”></asp:TextBox>
<br />
<asp:RequiredFieldValidator ControlToValidate=”TextBox1″ ValidationGroup=”Group2″ EnableClientScript=”false” ID=”RequiredFieldValidator2″ runat=”server” Text=”Error”></asp:RequiredFieldValidator>
<asp:Button ID=”Button2″ runat=”server” ValidationGroup=”Group2″ Text=”Button” />
</div>
Tip 10: Other validator controls like CompareValidator, RangeValidator etc. do not provide a way to detect if the field is blank or required. The only way is to do this is to add a RequiredFieldValidator along with the other validator controls.
However one exception being the CustomValidator which provides a property called ‘ValidateEmptyText’. Just set it to true and it validates the field even if the user has kept the field blank.
Tip 11: If you want your validation error message to appear in the ‘ValidationSummary‘ control, then set the ‘ErrorMessage’ property on that validation control. Also, setting ‘ShowMessageBox = true’ on the ValidationSummary enables you to display a popup alert.
Tip 12: In order to create a CustomValidationControl you have to derive from the ‘BaseValidator’ class and implement the ‘EvaluateIsValid()’ method.
Tip 13: In case of an error, the validation controls allow you to set focus on a control in error using the ‘SetFocusOnError’ property.
<asp:RequiredFieldValidator SetFocusOnError=”true” ControlToValidate=”TextBox1″ ID=”RequiredFieldValidator1″ runat=”server” Text=”Error!!”></asp:RequiredFieldValidator>


Validation Control in asp.net

There are two types of validations like client-side and server-side. While client side validations can be performed using JavaScript and VBScript, server side validations can be achieved via classic ASP. The biggest problem with these languages and technologies is that you have to write lengthy code to perform a simple task. Since, VBScript won’t work with Netscape browser, you cannot perform client-side validations using this language. You have to learn JavaScript or Classic ASP to perform validations.
With ASP.NET, these difficulties are eliminated. ASP.NET provides its own built-in controls for validations. You can easily place controls and write codes by using a text editor like Notepad or an IDE like Visual Studio .NET. Moreover, ASP.NET supports C#, Visual Basic .NET, and any other language in the Microsoft .NET family. ASP.NET provides six types of validation controls. They are

  • CompareValidator
  • CustomValidator
  • RangeValidator
  • RegularExpressionValidator
  • RequiredFieldValidator
  • ValidationSummary

Each of these above controls can be linked to .NET Web Form controls like TextBox, Dropdownbox, ListBoxes etc. Even though there are wide ranges of controls for validation, it is up to you to decide upon which control to use. It also depends up on your project needs. In this first part of this series, you will learn the application of first three controls with code listings using VB .NET and C#.

CompareValidator

As the name suggests, this control is used to compare the values of one control with another control. The comparison is done with the help of textboxes. The CompareValidator control has two important properties namely, Operator and Type. The Operator property is mainly used as a basis of comparison between two values (GreaterThan, LessThan, Equal, NotEqual etc) and Type property indicates the data type of the values like Integer, string etc.

To illustrate, copy or enter the code in Listing 1 and save the file with extension .aspx under the Inetpub/wwwroot directory. Be sure to install .NET Framework SDK or Visual Studio .NET before attempting this work.

CustomValidator

With the help of the Custom Validator control, you can write your own functions and use them for performing validations in Web Forms. These functions are similar to that of JavaScript and VBScript functions.

<script runat=”server”>
Sub ServerValidate (sender As Object, _
value As ServerValidateEventArgs)
Dim num As Int32 = Int32.Parse(value.Value)
If num Mod 2 = 0 Then
value.IsValid = True
Exit Sub
End If
value.IsValid = False
End Sub
</script>


<script runat="server">
void Page_Load() {
lblMessage.Text = "Hello World";
}
</script>

Finally, you should integrate the above function with a WebForm control via ClientValidationFunction and ServerValidationFunction properties as shown in listing shown below:

<asp:TextBox id=”Text1″ runat=”server” />
<asp:CustomValidator id=”CustomValidator1″ runat=”server”
ControlToValidate=”Text1″ OnServerValidate=”ServerValidate”
Display=”Static” Font-Name=”verdana” Font-Size=”8pt” foreColor =”blue”
ErrorMessage = “Not an even number”>
</asp:CustomValidator>

You have to specify a client-side or server-side function, which will contain the logic behind the validation using the OnServerValidate property. If there are any parameters, you should also specify those with this function. You should be aware that validations performed on the client’s computer require no round trip to server and hence reducing the valuable online time of users.

RangeValidator

This control is used to accept a range of values. For instance, you can employ this validation control, if a user should have to input values within a range such as from 1 to 100 or from 50 to 150. It accepts two important properties, MinimumValue and MaximumValue, and also the Type property. The listing shown below illustrates the functionality of this control:

<%@ Page Language=”VB” %>
<script runat=”server”>
</script>
<html>
<head><title> Range Validator – VB.NET</title>
</head>
<body>
<form runat=”server”>
<p>
<asp:TextBox id=”TextBox1″ runat=”server”></asp:TextBox>
</p>
<p>
<asp:RangeValidator id=”RangeValidator1″
runat=”server”
ErrorMessage=”Please enter a number between 1 and 100″
ControlToValidate=”TextBox1″
MinimumValue=”1″ MaximumValue=”100″
Display=”Dynamic” Type=”Integer”>
</asp:RangeValidator>
</p>
</form>
</body>
</html>


Projects

We can help you find to post ur projects for the best fitment of programmers and your projects over our website to meet best solutions for the seeking customers, Web Designers and Copywriters. Outsource projects to India any other country.we are going to provide the best business enivironment of IT projects and outsourcing programs and we are a group of IT professionals We can offer websites n softwares and graphic designers and web templetes. We, IT service providers, you can choose/post many projects. For more ask us

- Graphic Design – Logo Design – Banner Design – Java – Javascript – Flash – Website development – Website Maintainence


Welcome To indiapoly..

Welcome to Poly Blog.here You will find interesting things available for all.