Jump to content

feck

Members
  • Posts

    116
  • Joined

  • Last visited

Everything posted by feck

  1. Does anyone know how to populate a select box from values stored in a database?
  2. feck

    footer problem

    Cheers for trying scottfor some reason this approach will work if i just hold down a key and fill up content in the paragraph. The footer will move down, but as i'm holding down the key the paragraph will scroll horizontally across the page.If I start a new line each time the content will overlap the footer.What i need is a way to move the footer when the content gets too large.Any other suggestions?
  3. feck

    footer problem

    Is there a way of keeping a footer at the bottom of the page when the page has not much content, but when there is content to stay below that content?
  4. Sorry people solved it.Well actually sorted out my own stupidity again.the $box1 variable had been named by using $$env, but there was still nothing in it. So although I was trying to test if it had worked, it never had a value in it, it had just been named. foreach($_POST as $env => $val){ if($env != "sub"){ //does'nt include the submit button $$env = $val; echo "<p>This box is named: $env<br />with value: $box1 <br /></p>"; } } As i stated in the first post the echo is just for testing.I can now create variables on the fly, without having to create a long list of variable names and associating them with values, just use a simple foreach loop. This will name the variables according to the names of the input boxes.
  5. When using long forms you have to go about creating variables for all of the input fields of a form.What I am trying to to is create some variable names from the input names/id's.Heres a simple form: <form action="test.php" method="post"> <input type="text" id="box1" name="box1" size="30" /> <input type="text" id="box2" name="box2" size="30" /> <input type="submit" id="sub" name="sub" value="Submit"/></form> And heres a simple for each loop that I'm trying to use to create the variable names, bear in mind that the echo statement is just for testing purposes, and if actually worked would only show the id/name of the first input box: foreach($_POST as $env => $val){ $$env; echo "<p>Hello this is the name of the input box: $box1 <br /></p>"; } Where am I going wrong?Here's someone who's done something similar:http://www.dreamincode.net/forums/showtopic9531.htm
  6. Here's one I read again todayJavascript Injection Although it does'nt mention anything about select boxes I'm sure the same process applies.
  7. feck

    using https

    Thanks alot people.
  8. feck

    using https

    thanks aspnetguy,so basically if a validated user would then go on to manipulate data through a form or forms then keep using https to help with validation.
  9. thanks jesh,what i'm wondering is say for instance that your putting things into a database, that are preset values like names for instance.You have only four names to choose from do you need to validate these?My question arises because of something I've read about called Javascript Injection whereby a user could actually put in a value to be submitted that is not in the actual selct box.
  10. feck

    using https

    i'm using https to log someone into a part of a website, this gets validated both client and server-side, and is again validated against a password encrypted MySQL system.After using https for the initial password and username validation, once the page becomes directed to the new part of the site, that cannot be accessed other than being a valid user, is it still necessary to use https on all page requests in this part of the site?
  11. Do you have to validate selection boxes when validating a form?, seeing as the values entered are restricted too values already placed within the options.If so, could you give me a few pointers in the right direction as to validating these types of inputs.
  12. feck

    CSS Question

    Hi phustus,I could'nt seem to find the usage of 'id' in the tutorials either, but i only attempted a small search.But here's how you would use your example: /* this is a comment -- tester.css */#green{color:green}p#para1{text-align: center;color: red} <html><body><head><link rel="stylesheet" type="text/css" href="tester.css" /></head><h1 id="green">Hello from inside h1, this header is green</h1><p id="para1">hello from inside the paragraph, which is centered and red</p></body><html> hope this helps.Also you can code fragements by using the buttons in the edit toolbar above where you type out your question. The button for code is labeled '#', press it twice and two code boxes will appear ' 'in you space for typing. Place your code between these two boxes.
  13. Cheers for the help jesh, and sorry I did'nt get back sooner with a thankyou for the help.I've sort of relented at the moment with this problem, i think i was trying too hard to make the coding shorter and fancier, but in fact became more complex.Thanks again for the help.
  14. Once the cookie expires it automatically gets deleted from your browser, i thinkcheck this out at wikipedia:http://en.wikipedia.org/wiki/HTTP_cookie
  15. feck

    Encryption problem

    Solved it: SELECT password, AES_DECRYPT(password, 'password') AS unencrypted FROM staff where password in AES_DECRYPT, (sorry, the first one that is,) is actually the colum name,if that makes any sense.
  16. feck

    Encryption problem

    Hicompletly new to sql encryption wanted to know how to use the ael encryption methodAES_ENCRYPT(str,key_str), AES_DECRYPT(crypt_str,key_str)First of all, the str value in the above AES_ENCRYPT function, is that the actual value I'm passing in.In my case for testing its 'bob' and my key_string is 'password'I have a table with only 2 colums for testing purposes, staff = table namestaffID + password = colum namesI've successfully inserted values into database INSERT INTO staff VALUES ('bob',AES_ENCRYPT('bob','password')); and when i use: select * from staff2 this shows the password colum with one encrypted value and obviously the staffId as bobNow how do I create a query to retrieve these colums with the password colum decrpyted, ive tried something like this: SELECT password, AES_DECRYPT('bob', 'password') AS unencrypted FROM staff but the result shows the password colum encryted as I suppose it should and the new unencrypted colum as blank. can anybody help, also need some good tutorials on this sort of encryption.
  17. Solved it too a point jesh, changed the reg exp to var myRegExp = /([^a-z\d\.\,\'\:])+\s/i This now correctly validates any extra whitespace than needed ie more than once: text"space""space"textThe only problem left is that for some reason the validation still occurs if there is one "space" at the start of the string even with or without any trailing text.So I can now validate for any extra whitespace but just not the first whitespace at the start of a string.
  18. Heres my if statement within a loop that scrolls through form values from a validation function: if(regExpIs_Valid(elemValues[i].value) == false){ /*checks for values other than those identified in the reqular expression function */ invalid_Entry += "<li>"+elemValues[i].id + " is reg invalid</li>"; } Again heres my regular expression function function regExpIs_Valid(text){ var myRegExp = /[^a-z\d\.\,\'\: ]/i; return !(myRegExp.test(text));}
  19. Sorry beta dont really know what this actually meansThanks guys for trying anyway I've tried your way Jesh but it still doesnt seem to workThanks all the same
  20. Basically i would like as many spaces as needed within the string, but no more than one at a time
  21. Basically i would like as many spaces as needed within the string, but no more than one at a time
  22. tried these different ways but still no luck: var myRegExp = /[^a-z\d\s{2,*}\.\,\'\:]/i;var myRegExp = /[^a-z\d\s{2}\.\,\'\:]/i;var myRegExp = /[^a-z\d\s(?!\s)\.\,\'\:]/i; Say I'm entering the names of books:The wind in the willows would be valid but the following ways would not: or even if i was validating telephone numbers would be valid but would notor even just holding down the space bar
  23. thanks again jesh, I've already been looking at the lookaheads and such, but cannot seem to get them to work within my string.Also the problem with accepting the multiple whitespace is that as I stated earlier if the user tries to inject some redundant code like holding down the space bar, this will still validate whether you reduce this to one space or not.I would have to deal with this then server side which would still issue the same problem.As I'm injecting values into a database I would not want a user authorized or not to be able to insert whitespace values.The logic behind the lookarounds is facinating, but as yet i'm having trouble grasping it.So far i can check for whitespace but not how much.
  24. cheers jesh,tried your way it did'nt seem to work in my code. I'm still trying to understand yours as I'm new to expressions, but the main problem I'm having at the moment is the fact that i allow whitespace, how do i check for too much whitespace.ie; if there are more than two spaces between words.the problem is that at the moment in my validation the user can press the space bar repeatedly and this will still validate.Any suggestions?
  25. Phew solved it. function regExpIs_Valid(text){ var myRegExp = /[^a-z\d\.\,\'\: ]/i; return !(myRegExp.test(text));} Now just have to work out away that would warn me if only these punctuation marks alone were used and no alphanumeric characters.
×
×
  • Create New...