Eek! I've been building a site in my spare time for a number of months now. I SO want to finish it! (yaknow the feeling?!)
Well I've just hit a problem that I'm not sure what to do about, and it's all around user input I guess.
Basically I have an input validation system. I have a bunch of filters (preg patterns at heart) that I pass input through, depending on what it is. I have types for alphanumeric, filenames, url, email, text etc. They work fine as far as I've tested. However ... the problem I've come across is just cos a char is allowed in it's field type, doens't mean it's allowed in a url!
Basically, I found that if I this blows up IE in a link :
!#%&()+,.;=@~ -
but this doesn't.
+=@~-
so ... which of the deleted ones causes it? It appears the following aren't allowed in a url
(), .;
and ! crashes it and % crashes it if not followed by a number, eg %20
So I thought ... if they're allowed in things (eg text) but not in a url, I can't ever use a variable in a link if it contains any of those!
URLENCODE() then URLDECODE() I hear you cry! But I always thought that if I did that I would end up decoding something that was never encoded with urlencode(), or something like that, like stripping slashes that weren't added with addslashes().
So I thought ... I should have a variable in a session, that holds an array of the variablenames and variablename values of any variables I want to send in a link. Then I just read them back into variable named variables on the enxt page and have them as they were - simple! But what a lot of hastle it will be for me to do that now, before every link adding the arguments into the array then reading them off on later pages =(
Can anyone help? I'm fed up of doing this website on my own with no help. It's hard enough that I don't have MySQL and I'm having to use flatfiles for this whole thing! It means I don't use ID numbers or anyhting anywhere and all content must be referenced with a bunch of variables (the folder it's in, it's title, it's foramts, it's author etc)
Argh! 🙁