Promote your site | Contact

We have 3781 sites listed.


Subscribe (RSS) | Subscribe (ATOM)

Ondir web directory

  • Please select one category :
  • Home
  • New Sites
  • Top PR
  • Top Votes
  • Top Hits
  • Categories
  • Submit a site
Search :
Top Search

Free Web Directory, SEO Services, Online Advertising Member Area

Information

3781 websites
365 Categories

We recommend

Search engine optimization services, seo prices, seo company europe, manual directory submission

Advertising

Our friends

  • Siteuri
  • Promovare site
  • Web Directory
  • SEO Services
  • SEO Firm
  • Bid Directory
  • Director Web
  • Portal Web
  • Sexiest Sites

Booster

Director Web Seo Friendly
Director Web Seo Friendly
Your website here
12
Vote(s)
Vote
  Hosting By NoWares | Simple Solutions - Professional Support   

Hosting By NoWares | Simple Solutions - Professional Support NoWares Hosting

Simple Solutions, Professional Support and design help with your website.

Support Forums with tutorials and webmaster resources

Certified Partner Link
nowareshosting.com | Page Rank : 0

Category : Home > Internet > Web Hosting

  • RSS Feeds : Webmaster Tutorials, Resources and News : Webmaster Tutorials, Resources and News

  • Hiring Ad Paste - 03-07-2008
    Paste n Earn takes one step ahead to serve you the best!

    We proudly announce our marketing solution that meets to all business sizes and sectors.

    Whether you are into local business or looking to expand your target market on a global scale we can help you with our unique and proven marketing solution.

    We have established strategic partnerships with websites like Mag4you.com, Singles-bar.com to fulfil your business needs.

    Our marketing solution carries Text ad placement to email marketing, banner ad placement and tele-marketing.

    And this is not just all. If you are having any specialist requirement please call us and a member of our customer service personnel will be able to discuss your needs and provide a tailor made solution.





    • Home Based Paste and Earn Jobs
    • Earn from home or office
    • Worldwide home based AD Pasting Jobs
    • Work Your Own Hours Full Or Part Time
    • Easy Paste and Earn Jobs With Full Instructions
    • 100% online job
    • NO Faxing or Cold Calling


  • Very Basics Of Creating A Php Form - 14-06-2008
    Well for those learning PHP this is perfect for you! This is a very basic code for forms, with this form you can build off it and make more complex things like a add news form that can be inserted in a database!
    Lets get started!

    This is a simple html form code (Copy and Save this as login.html)
    CODE
    <html>
         <body>

         <form action="welcome.php" method="POST"> Enter your name: <input type="text" name="name" /> Enter your age:  <input type="text" name="age" /> <input type="submit" />
         </form>

         </body>
    </html>


    What this will do is show 2 boxes and you put your name and age in it! Once you hit sumbit it will bring you to welcome.php!

    Copy and paste this code and save it as welcome.php
    CODE
    <html>
         <body>

         Welcome <?php echo $_POST["name"]; ?>.<br /> You are <?php echo $_POST["age"]; ?> years old!

         </body>
    </html>


    Ok now let me explain

    That will get your name and age from the html form we created above and displays it in the welcome.php, cool huh?

    Well there you go! Thats the very basics of creating a PHP form

  • Securing Your Password Hash - 14-06-2008
    There are lots of incidents when our database are compromised. All our admin and users accounts could be compromised. Commonly the practise of securing password is by hashing the password using different alogrithm available like MD5, SHA1, SHA256, etc. We commonly hash the password and insert into the table. When our hash get into the wrong hand it can be cracked using online or offline crackers.

    I am going to show you how to secure you hash. All you need is knowledge of PHP and MYSQL. I'll just be using MD5 function.

    Note: In this post i have not posted the process to clean the users inputs for SQL Injection and other threats. I'll be posting that later. This is just the process before checking the valid username and password.

    Lets create a function which would return the hash:


    CODE
        function createhash($pass)
        {
        $hash = md5($pass); //calculate the md5 value of password
        $pass = strrev($hash); //now lets reverse the hash
        return $pass; //return the value
        }




    The above function will simply reverse the hash. To make even more secure lets see another function.

    CODE
        function createhash($pass)
        {
        $hash = md5($pass); //calculate the md5 value of password
        $pass = strrev($hash); //now lets reverse the hash
        $first = substr($pass, 0, 16); //Return first 16 chars
        $second = substr($pass, 16, 16);//return last 16 chars
        $pass = $second.$first; //add first 16 chars to last 16 chars
        return $pass; //return the value
        }




    Same as first function but here we cut the hash into 2 pieces, 16 chars each and moved first 16 chars after last 16 chars. since md5 have 32 chars it can be divided into two parts.

    This was just a basic example, you can now customize on your own by even parting those 16 chars and later combining them later or even salting the password before hashing and using multiple hash function. e.g:

    $pass = md5(sha1(md5($pass."secretkey"))); //try using multiple hash function

    After you have your hash connect to the DB server and check for validation.

  • Login, Registration And Password Protected Folders - 14-06-2008
    The script allows a user to register, log in, log out, change their password, and retrieve a forgotten password. It also makes sure the user submits a valid email address by sending them a link to their email that they must click before the registration is completed.

    There is no need to know coding the video will walk you through setting it all up. All the files you need are available for download on this site.

    The script for this tutorial comes from the book Visual Quickpro Guide PHP 6 and MYSQL 5. I highly recommend this book if you want to learn php.

    • User Registration
    • Log in
    • Log out
    • User can change password
    • User can retrieve forgotten password
    • Password protect any pages on your site with a small snippet of code
    • Of course it’s free



    Easy Registration, Login, and Password Protected Pages.

    A free registration and login system for your website.

    Download
    http://www.nowareshosting.com/forums/index.php?act=attach&type=post&id=27

  • Simple 3d Text - Photoshop Tutorial - 14-06-2008
    Yet again I felt like making a 3d text effect in Photoshop, so here is how to make a stylish 3d text effect.



    First with the text tool type in the text you want to apply this effect to.

    In the layers panel right click the text layer and choose rasterize layer.

    Now go to edit -> transform -> perspective and drag the right upper corner a bit down as shown below.



    Then again go to edit -> transform -> free transform and drag the right middle corner a bit to the left to change the text width.



    With the text layer selected in the layers panel, now choose the move tool, hold down the alt key and press the left arrow key on the keyboard about 8 times, (depending on how big your font is). This will duplicate the text layer 8 times.



    Select all the text layers in the layers panel except the top one, then right click and choose merge layers.

    Double click the top layer to get to the layers styles panel and give it settings as shown below.



    Double click the text layer below, (the one that should represent the 3d effect) and give it styles as shown below.





    And we are done, to make the reflection I just put a copy of the the layers into another folder and rotated the text scaled it to fit.

  • Opacity Mouseover Effect With Css - 14-06-2008
    In this tutorial we will try something different with css, we will try to make an opacity rollover effect, which could be used as menu items and much more.

    This should be the final result, (note, you might not see anything if you use any special browsers or very old versions, it has to support the opacity css style).

    Now for this example we need to prepare a few things, first create a folder to contain this whole project, save the three images above in the folder and dont rename them because we will be using the names.


    Now open your favorite html editor, (notepad, dreamweaver etc).


    First we will add the css styles at the top.

    CODE
    <style type="text/css">
    .opacityit img{
    filter:progid:DXImageTransform.Microsoft.Alpha(opacity=20);
    -moz-opacity: 0.4;
    }
    .opacityit:hover img{
    filter:progid:DXImageTransform.Microsoft.Alpha(opacity=100);
    -moz-opacity: 1;
    }
    </style>




    That was the styles tag, you can do it in the html file, or export it to an external .css file (then remember to delete the <style> and </style> tags).


    Now we just need to place our elements with html code, and assign some classes to them to make this effect work.

    CODE
    <div id="cat_menu">
    <a href="http://www.nowareshosting.com" class="opacityit"><img border="0" src="ps.jpg" /></a>
    <a href="http://www.nowareshosting.com" class="opacityit"><img border="0" src="flash.jpg" /></a>
    <a href="http://www.nowareshosting.com" class="opacityit"><img border="0" src="3ds.jpg" /></a>
    </div>




    As you might see its quite simple, first I make a div box just as a wrapper to hold the images.

    then every image is shown in as a href link with an class calling for the style class "opacityit" rollover effect.

    If you have trouble making it work you can download a project here, remember if it still doesnt work, check if you use a browser that supports the opacity filter effect.

  • Sms Text Message Enabled Contact Us Form! - 14-06-2008
    It’s easy to setup and it’s free.


    A user fills out a contact form like usual on your website and when they click submit, you get an email from the user and an alert to your cell phone.

    No need to know coding the video will walk you through setting it up. And all the files you need are available for download on this site.

    • Get sms text message alerts when a user submits the form
    • Very simple to integrate into your existing site
    • The form is secured with captcha
    • Displays errors without losing user input
    • Checks user input for security risks
    • Easy to customize and change the look
    • Of course it’s free


    A free contact form that alerts you by text message on your cell phone when a user submits the form. Very handy when you want to be sharp and prompt in responding to your website users.

    Watch the video to the left for step by step instructions on setting up this sms contact form

    Download the SMS Text Message Enabled Contact Us Form
    http://www.nowareshosting.com/forums/index.php?act=attach&type=post&id=26

  • Dhtml Calculator Source Code - 14-06-2008


    A DHTML calculator with error checking. Definitely more stylish than the traditional JavaScript calculator, if nothing else!


    Easy to customize and add to any website

    http://www.nowareshosting.com/forums/index.php?act=attach&type=post&id=25

    CODE
    <table border="2" width="200" cellspacing="0" cellpadding="0" bgcolor="#000000"
    style="border-color:black" onClick="previouskey=event.srcElement.innerText">
      <tr>
        <td width="100%" bgcolor="#FFFFFF" id="result"
        style="font:bold 20px Verdana;color:black;text-align='right'">0</td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center"><table border="0" width="100%"
        cellspacing="0" cellpadding="0" style="font:bold 20px Verdana;color:white">
          <tr>
            <td width="80%" align="center"><table border="1" width="100%" cellspacing="0"
            cellpadding="0" style="cursor:hand;font:bold 20px Verdana;color:white"
            onMouseover="if (event.srcElement.tagName=='TD')event.srcElement.style.color='yellow'"
            onMouseout="event.srcElement.style.color='white'" onselectStart="return false"
            onClick="calculate()" height="82">
              <tr>
                <td width="25%" align="center" height="17">7</td>
                <td width="25%" align="center" height="17">8</td>
                <td width="25%" align="center" height="17">9</td>
                <td width="25%" align="center" height="17">/</td>
              </tr>
              <tr>
                <td width="25%" align="center" height="19">4</td>
                <td width="25%" align="center" height="19">5</td>
                <td width="25%" align="center" height="19">6</td>
                <td width="25%" align="center" height="19">*</td>
              </tr>
              <tr>
                <td width="25%" align="center" height="19">1</td>
                <td width="25%" align="center" height="19">2</td>
                <td width="25%" align="center" height="19">3</td>
                <td width="25%" align="center" height="19">-</td>
              </tr>
              <tr>
                <td width="25%" align="center" height="19">0</td>
                <td width="25%" align="center" height="19"
                onClick="pn();previouskey=1;event.cancelBubble=true">+/-</td>
                <td width="25%" align="center" height="19">.</td>
                <td width="25%" align="center" height="19">+</td>
              </tr>
            </table>
            </td>
            <td width="20%"><div align="left"><table border="1" width="100%" cellspacing="0"
            cellpadding="0">
              <tr>
                <td width="100%" style="cursor:hand;font:bold 20px Verdana;color:white;text-align:center"
                onClick="result.innerText=0;results=''">C</td>
              </tr>
            </table>
            </div><div align="left"><table border="1" width="100%" cellspacing="0" cellpadding="0"
            height="81">
              <tr>
                <td width="100%" style="cursor:hand;font:bold 32px Verdana;color:white;text-align:center"
                onMouseover="event.srcElement.style.color='yellow'"
                onMouseout="event.srcElement.style.color='white'" onClick="calculateresult()">=</td>
              </tr>
            </table>
            </div></td>
          </tr>
        </table>
        </td>
      </tr>
    </table>


    <script language="JavaScript1.2">

    /*
    DHTML Calculator Script-
    © Dynamic Drive (www.dynamicdrive.com)
    For full source code, installation instructions,
    100's more DHTML scripts, and Terms Of
    Use, visit dynamicdrive.com
    */

    var results=''
    var previouskey=''
    var re=/(\/|\*|\+|-)/
    var re2=/(\/|\*|\+|-){2}$/
    var re3=/.+(\/|\*|\+|-).+/
    var re4=/\d|\./
    var re5=/^[^\/\*\+].+\d$/
    var re6=/\./

    function calculate(){
    if (event.srcElement.tagName=="TD"){
    if (event.srcElement.innerText.match(re4)&&previouskey=="=")
    results=''
    if (result.innerText.match(re3)&&event.srcElement.innerText.match(re)){
    if (!results.match(re5)){
    result.innerText="Error!"
    return
    }
    results=eval(results)
    if (results.toString().length>=12&&results.toString().match(re6))
    results=results.toString().substring(0,12)
    result.innerText=results
    }

    results+=event.srcElement.innerText
    if (results.match(re2))
    results=results.substring(0,results.length-2)+results.charAt(results.length-1)

    result.innerText=results
    }
    }

    function calculateresult(){
    if (!results.match(re5)){
    result.innerText="Error!"
    return
    }
    results=eval(results)
    if (results.toString().length>=12&&results.toString().match(re6))
    results=results.toString().substring(0,12)
    result.innerText=results
    }



    function pn(){
    if (result.innerText.charAt(0)!='-')
    result.innerText=results='-'+result.innerText
    else if (result.innerText.charAt(0)=='-')
    result.innerText=results=result.innerText*(-1)
    }

    </script>


  • Take Control With User Javascript - 14-06-2008

    Overriding specific variables or functions


    A User JavaScript is allowed to override variables and functions set by any script on the page. This is done using the defineMagicVariable and defineMagicFunction methods. For example, if a site incorrectly identifies Opera, and then attempts to make Opera execute code that was intended for another browser:

    CODE
    var ie = document.all;


    A user JavaScript may be able to use something like this to override the incorrect detection:

    CODE
    window.opera.defineMagicVariable( 'ie', function () { return 0; }, null );


    Whenever a page attempts to access the value of the variable, the function is run instead, and any value it returns is used in place of the variable's actual value.


    Loading scripts

    To detect when scripts are about to be loaded, interpreted, or run, the window.opera.addEventListener method can be used to detect these events.

    User JavaScripts can use the 'BeforeScript' event to detect when a script on a page is about to be interpreted by the JavaScript engine. If needed, the contents of the script can then be rewritten, or prevented from being interpreted.

    For example, if a script is comparing a non-existent attribute value with null: if( node.getAttribute('myattribute') != null ) {These should never equate to each other, as getAttribute should return a blank string, but some other browsers incorrectly return null. As a result, the script would fail in Opera, which correctly returns a blank string. To prevent this causing problems, a User JavaScript can detect when the script is about to be interpreted, and rewrite it to remove the comparison, since it is unnecessary with this type of statement:

    CODE
    if( location.hostname.indexOf('example.com') != -1 ) {
      window.opera.addEventListener(
        'BeforeScript',
        function (e) {
          e.element.text = e.element.text.replace(/!=\s*null/,'');
        },
        false
      );
    }


    If a page is loading a particular external script that is causing problems, the 'BeforeExternalScript' can be used to detect when that script is about to load, and prevent Opera from loading the script:

    CODE
    if( location.hostname.indexOf('example.com') != -1 ) {
      window.opera.addEventListener(
        'BeforeExternalScript',
        function (e) {
          if( e.element.getAttribute('src').match(/problem\/script\.js$/) ) {
            e.preventDefault();
          }
        },
        false
      );
    }


    Overriding events and event handlers

    User JavaScripts can use one of the 'BeforeEvent.type' events to detect when a script event is about to happen, even if no script on the page is listening for that event. These can be used to target specific event types, such as 'BeforeEvent.click'.

    You can also use 'BeforeEvent' on its own to detect events of any type. In Opera 8, this will not fire if you are listening for a more specific 'BeforeEvent.type'. For example, if you listen for 'BeforeEvent.click', no 'BeforeEvent' events will be fired for click events. Note that since 'BeforeEvent' could detect a substantial number of events, using it may impact performance.

    To prevent scripts on the page from being able to detect the onload event, you can use 'BeforeEvent.load' to cancel it. Note that onload fires for other elements as well, such as images, and the script would need to check if the event was for the whole document:

    CODE
    if( location.hostname.indexOf('example.com') != -1 ) {
      window.opera.addEventListener('BeforeEvent.load',function (e) {
        //check that it is the page loading, not just an image
        if( e.event.target instanceof Document ) {
          e.preventDefault();
        }
      },false);
    }


    In many cases, the 'BeforeEventListener' events may be more useful, as they will only fire if a script on the page is listening for those events. They provide access both to the event object, and the event handler function. The events can be cancelled using preventDefault.

    These events can also be detected more specifically using 'BeforeEventListener.type', in the same way as you can use 'BeforeEvent.type' instead of 'BeforeEvent'. For example, to prevent a script from monitoring mouse movements:

    CODE
    if( location.hostname.indexOf('example.com') != -1 ) {
      window.opera.addEventListener(
        'BeforeEventListener.mousemove',
        function (e) {
          e.preventDefault();
        },
        false
      );
    }


    You can also more carefully target the functionality that needs to be removed. In this example, the User JavaScript checks if the event handler is the 'myMouseTrail' function provided by the page. It then alters the event object to pretend that the mouse position is at the top of the page:

    CODE
    if( location.hostname.indexOf('example.com') != -1 ) {
      window.opera.addEventListener(
      'BeforeEventListener.mousemove',
        function (e) {
          if( e.listener == moveMouseTrail ) {
            e.event.clientY = 0;
            e.event.pageY = 0;
          }
        },
        false
      );
    }


    The 'AfterEvent' event allows a User JavaScript to check if a script on the page has cancelled an action. When an action has been prevented, the User JavaScript can override the cancellation, and allow the action to be performed.

    For example, when you submit a form, the default action is for the form to be submitted, and a new page retrieved from the server. If a script on the page intercepts the submit event, it can validate the form, and only allow the form to be submitted if it has successfully validated. If a validation script is incorrectly saying the form has not been filled out correctly, and as a result is not allowing the form to be submitted, a User JavaScript can detect when that happens and prevent the script from being able to stop the form submission:

    CODE
    if( location.hostname.indexOf('example.com') != -1 ) {
      window.opera.addEventListener(
        'AfterEvent.submit',
        function (e) {
          if( e.eventCancelled ) {
            //the script has tried to stop the form submission
            if( confirm( 'Submission was prevented. Submit anyway?' ) ) {
              //prevent the script from preventing the form submission
              e.preventDefault();
            }
          }
        },
        false
      );
    }



    JavaScript URLs

    Pages can also use JavaScript URLs as a way of initiating scripts, such as having the JavaScript contained within the HREF attribute of a link, or the TARGET attribute of a form. User JavaScripts can detect when this is being activated, and prevent it, or rewrite the script that is about to run. Note that this also affects bookmarklets using the java script: protocol.

    For example, if a page uses a JavaScript URL to open a new window, a User JavaScript can use the 'BeforeJavascriptURL' event to rewrite it so that it displays a confirmation dialog before opening the window.

    CODE
    if( location.hostname.indexOf('example.com') != -1 ) {
      window.opera.addEventListener(
        'BeforeJavascriptURL',
        function (e) {
          if( e.source.indexOf('window.open') != -1 ) {
            //rewrite the script to confirm before opening windows
            e.source = e.source.replace(
              /window\.open/g,
              'if( confirm(\'Allow window to open?\') ) window.open'
            );
          }
        },
        false
      );
    }


    JavaScript URLs may also return a value. A page may intentionally use this value to overwrite itself with new content, but may occasionally return a value by mistake and incorrectly overwrite page content. A User JavaScript can intercept this returned value using the 'AfterJavascriptURL' event and display a confirmation dialog before writing the new content. It can also rewrite the new content if needed.

    CODE
    if( location.hostname.indexOf('example.com') != -1 ) {
      window.opera.addEventListener(
        'AfterJavascriptURL',
        function (e) {
          if( typeof( e.returnValue ) == 'string' ) {
            if( confirm('Overwrite page?') ) {
              e.returnValue += 'Changed by User JavaScript';
            } else {
              e.preventDefault();
            }
          }
        },
        false
      );
    }



    Normal scripts and events

    User JavaScripts do not have to rely on these special events, and can also accept normal scripting. For example, to display a notice on every page saying what rendering mode Opera is using (QuirksMode or CSS1Compat), you could use the following:

    CODE
    document.addEventListener(
      'load',
      function (e) {
        if( !document.body ) { return; }
        var mydiv = document.createElement('div');
        mydiv.style.position = 'fixed';
        mydiv.style.top = '0px';
        mydiv.style.right = '0px';
        mydiv.style.border = '1px solid #000';
        mydiv.style.backgroundColor = '#fff';
        mydiv.style.color = '#000';
        mydiv.appendChild(document.createTextNode(document.compatMode))
        document.body.appendChild(mydiv);
      },
      false
    );


    Greasemonkey scripts

    Opera is capable of running many Greasemonkey scripts. These are JavaScripts designed to work with the Greasemonkey enhancement for the Mozilla browser family. To tell Opera that a script file uses Greasemonkey notation, the name of the file containing the script must end with .user.js (all other .js files are assumed to be normal User JavaScripts). Scripts that use Greasemonkey notation are handled slightly differently (in order to be compatible with existing scripts):

    • They are not permitted to use window.opera.addEventListener and associated methods, or magic functions and variables.
    • They are executed when the page completes loading, after creating the DOM for the page, but before running any onload handlers that have been defined.


    Because of this different handling, Greasemonkey scripts are often not able to fix problems or errors until after they have already occurred. As a result, such scripts are generally best suited to adding enhancements, and not fixing problematic scripts.

    Although it is possible to use a normal page address detect, Greasemonkey scripts will typically use the ==UserScript== comment block to restrict the page addresses where the script will be executed. In general, the JavaScript code for each enhancement is contained within its own file, although this is not a necessity.

    Since the script will be executed immediately prior to running any onload event handlers, it can be written inline, but to avoid creating global variables, it is best to use an anonymous function that is immediately activated. For example, to prevent a page from using target="_blank" to open links in new pages, you could use the following:

    CODE
    (function () {
      for( var i = 0; document.links[i]; i++ ) {
        if( document.links[i].target == '_blank' ) {
          document.links[i].target = '_self';
        }
      }
    })();


    Using Greasemonkey notation is equivalent to creating a 'BeforeEvent.load' event listener in a normal User JavaScript.

    Tip: many Greasemonkey scripts use window._content to reference the window object. This is unnecessary in Opera, but to save editing every file that uses it, you can simply add this to a normal User JavaScript file:

    CODE
    window._content = window;


    Controlling navigation mode

    User JavaScript can override history navigation mode in Opera, to set it to be always fast, or always compatible. For more details of these modes. These modes can be set using the setOverrideHistoryNavigationMode method.

    CODE
    opera.setOverrideHistoryNavigationMode('fast')


  • Login Form With Error Messages And Preserving User Input - 14-06-2008
    CODE
    <?php
    function validate_user ($username, $password){
        return true;
    }
      
    // create empty array to store error messages
    $errors = array();
    $p =& $_POST;
      
    if (count ($p) > 0){
         if (!isset ($p['username']) || (trim ($p['username']) == '')){
              $errors[] = 'You must enter a username.';
         }elseif{ ((strlen ($p['username']) < 8) || (ereg ('[^a-zA-Z0-9]', $p['username']))){
              $errors[] = 'You did not enter a valid username. Usernames must be
                          at least eight characters long and can only contain
                          letters and digits.';
         }
        
         if (!isset ($p['password']) || (trim ($p['password']) == '')){
              $errors[] = 'You must enter a password.';
         }elseif ((strlen ($p['password']) < 8) || (ereg ('[^[:alnum:][:punct:][:space:]]', $p['password']))){
              $errors[] = 'You did not enter a valid password. Passwords must be
                          at least eight characters long and can only contain
                          letters, digits, punctuation and spaces.';
         }
        
         if (count ($errors) == 0) {
              $r = validate_user ($p['username'], $p['password']);
      
              if ($r == false){
                   $errors[] = 'Login failed. Username/password not found.';
              } else {
                   print ('<html><head><title>Congratulations</title></head>
                          <body><h1>Congratulations!</h1><p>You logged in!</p>
                          </body></html>');
                   exit;
              }
         }
    }
    ?>
    <html>
    <head><title>Login Form</title></head>
    <body>
    <h1>Login Form</h1>
    <?php
         if (count ($errors) > 0) {
              $n = count ($errors);
              for ($i = 0; $i < $n; $i++){
                   print '<br /><font color="red">' . $errors[$i] . '</font>';
              }    
         }
    ?>
    <form action="<?php print ($PHP_SELF); ?>" method="POST">
         <table>
         <tr><td>Username:</td>
         <td><input type="text" name="username" value="<?php if (isset ($p['username'])) print $p['username']; ?>" /></td>
         </tr>
         <tr><td>Password:</td>
         <td><input type="text" name="password" value="<?php if (isset ($p['password'])) print $p['password']; ?>" /></td>
         </tr>
         <tr><td colspan="2"><input type="submit" name="submit"></td></tr>
         </table>
         <input type="hidden" name="__process_form__" value="1" />
    </form>
    </body>
    </html>


    Hard coded login Form:
    CODE
    <HTML>
    <BODY>
    <FORM METHOD="POST" ACTION="LoginFormAction.php">
    <H2>Login Page</H2>
    <BR><BR>
    User Name:
    <BR><INPUT TYPE="TEXT" NAME="username" SIZE="16">
    <BR><BR>
    Password:
    <BR><INPUT TYPE="PASSWORD" NAME="password" SIZE="16">
    <BR><BR> <BR><BR>
    <INPUT TYPE="SUBMIT" VALUE="Submit">
    </FORM>
    </BODY>
    </HTML>

    <!-- LoginFormAction.php
    <?php
    $passwords = array("name1"   =>"pass1",
                       "name2"   =>"pass2");
                      
    if ($password == $passwords[$username]){
        setcookie("username", $username, time()+1200);
        echo "<H2>Access granted.</H2>";
    }else{
        setcookie("username", "", time()-3600);
        echo "<H2>Invalid user name or password: access denied.</H2>";
    }
    ?>
    -->

Powered by Freeglobes ® 2008 - 10 queries - 0.420 sec - Contact
Friends: Adauga Site Web Directory