Jump to content

hmvrulz

Members
  • Posts

    46
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

hmvrulz's Achievements

Member

Member (2/5)

0

Reputation

  1. When i try to validate CSS on http://harshamv.com http://jigsaw.w3.org/css-validator/validator?profile=css21&warning=0&uri=http%3A%2F%2Fharshamv.com%2F am getting errors 58 #rightnav Property opacity doesn't exist in CSS level 2.1 but exists in [css3] : 0.25 59 #rightnav Property -moz-opacity doesn't exist : 0.25 60 #rightnav Parse Error opacity=25)
  2. When i add sifr to my site i am experiencing the following problems 1. Some elements disapear. ( the date componet ) 2. theres a space at the start of each para. 3. text justify is not being applied. u can see both the pages here http://harshamv.com/test.php the original page with out siFr http://harshamv.com/index.php Is there any way to add fonts to the web design better than this ?
  3. hmvrulz

    CSS opacity

    I am trying to make the background transperency.. but the text on it should be bright and visible.. but i am not able to make the text brighter opacity:0.25; -moz-opacity:0.25; filter:alpha(opacity=25); u can look at the menu bar here http://www.harshamv.com/test/
  4. http://www.harshamv.com/test/ see that.. when we scroll only the middle part should scroll.. can u help me do that... i tried overflow ..its not working
  5. hello guys,, I was wondering how to make a webpage take the full browser size and not over flow or be smaller than the browser window also atleast 800 x 600 thnx for ur time.. HMV
  6. my Class class reg_validate extends validate { public $errors = array(); function __construct($input) { $this->errors['username'] = $this->username($input['username']); $this->errors['password'] = $this->password($input['password1'], $input['password2']); $this->errors['email'] = $this->email($input['email']); print_r($this->errors); return $this->errors; } function reg_error($input) { print_r($input); switch ($input['username']) { case '-1': echo 'error -1'; break; case '-2': echo 'error -2'; break; case '-3': echo 'error -3'; break; } } } INITIALIZING $reg_validate = new reg_validate($_POST); $reg_validate->reg_error($reg_validate); Object reg_validate Object ( [errors] => Array ( [username] => -3 [password] => -2 [email] => 1 ) [minUser] => 3 [minPass] => 6 ) ERROR am GETTING Fatal error: Cannot use object of type reg_validate as array in C:\Program Files\wamp\www\fw\models\users.php on line 31 HOW can i use the $input[username] in the switch to check for errors
  7. how can u inlcude files in ur header with not proper tags around it... ??
  8. Is there any way to SHOW A MESSAGE by ECHO and then use HEADER function to redirect the user to a diff page
  9. Thanks GUYS.... Any other way to write my html form ?
  10. Values in the text filed <br /> <b>Notice</b>: Undefined index: fname in <b>C:\Program Files\wamp\www\fw\views\users\registration.html</b> on line <b>4</b><br /> heres the form registration.html <form action="./register/" method="post" name="registration"> <div>First Name:</div> <div> <input type="text" name="fname" size="25" maxlength="25" value="<?php echo $_POST['fname']; ?>" /> </div> <div>Last Name:</div> <div> <input type="text" name="lname" size="25" maxlength="25" value="<?php echo $_POST['lname']; ?>" /> </div> <div>Username:</div> <div> <input type="text" name="username" size="25" maxlength="25" value="<?php echo $_POST['username']; ?>" /> </div> <div>Password:</div> <div> <input type="password" name="password1" size="25" maxlength="50" value="<?php echo $_POST['password1']; ?>" /> </div> <div>Retype Password:</div> <div> <input type="password" name="password2" size="25" maxlength="50" value="<?php echo $_POST['password2']; ?>" /> </div> <div>Email:</div> <div> <input type="text" name="email" size="25" maxlength="50" value="<?php echo $_POST['email']; ?>" /> </div><br/> <div><input name="submit" type="submit" value="Register"><input name="reset" type="reset" value="Reset"></div> </form> When ppl go to http://localhost/fw/users/new/ then the registration.html form is included. and as values am getting the above content. When ppl go to http://localhost/fw/users/register/ the same page is loaded if there are errors in the fill up or the user is present already with username or same email.
  11. do u mean max length using html CSS ?
  12. class validate { // Function to Sanatize the User Input function sanitize($input) { // Checks if the Input is an Array if (is_array($input)) { // Each layer of an array is Sanatized independently foreach ($input as $var => $val) { $output[$var] = $this->sanitize($val); } } else { // Checks for Magic Qoutes if (get_magic_quotes_gpc()) { // Strips Slashes of the input $input = stripslashes($input); } // Cleaning TAGS by calling the function $input = $this->clean_tags($input); // Adds Slashes for inserting into DATABASE $output = mysql_real_escape_string($input); } // Return the OUTPUT return $output; } // Strips HTML, JS, Style and Comments from the user Input function clean_tags($input) { // Set the Patterns $search = array('@<script[^>]*?>.*?</script>@si', // Strip out javascript '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly '@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments ); // Strip the above patters $output = preg_replace($search, '', $input); // Return the OUTPUT return $output; } // Function to Desanatize the User Input function desanitize($input) { if (is_array($input)) { // Each layer of an array is Sanatized independently foreach ($input as $var => $val) { $output[$var] = $this->desanitize($val); } } else { // Checks for Magic Qoutes if (get_magic_quotes_gpc()) { // Strips Slashes of the input $output = stripslashes($input); } } // Returns an array Desanatized return $output; } // Function to Validate Email - International Format function email($email) { // Matches Email Id to Internation format if (preg_match('/^[_A-z0-9-]+((\.|\+)[_A-z0-9-]+)*@[A-z0-9-]+(\.[A-z0-9-]+)*(\.[A-z]{2,4})$/', $email)) { return true; } else { return false; } } // Method to Validate DATE - input MONTH,DAY,YEAR function ymd($month, $day, $year) { // Checks the date including Leap Year if (checkdate($month, $day, $year)) { return true; } else { return false; } } // Method to Check for Simple BLOG text function text($text) { $result = ereg("^[A-Za-z0-9\ ]+$", $text); if ($result) { return true; } else { return false; } } // Method to Check SINGLE WORD with A-Za-z0-9 with NO SPACES function alpha_num($text) { $result = ereg("^[A-Za-z0-9]+$", $text); if ($result) { return true; } else { return false; } } // Method to Check SINGLE WORD with only Characters with NO SPACES function alpha($text) { $result = ereg("^[A-Za-z]+$", $text); if ($result) { return true; } else { return false; } } // Method to Validate numbers only function num($input) { if (is_numeric($input)) { return true; } else { return false; } } // Validates 10 DIGIT mobile CODE function mobile($input) { if (is_numeric($input) && (strlen($input) == 10)) { return true; } else { return false; } } // MIN LENGTH of a string function minlength($input, $min) { if ((strlen($input) >= $min)) { return true; } else { return false; } } //Check Username function username($input) { // Checks if the Username is entered if (isset($input)) { // Checks if the Username contains alpha_num with out a scape or special Char if ($this->alpha_num($input)) { // Checks if the Username is on Min 3 Char if ($this->minlength($input, 3)) { // Accepts the Input return true; } else { // Throws an Error echo 'Min Length of Username is 3 Characters'; return false; } } else { // Throws an Error echo 'No Spaces or Special Characters Allowed!!!'; return false; } } else { // Throws an Error echo 'Please enter a Username'; return false; } } //Check Password function password($password1, $password2) { // Check if both Password fields are typed if ((isset($password1) and isset($password2))) { // Check if both the password fields match if ($password1 == $password2) { // Check for min Length if ($this->minlength($password1, 6) == true) { // Check for Special chars and spaces if ($this->alpha_num($password1) == true) { // Accept Password $password = $password1; return true; } else { // Throws an Error echo 'Password can contain A-Za-z0-9'; return false; } } else { // Throws an Error echo 'Min Length 6 Char.'; return false; } } else { // Throws an Error echo 'Passwords dont match'; return false; } } else { // Throws an Error echo 'You forgot to enter your password.'; return false; } } } I have Created a VALIDATION CLASS... can plz tell if its the right way of doing it in OOPs. and have i left out any other USEFULL validation process
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.