PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
spamyboy
Forum Contributor
Posts: 266 Joined: Sun Nov 06, 2005 11:29 am
Location: Lithuania, vilnius
Post
by spamyboy » Sun Nov 06, 2005 11:31 am
Jcart | Please use Code: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Pleas help I cant see any errors here but its doesnt wor ;/Code: Select all
// check from email set
if (!strlen($vars['email_from'])){
$errors[] = "<b>From Email address</b> empty";
} else if (!check_email($vars['email_from'])){
$errors[] = "<b>From Email address</b> incorrect";
}
if (!strlen($send_to) && !strlen($vars['email_to'])){
$errors[] = "<b>To Email</b> address empty (possible configuration error)";
} else if (!strlen($send_to) && !check_email($vars['email_to'])){
//if to email specified in form, check it and display error
$errors[] = "<b>To Email address</b> incorrect";
}
if (!strlen($vars['subject']) && !strlen($subject)){
$errors[] = "<b>Subject</b> empty (possible configuration error)";
}
foreach ($vars as $k=>$v){
// check for required fields (end with _req)
if (preg_match('/^(.+?)_req$/i', $k, $m) && !strlen($v)){
$field_name = ucfirst($m[1]);
$errors[] = "Required field <b>$field_name</b> empty";
}
// check for number fields (end with _num)
if (preg_match('/^(.+?)_num$/i', $k, $m) && strlen($v) && !is_numeric($v)){
$field_name = ucfirst($m[1]);
$errors[] = "Field <b>$field_name</b> must contain only digits or be empty";
}
Jcart | Please use Code: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sun Nov 06, 2005 5:08 pm
is this all the code? Try working on a more descriptive topic title next time
spamyboy
Forum Contributor
Posts: 266 Joined: Sun Nov 06, 2005 11:29 am
Location: Lithuania, vilnius
Post
by spamyboy » Sun Nov 06, 2005 6:00 pm
No it isnt, maybe next time.
p.s. You dont need all code becouse bug is in this part ( I already know it )
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Sun Nov 06, 2005 6:20 pm
If you would like our help we need to see the rest of the relevant code..
try adding print_r($errors); at the end of your snipplet to see if you are getting the expected results.
With the provided code we do not know
a) What are the contents of the array you are passing to this.
b) What you are doing with the content generated in this snipplet.
Ps. We are here to help you, not steal your code. Help us help you.
spamyboy
Forum Contributor
Posts: 266 Joined: Sun Nov 06, 2005 11:29 am
Location: Lithuania, vilnius
Post
by spamyboy » Tue Nov 08, 2005 1:03 pm
Jcart, <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> man if every one would be same as you, I would show full source code
But there Fu$%ing noobs here too.
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Tue Nov 08, 2005 1:50 pm
yes...
I am here to steal your code, since it obviously is so well written and free of errors. HA!
Burrito
Spockulator
Posts: 4715 Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah
Post
by Burrito » Tue Nov 08, 2005 2:04 pm
spamyboy wrote: Jcart, <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> man if every one would be same as you, I would show full source code
But there Fu$%ing noobs here too.
what the hell is this supposed to mean?
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Tue Nov 08, 2005 2:59 pm
What a weirdo.
foobar
Forum Regular
Posts: 613 Joined: Wed Sep 28, 2005 10:08 am
Post
by foobar » Tue Nov 08, 2005 3:31 pm
spamyboy wrote:
But there Fu$%ing noobs here too.
AHAHAHAAahaha!!
Look who's talking, turdbrain!!
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Tue Nov 08, 2005 4:02 pm
I don't blame you... it's pretty stupid.
foobar
Forum Regular
Posts: 613 Joined: Wed Sep 28, 2005 10:08 am
Post
by foobar » Wed Nov 09, 2005 6:50 am
Go ahead. It was never worthy of residing her in the first place.
Grim...
DevNet Resident
Posts: 1445 Joined: Tue May 18, 2004 5:32 am
Location: London, UK
Post
by Grim... » Wed Nov 09, 2005 7:26 am
Calm down, guys.
Remember the spirit...
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Wed Nov 09, 2005 8:44 am
spamyboy, what's actually happening in the code? I'm not going to try debugging a bunch of code when I don't know what's going on with it...
spamyboy
Forum Contributor
Posts: 266 Joined: Sun Nov 06, 2005 11:29 am
Location: Lithuania, vilnius
Post
by spamyboy » Wed Nov 09, 2005 8:48 am
WTF ???
<span style='color:blue' title='I'm naughty, are you naughty?' >smurf</span>
p.s. I already fixed it