Jump to content

Zaper Gallis

Members
  • Content Count

    59
  • Joined

  • Last visited

Community Reputation

3 Neutral

About Zaper Gallis

  • Rank
    Newbie
  1. You need send the value the button to the submit page and have php add it up there. If you want the user to keep clicking it all on one page then you can use JavaScript to record and count them until there ready to be submitted. If you need it to update the database without laving the page then AJAX is your answer. Note: Sorry, me and Ingolme posted at the same time...
  2. K, I understand that. Lets say I'm making a sign up and log in system. Would the following code remove all special characters from the username? Then safely allow them, but not allow scripting tags in the password? Or is there a better way to do so? $username= filter_var($_POST['username'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW, FILTER_FLAG_STRIP_HIGH);$password= rtrim(mysql_real_escape_string(strip_tags($value))); Then for sanitizing input for most all other uses I've created the following function, were I pass an array in for $input: foreach ($input as &$value){$value = rtrim(mysql_real_escape_stringhtmlentities($value)));} Would a filter be a smart way to do this? And one more thing. Is it safe to compare the orignal input value to another value, such as if ($_POST['username'] != filter_var($_POST['username'], FILTER_SANITIZE_STRING)){Error} Or does this leave an opening to inject code into the script? If so how would I check if the input is the same after filtering it? Thanks for your time and help.
  3. K, I can't find any clear explanation or tutorial on the filter functions and I'm confused. When I first started writing my scripts the tutorials I found used reg expressions to remove special characters and validate emails. However from my understanding the PHP filter functions are a better way to go. So which should I use? And what exactly does the filters and flags remove? I can find lots of site saying "FILTER_FLAG_STRIP_LOW - Strip characters with ASCII value below 32" but I have no idea what characters that actually removes. Does it remove all the special charters? Or should I use FILTER_FLAG_STRIP_HIGH, or do I need them both? maybe nether of them are needed to safely sanitation a script? Does some one know of an easy to follow list on exactly what these flogs remove so I know? Can some one please better explain this to me? Thanks.
  4. Think I found the issue. Just bad coding from when I was just learning how to script. Thanks.
  5. I thought div's have a space between them, maybe I'm thinking something else. Sorry. absolute can work if your careful and know who to use it though.
  6. Zaper Gallis

    Footer Issues

    Ok, I found a way to force the footer to the bottom of a page if the content is to short. I used the information found on this page: http://ryanfait.com/resources/footer-stick-to-bottom-of-page/ The issue is when the page is shorter than the content, such as if you were to re-size the window, the footer ends up in the middle of the content. Does any one know how i can adjust the code to keep it at the bottom of the content at all times?
  7. Not sure what you mean, but if it's how you sound just place each section in a <div> tag then use CSS position: absolute to move it where you need it. like so: #header{Position: absolute;top: 0px;height: 150px}#menu{Position: absolute;top: 150px;height: 50px}#content{Position: absolute;top: 200px;}<div id="header"> header </header><div id="menu"> menu </div><div id="content"> content </div> Notice the "top" value is = to the height of all previous elements. This sets them all right below each other.
  8. Really it doesn't take much to install the browsers. The only ones you need to worry about is IE, FF, Chrome, Oprah, and Safari, unless your scripting for a specialized target group. If it works in all of those than it should work in all browsers that matter without going threw to much pointless work. It's necessary to be able to test it in the main browsers though, so I say to just install them, eve3n if you never use them for anything else.
  9. Didn't know you could do that in an image link, or even think about the request page for that matter. That did the trick, thanks for the help guys.
  10. Now I'm even more confused. First off i realized the Ajax was unnecessary, So I switched to DHTML to do the same job. Now when i try to use the script 1 of 2 things happen: If I don't load fire bug with the script it does the same thing as before, doesn't refresh the image. If I do load fire bug then it ether does the same thing as before, or, most often, it works, but the resulting image from fire bug is different than on the webpage, and the firebug code works but not the site code. I don't have the first clue wtf is going on now. It's like firebug sends it's own request to the captcha page and resets it for the main page, but if fire bug doesn't do that then the main page catches the data.
  11. A solution, if you know what feature your trying to use, is the PHP browscap file, which is an add on to the PHP program. It lists what each browsers do and do not support. With it you can have your script check if the feature is supported then give an alternative if it's not. Note that some hosts don't support it, such as hostgator (unless you pay for there higher end hosting). Was this what your wanting? The only alternative if your just wanting to know if all browsers support it or not is to Google it with something like "does broserX support ..." I actually have all 5 main browsers installed o my computer. If you do a lot of scripting i recommend installing them just to make sure the page looks the same on all browsers. And I agree with ingolme. Not much point in supporting way old browsers, such as IE6. To much work and to sloppy codding. Also a sub note, just cause it works in FF doesn't mean it works in chrome, Oprah, and so on 9/10 it will, but there are still small variations to how each one processes the code.
  12. Ok, just installed Firebug. I hear a lot about it but have never used it before. Let me try to figure it out then maybe i can give more information about the issue. Thanks.
  13. Yes, I've tried adding random variables to the URL but it still didn't solve the issue. I don't even think catching is the problem. Are there any other types of issues that would look and act like caching?
  14. I've already tried that one, thanks though. It was my understanding that POST doesn't catch in AJAX, though I may have miss understood that. It acts like it's catching, but only in 2 out of 5 browsers. Any other ideas? Notes: I've entered in all the no catch headers i could find on the PHP page that the request is sent to, and tried all the common stuff you can find on Google.
  15. This is a strange one to me. I wrote a captcha script for my site which works fine. On the sign up page I put it on I have a JavaScript function that uses ajax to refresh the captcha without reloading the page. That works in all my browsers but Firefox and Opera. In these browsers you can click it once and it works, after that it doesn't refresh the image. When add an alert at the end of the function it shows that the function is firing, so it's acting like the page is caching, even though I'm sending it with POST. Does any one know why these two browsers are doing that and how to stop it? The code is: function loadXMLDoc(div){if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safarixmlhttp=new XMLHttpRequest();}else{// code for IE6, IE5xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}xmlhttp.onreadystatechange=function(){if (xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById(div).innerHTML=xmlhttp.responseText;}}}function refreshcaptcha (){loadXMLDoc("captcha") xmlhttp.open("POST","refreshcaptcha.php",true);xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');xmlhttp.send();}
×
×
  • Create New...