-
Posts
969 -
Joined
-
Last visited
Everything posted by Destramic
-
hey guys i have a an array and i want to know if i can call the value without having to put the array key in capitals. here is my array Array ( [DEVELOPEMENT_ENVIORMENT] => 1 [MSQL_HOST] => localhost [MYSQL_USERNAME] => root [MYSQL_PASSWORD] => test [MYSQL_DABASE_NAME] => test ) can i call the array like $array['mysql_host']Array ( [DEVELOPEMENT_ENVIORMENT] => 1 [MSQL_HOST] => localhost [MYSQL_USERNAME] => root [MYSQL_PASSWORD] => n0real1ty [MYSQL_DABASE_NAME] => test ) can i call the array like $array['mysql_host'] instead of $array['MYSQL_HOST'] whichout renaming the array key if anyone could help please...thank you
-
hey guys im having a problem with my class it sees the constructor isnt loading and this line isnt executed spl_autoload_register(array($this, 'load_class')); i dont see why not if anyone can help please <?php class Autoloader { private static $_declared_classes = array(); private static $_ignore_files = array(); public function __construct() { spl_autoload_register(array($this, 'load_class')); } public static function load_class($class_name) { $class_name = ucwords($class_name); $file = self::get_class_path($class_name); try { if (!class_exists($class_name, FALSE)) { if (file_exists($file)) { require_once $file; self::$_declared_classes[] = $class_name; } else { throw new Exception(sprintf("Class '%s' not found.<br />\n", $class_name)); } } } catch (Exception $e) { echo $e->getMessage(); } } private static function get_class_path($class_name) { global $classes; if (array_key_exists($class_name, $classes)) { return ROOT . DS . $classes[$class_name]; } } public static function declared_classes() { echo "<pre>"; print_r(self::$_declared_classes); echo "</pre>"; } ?>
-
that worked nicely...thanks alot
-
ok but the file name could be the size of font_controller.class.php...that would work fine?
-
hey guys im not that good when it comes to regex...im after the syntax were a string(filename) will have .class.php inside please if anyone can help. examples: test.class.php, help.class.php ...etc thank
-
exactly what i wanted...thanks alot
-
ok this is what i have at the moment. <?php if ($handle = opendir('../')) { while (false !== ($file = readdir($handle))) { echo $file . "<br />"; } closedir($handle); } ?> now in this loop it shows folders...but what i want to do is if the $file is a folder then open that up and read directory
-
hey guys im tyring to read my directory (whole of the web server)...i want to be able to put the file name and root into an array...im just wanting to know whats the best function i need to do this please?...thank you
-
Can anyone help please?
-
hey guys im wanting to make a user availability script....but i just need your help on the best way on how to make this script please. bascially the users will be store in my mysql table but would it be best to select all users pass through json_encode($users_array) then check if user exsists through jquery json function?...if someone could tell me the best way to do this...or if you have an example that would be great thanks
-
checking if string contains upper and lower case characters
Destramic replied to Destramic's topic in Javascript Help
thanks for your help now ive learnt something too...plus my password strength function is complete now...thanks again -
checking if string contains upper and lower case characters
Destramic replied to Destramic's topic in Javascript Help
thank you...although i could get it to work this way String.prototype.string_has_numbers = function(string) { var regex = /\d/g; return regex.test(string); } var password_value = "test1"; password_value.string_has_numbers() -
checking if string contains upper and lower case characters
Destramic replied to Destramic's topic in Javascript Help
well i'd like another function which just checks if the string has uppper and lower case please -
Well i'll make a post tomorrow on your blog and maybe you could answer in fully there...maybe a example how rows can be implemented in a style other than a table (if possible)...would make a very useful and interesting article i'm sure
-
thanks alot that worked a treat...also i read your atricle which is very inteteresting especially for someone like me as i dont know that much about css....but one last question whats the best way to view mysql database rows?...tables or is there a good method with div?...thanks again
-
well it certianly didnt come accross that way...maybe we have misunderstood each other here. anyways i cant see how any other code would interupt my div from working but here is the page...excuse the mess im just trying to get script working before added into my framework <!DOCTYPE html> <html> <head> <script type="text/javascript" src="js/library/jquery.js"></script> <style type="text/css"> div { display : inline; } .invalid_text { color : #FF0000; font-size : 10px; font-family : Verdana, Arial, Helvetica, sans-serif; } .valid_text { color : #228b22; font-size : 10px; font-family : Verdana, Arial, Helvetica, sans-serif; } .password_minimum_characters { font-size : 9px; font-family : Verdana, Arial, Helvetica, sans-serif; } .password_too_short_text { color : #FF0000; font-size : 10px; font-family : Verdana, Arial, Helvetica, sans-serif; } </style> </head> <body> <script> $(document).ready(function() { function match_validation(selector, selector2, field_label) { selector = $('#' + selector); selector2 = $('#' + selector2); $(selector).change(function() { var field_value = $(selector).val().toLowerCase(); var field2_value = $(selector2).val().toLowerCase(); if (field_value.length == 0 || field2_value.length == 0) { $('div#match_validation_message').text(''); } else if (field2_value.length !== 0) { if (field_value !== field2_value) { $('div#match_validation_message').text(field_label + " doesn't match"); $('div#match_validation_message').removeClass("valid_text").addClass("invalid_text"); } else { $('div#match_validation_message').text(field_label + " matches"); $('div#match_validation_message').removeClass("valid_text").addClass("valid_text"); } } }); $(selector2).change(function() { var field_value = $(selector).val().toLowerCase(); var field2_value = $(selector2).val().toLowerCase(); if (field_value.length == 0 || field2_value.length == 0) { $('div#match_validation_message').text(''); } else if (field_value.length !== 0) { if (field_value !== field2_value) { $('div#match_validation_message').text(field_label + " doesn't match"); $('div#match_validation_message').removeClass("valid_text").addClass("invalid_text"); } else { $('div#match_validation_message').text(field_label + " matches"); $('div#match_validation_message').removeClass("valid_text").addClass("valid_text"); } } }); $(selector).change(); } function password_strength(password, minimum_character_size) { password = $('#' + password); $(password).after('<br /><div id="password_minimum_characters" class="password_minimum_characters">Minimum number of characters is ' + minimum_character_size + '</div>'); $(password).change(function() { var password_length = password.val().length; if (password_length < minimum_character_size) { $(password).after('Too Short'); } // very weak > mimimum characters // weak 3 // medium 6 // strong numbers // very strong contains higher case }); } match_validation('email', 'confirm_email', 'E-mail Address'); password_strength('password', ; }); </script> <form method="post"> <label for="username">Username :</label> <input id="username" name="username" value="" type="text" /><br /> <label for="email">E-mail Adresss :</label> <input id="email" name="email" value="" type="text" /><div id="match_validation_message"></div><br /> <label for="confirm_email">Confirm E-mail Address :</label> <input id="confirm_email" name="confirm_email" value="" type="text" /><br /> <label for="password">Password :</label> <input id="password" name="password" value="" type="text" /><br /> <div style="background-color:#ff9900; border: 1px solid white; height: 25px; width: 200px;"></div> <input type="submit" value="Submit"> </form> </body> </html>
-
@cssfreakie i understand i need to buy a book...but ive only written on this forum for help...and if you dont want to offer any help then dont reply back to my posts...simple now ive tried this on firefox and ie and div doesnt appear...but if i put text in between the tags then it shows...but for this div i dont want any text in it...i just want the bar <div style="background-color:#ff9900; border: 1px solid white; height: 25px; width: 200px;"></div> thanks
-
the css is normally in a style sheet its just in the div for a example of the code...but the div code abve doesnt display anything...alll i want it to do is just display a small like about 5 px tall 150 px wide
-
hey guys...i want to create a bar for my password strength script...but the code below wont shw anything if anyone can help <div class="bar" id='bar' style="background-color:#ff9900; border: 1px solid white; font-size: 1px; height: 5px; width: 120px;"></div> also do you just use <span> tags for text? thanks
-
i got that working great with that code thanks alot CSSFREAKIE
-
hes is the image...you'll see the text add game type and remove game type and the images...thank a lot [attachment deleted by admin]
-
hey guys i have an image and some text inside a div but i want to be able to align the text vertically do it is in the middle of the image...if someone could help that would be great <div id="add_game_types"><img src="add2.gif" data-hover="add.gif" /> Add Game Type</div> css: div#add_game_types, #remove_game_types { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; vertical-align: text-top; cursor:pointer; } thank you
-
i found out that hide() / fadein() is the result to the added style $(input_field).appendTo('div#' + selector).hide().fadeIn(1200);