Jump to content

atrum

Members
  • Posts

    184
  • Joined

  • Last visited

Everything posted by atrum

  1. I don't remember exactly but if something has a fixed position, that means it never moves, and it doesn't position it self relative to the rest of the content. try setting position:relative; bottom:0px; on the footer
  2. Oh, sorry I forgot to answer your question. I get so passionate about regex haha. Check this guide out. The answer you seek is near the bottom, it should at the very least give you a good idea. http://www.skdevelopment.com/php-regular-expressions.php
  3. While those filters php provides are useful at times, I highly recommend you read up on regular expressions. Being able to customize your filter makes a world of difference. preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $_prodLink) Near as I can tell you need to have your delimiters set as forward slashes ( / ) not pipes ( | ) Change to this preg_match('/^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$/i', $_prodLink) Here is a good site to get started. http://www.skdevelopment.com/php-regular-expressions.php Here is a few that I use all the time. function valPassword($input, $description, $strength = 1){ switch($strength){ case 1: //Low: 6 - 20 Characters Case insensitive. $pattern = "/^(?=.*[a-zA-Z0-9]).{6,20}$/"; break; case 2: //Medium: 6 - 20 Characters: Case Insensitive : 1 Number Required. $pattern = "/^(?=.*\d)(?=.*[a-zA-Z]).{6,20}$/"; break; case 3: //High: 8 - 20 Characters: Case Sensitive, 1 upper case, 1 lower case, 1 number Required $pattern = "/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,20}$/"; break; case 4: //Max: Same as High, but requires 1 Special Character $pattern = "/^(?=.*\!\@\#\$\-\_)(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,20}$/"; break; } $result = preg_match($pattern,$input); if($result){ return true; }else{ $this->errors[] = $description; return false; } } function valEmail($input, $description){ //Validates correct email syntax. $result = preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i",$input); if($result){ return true; }else{ $this->errors[] = $description; return false; } }
  4. I always make my forms using divs and css. Here is one I did a little while back that is all divs and css. http://icca.exiled-alliance.com Check the source out for that to give your self some pointers. Let me know if you have any questions.
  5. So I have been trying to resolve a performance issue I have been experiencing with mysql and writing to a large table. So in this scenario, I have a table that is 5G in size (huge I know) and I am running 1 - 2 queries every 10 seconds, which I believe is causing the issue. My question pertains to how mysql is handling the query. Does mysql have to read the entire contents of the table into memory before it appends the new data to it? Or does it insert it with out reading the table into memory? I should also mention that I am using the DELAYED option in my insert queries.
  6. Well just from looking at the code in that other post, it looks like you might need to put some of that into functions. and then just call the functions if the data was found. This would prevent the table headers from being echoed until you wanted them too.
  7. Add this above the line starting with "if ($row != NULL)" print_r($row); That should print the array of data you pulled down for tutor_id. Show me what that gives you. EDIT: Doh!, I missed <option> error that pikachu2000 pointed out .
  8. Normally when a user logs in and you want to display their name somewhere, you want to use the data pulled from the database rather than a form post. while($r = mysql_fetch_assoc($result){ $_SESSION['myusername'] = $r['Use_Name']; } Add that in below where your registering your session myusername. Then on your html page echo $_SESSION['myusername'];
  9. <?php $user=$_POST['user']; $pass=$_POST['pass']; if(($user=="testing") && ($pass=="testing123")){ echo "Access Granted"; header("Location: http://domain.com/another_webpage/"); }else{ if other echo "Access Denied!" } ?> Something like that should get ya started.
  10. 1. When they have logged in grab their name from the db table and assign it to a session id of name. 2. place on your page in the area you wish to display their name and echo that session ID. If you need something more detailed or spell out then that, then please provide your database table structure and I can make an example for ya.
  11. You can search for the keyword password. However that is still pretty vague. What are you trying to do with passwords. Hash them? Store them? Retrieve and compare them for authentication?
  12. Well do you have a copy of your database on your server? EDIT: nevermind just saw your *. Any way what I would do is first turn errors on. Second see what your query is actually giving you. $numrows = mysql_num_rows($result); echo $numrows;
  13. Never mind, looks like JQuery was the cause. Oh well, no functions name register for me then.
  14. So I just happen to name a function as "register()" and when I go to run that function on an event I get back in firebug. "register is not a function". If I change that functions name by 1 character it works fine. Below is an example of what I tried. At first I thought that maybe register was a reserved keyword, but I am not able to find any documentation that supports that thought. Can anyone confirm or deny this? function tregister(){ alert("Works."); } function register(){ alert("Does not work."); }
  15. Giving this another bump. I have figured out a way around the problem, but I am still eager to figure out why exactly the above script fails because I do not understand and would like to.
  16. Ok, I have never tried with out
  17. I don't think print_r will print anything to the screen unless you echo it. so add this instead (with some formatting so its easier on the eyes) echo "<pre>"; echo print_r($_POST); echo "</pre>";
  18. Can you confirm that php is installed on the server/computer you're trying to run it on?
  19. What actually happens when you run that? Do you get any errors? Blank Screen?
  20. Please show us the code you tried to use.
  21. Just giving this a quick bump. I am trying not to be impatient, this problem is just really making me scratch my head.
  22. Ok, so I have a simple validation script that goes through and checks that the fields meet the forms requirements, and everything works. Sorta. Once the process gets to the email validation it seems to work and the error is displayed, but if you click the button a second time the error goes away, click again and its back. (you have to fill everything in up to the email point. I have not made this very fluid or friendly yet.) What is causing this toggle effect. Here is the page for people wanting to test it out. http://dev.team-symbiosis.net/?p=login Here is the JavaScript (there is some jquery thrown in probably not needed) //Register $('.error').hide(); //Hide the errors until needed. //Begin Validate Email. function valEmail(email){ var pattern = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/g if(pattern.test(email)){ return true; }else{ return false; } } //end: Validate Email. function valReg(){ var usr = $('#txt_username').val(); var pas = $('#txt_password').val(); var cpas = $('#txt_cpassword').val(); var eml = $('#txt_email').val(); var ceml = $('#txt_cemail').val(); if(usr == "" || usr == null){ $('#username_error').show(); return false; }else{ $('#username_error').hide(); } if(pas == "" || pas.length < 5 || pas == null){ $('#password_error').show(); return false; }else{ $('#password_error').hide(); } if(cpas !== pas){ $('#cpassword_error').show(); return false; }else{ $('#cpassword_error').hide(); } if(valEmail(eml) !== true){ $('#email_error').show(); return false; }else{ $('#email_error').hide(); } if(eml !== ceml){ $('#cemail_error').show(); return false; }else{ $('#cemail_error').hide(); } } $('#btn_register').click(function() { valReg(); }); //end: Register Here is the markup. <form id="register" name="register" method="post"> <dl> <dt><label for="txt_username">Username:</label></dt> <dd><input type="text" name="txt_username" id="txt_username" /></dd> <label class="error" for="txt_username" id="username_error">This field is required.</label> </dl> <dl> <dt><label for="txt_password">Password:</label></dt> <dd><input type="password" name="txt_password" id="txt_password" /></dd> <label class="error" for="txt_password" id="password_error">The password is too short.</label> </dl> <dl> <dt><label for="txt_cpassword">Confirm Password:</label></dt> <dd><input type="password" name="txt_cpassword" id="txt_cpassword" /></dd> <label class="error" for="txt_cpassword" id="cpassword_error">The passwords do not match.</label> </dl> <dl> <dt><label for="txt_email">Email:</label></dt> <dd><input type="text" name="txt_email" id="txt_email" /></dd> <label class="error" for="txt_email" id="email_error">Invalid email address.</label> </dl> <dl> <dt><label for="txt_cemail">Confirm Email:</label></dt> <dd><input type="text" name="txt_cemail" id="txt_cemail" /></dd> <label class="error" for="txt_cemail" id="cemail_error">The emails do not match.</label> </dl> <dl><input type="button" id="btn_register" value="Complete" /></dl> </form><!--end: login-->
  23. Don't complain to loudly about not being helped with-in a spawn of only 5 hours. But any way, I think the reason nobody replied was the fact that your question wasn't clear enough. It sounded as though you were wanting help printing out the entire contents of the array, but from your last post you instead needed the contents of 1 element in the array.
×
×
  • 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.