What a dork
Posts: 15
112 credits Members referred : 0
« on: Oct 01, 2006, 03:03:13 AM »
URL a bug: it's better to do a short modif in this function. for example if you type the following URLs: 1) mydomain.com/~mypage (to see a user's homepage in a unix server) 2) mydomain.com/mypage.shtml it will give you an "Invalid Url" message! but both of them are correct and ordinary!!!
Email i have seen a sample script in your website to check if an email address exist, but this script is not included in the Email Check function of validation field class.
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6357
38966 credits Members referred : 374
It's time to use PHP5!
« Reply #1 on: Oct 01, 2006, 12:44:48 PM »
hello,
Thank you for pointing me on this regex errors/ problems:
Quote
1) mydomain.com/~mypage (to see a user's homepage in a unix server)
is this public type url? it looks more like a url for a homepage provided for free by your ISP, right?
Quote
2) mydomain.com/mypage.shtml
this was easy:
Code:
$url_pattern .= "((\/[\w\-\.]+\.[[:alnum:]]{2,5})?"; // filename like index.(s)html
Quote
i have seen a sample script in your website to check if an email address exist, but this script is not included in the Email Check function of validation field class.
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 8133
41755 credits Members referred : 3
« Reply #2 on: Oct 01, 2006, 12:52:43 PM »
Olaf I checked your snippet (about the email), and I think that the MX lookup is not recommended, as the mail server can reject your request in many cases (eg. the ip you are connecting has no reverse DNS entry)
I am not sure if this is happening often, but in case you have problems with this mail validation code you can use this email validation function.
Olaf I checked your snippet (about the email), and I think that the MX lookup is not recommended, as the mail server can reject your request in many cases (eg. the ip you are connecting has no reverse DNS entry)
I am not sure if this is happening often, but in case you have problems with this mail validation code you can use this email validation function.
that's why I used a regex only function in the validation class with this pattern:
What a dork
Posts: 15
112 credits Members referred : 0
« Reply #4 on: Oct 01, 2006, 04:18:02 PM »
thanks for your care about: mydomain.com/~mypage: yes! in most of universities, you can see the home page of students in this format. so your system should save this format of user's home page in the database.
i think you have make a good class, but it is better to do more work on the URL check. also using the pages whit script (like: /mypage.html?user="myname"..)
about check4htmltags option, it let the user to have such tages in the textbox: <b> my text </b>. is it true?
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6357
38966 credits Members referred : 374
It's time to use PHP5!
« Reply #5 on: Oct 01, 2006, 04:27:52 PM »
check below:
Quote
about: mydomain.com/~mypage: yes! in most of universities, you can see the home page of students in this format. so your system should save this format of user's home page in the database.
I know, I got this question before from some guy using the free webspace provided by a ISP, will add this later...(maybe )
Quote
i think you have make a good class, but it is better to do more work on the URL check. also using the pages whit script (like: /mypage.html?user="myname"..)
querystrings are fine but you example is not valid, remove the quotes...
Quote
about check4htmltags option, it let the user to have such tages in the textbox: <b> my text </b>. is it true?
What a dork
Posts: 15
112 credits Members referred : 0
« Reply #6 on: Oct 01, 2006, 08:52:34 PM »
when i install validate_fields_1-35 on my local windows server with Apache: Open the Original validation_demo.php (while $example->check_4html = true;)
Please Put the following text in "Simple_text": this is a <b> text </b> for check the Html tages!
then submit the form. you will see the from accept it! without returning any error! i checked with "<h1> some text </h1>" too, but i had no error! but there are HTML tages in the text fields!
What a dork
Posts: 15
112 credits Members referred : 0
« Reply #8 on: Oct 03, 2006, 04:23:10 PM »
i checked the new code and get the following results:
1) when you type: hi <b> olaf! </b> it works. 2) when you type: hi <b > olaf! </b > it Doesn't work! 3) when you type: hi <h1 > olaf! again it Doesn't work!
« Last Edit: Oct 03, 2006, 04:25:27 PM by rouge et noire »
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6357
38966 credits Members referred : 374
i checked the new code and get the following results:
1) when you type: hi <b> olaf! </b> it works. 2) when you type: hi <b > olaf! </b > it Doesn't work! 3) when you type: hi <h1 > olaf! again it Doesn't work!
is this about unvalid html code? use strip_tags() instead
What a dork
Posts: 15
112 credits Members referred : 0
« Reply #10 on: Oct 04, 2006, 04:55:21 AM »
when we put <b > a text </b > it's not invalid HTML tag, since that tag works in a webpage. so what's your opinion to prevent user to type any "<" or ">" characters or using like htmlspecialchar() or htmlentities() or like you told, strip_tages()? in your opinion, what way is better?
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6357
38966 credits Members referred : 374
when we put <b > a text </b > it's not invalid HTML tag, since that tag works in a webpage. so what's your opinion to prevent user to type any "<" or ">" characters or using like htmlspecialchar() or htmlentities() or like you told, strip_tages()? in your opinion, what way is better?
You know how more code is valid after the regex check how more problems you can except. I think that I would use strip_tags in addition, but that depends on the application (moderated form post or not)