Search found 14 matches

by take2hikes
Mon Mar 16, 2009 1:19 pm
Forum: Regex
Topic: Email Validator
Replies: 7
Views: 1860

Re: Email Validator

Thanks ;-) You're welcome. Btw, I glanced at your other post, but I am not familiar with PHP design patterns/best practices: I only know a bit of regex. Good luck with your blog! Well, I'll keep you in mind if the day comes where I need a super-regex ;-). I wish you knew more about the OOP aspects ...
by take2hikes
Mon Mar 16, 2009 12:22 pm
Forum: Regex
Topic: Email Validator
Replies: 7
Views: 1860

Re: Email Validator

Thanks ;-)
by take2hikes
Mon Mar 16, 2009 11:52 am
Forum: Regex
Topic: Email Validator
Replies: 7
Views: 1860

Re: Email Validator

Nod, I could always add more domains. It's a toss up between adding more domains via the OR method or just making it certain length accepted. Or, you could just allow it to accept anything after the domain. portion. I understand your issue with validating email addresses. While the compare would mak...
by take2hikes
Mon Mar 16, 2009 11:17 am
Forum: Regex
Topic: Email Validator
Replies: 7
Views: 1860

Email Validator

I was reading a book earlier and they had a regex that was.. well, flawed. How does this look to you guys? ^[a-zA-Z]+[a-zA-Z0-9_\-.]*@[a-zA-Z0-9]+[a-zA-Z0-9\-.]*\.com|net|info|tv|org|biz|au|eu$ I know there is a crazy regex out there that is the 'standard', but I think for most uses this one will wo...
by take2hikes
Mon Mar 16, 2009 10:48 am
Forum: PHP - Theory and Design
Topic: Design a sql query class
Replies: 7
Views: 962

Re: Design a sql query class

I am new to PHP and OOP as well. I'm currently working on a Blogging platform ( yes yes, reinventing the wheel- but I'm just trying to learn ). The following is a Pseudo code excerpt from my DB class:     //------------------------------------------------------------------------   // CLASS DB   // p...
by take2hikes
Mon Mar 16, 2009 8:51 am
Forum: PHP - Code
Topic: user classes and implementation
Replies: 3
Views: 601

Re: user classes and implementation

This is what I have so far, let me know what you guys think: DB Class:   //------------------------------------------------------------------------   // CLASS DB   // purpose: contains vars and functions necessary to connect to a   //          database and send a query to it.   //-------------------...
by take2hikes
Mon Mar 16, 2009 5:16 am
Forum: PHP - Code
Topic: user classes and implementation
Replies: 3
Views: 601

Re: user classes and implementation

Ok, so would you create a new DB object within the related User class function, say create_user(), to open up the connection and close it, or would you create the object outside of the function, open the connection, call the User object function, passing it the reference to the database connection, ...
by take2hikes
Sun Mar 15, 2009 8:24 pm
Forum: PHP - Code
Topic: user classes and implementation
Replies: 3
Views: 601

user classes and implementation

Hi Everyone. I'm new to the forums and rather new to PHP. I recently bought some books on the subject and have began to plan out writing a blogging platform for personal use. Yes, I know that they are a dime a dozen.. but I'm doing it more for educational purposes. At least that's my excuse ;-). Abo...
by take2hikes
Tue Feb 17, 2009 3:03 pm
Forum: Regex
Topic: finding numbers and adding them
Replies: 8
Views: 1804

Re: finding numbers and adding them

Thank you, that is a great help. My only question is regarding: /\d+(\.\d+)?/ I understand what \d+ does, but can you explain the rest long hand? If I can get that from you I should be good to go on my own, I just need a 'real world' explanation of how all of the metacharacters interact. Thanks a bu...
by take2hikes
Tue Feb 17, 2009 2:20 pm
Forum: Regex
Topic: finding numbers and adding them
Replies: 8
Views: 1804

Re: finding numbers and adding them

The first link you posted I've been too. I'll go back through and look again. The code I posted didn't return ANY result. None printed anyways, which wasn't expected.
by take2hikes
Tue Feb 17, 2009 2:07 pm
Forum: Regex
Topic: finding numbers and adding them
Replies: 8
Views: 1804

Re: finding numbers and adding them

  <?php $message = $HTTP_POST_VARS['message'];   preg_match("/[a-z\s]+(\d+)[a-z\s]+/i", $message, $match); echo "The number in the string is " . $match[1]; ?>   I tried that most recently from some guides I found online. Nothing is too descriptive though, at least with syntax. F...
by take2hikes
Tue Feb 17, 2009 12:59 pm
Forum: Regex
Topic: finding numbers and adding them
Replies: 8
Views: 1804

finding numbers and adding them

Alright.. I am reading the posts in this forum regarding reg expressions. I'm not getting anything to really work on my server. I'm a newb to PHP and I'm trying to do the following: Search a 'blob' of text for numbers, and add them. ie: Input from text field: "This is my blob of text. Today I w...
by take2hikes
Sun Feb 15, 2009 4:52 am
Forum: PHP - Code
Topic: Mail Script
Replies: 2
Views: 164

Re: Mail Script

JAB, Thank you very much for your reply. I will check out PHP.net for some more information. The php script that I inserted into my previous post is fully functional, my only question was regarding the space in the "from" name in the actual email. For some reason it isn't separating the tw...
by take2hikes
Sat Feb 14, 2009 1:50 pm
Forum: PHP - Code
Topic: Mail Script
Replies: 2
Views: 164

Mail Script

Hi everyone, I am new to PHP. I've never done anything and this will have been my first form script that I've 'modded'. I took bits and pieces, here and there, to make it work to my liking. My one question is that the From name is put together in my inbox. So if a user enters "User Name" a...