Page 1 of 2

Pleas help

Posted: Sun Nov 06, 2005 11:31 am
by spamyboy
Jcart | Please use

Code: Select all

and

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

and

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]

Posted: Sun Nov 06, 2005 5:08 pm
by feyd
is this all the code? Try working on a more descriptive topic title next time ;)

Posted: Sun Nov 06, 2005 6:00 pm
by spamyboy
No it isnt, maybe next time.
p.s. You dont need all code becouse bug is in this part ( I already know it )

Posted: Sun Nov 06, 2005 6:20 pm
by John Cartwright
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.

Posted: Tue Nov 08, 2005 1:03 pm
by spamyboy
Jcart, <span style='color:blue' title='I&#39;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.

Posted: Tue Nov 08, 2005 1:50 pm
by Luke
yes...
I am here to steal your code, since it obviously is so well written and free of errors. HA!

Posted: Tue Nov 08, 2005 2:04 pm
by Burrito
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?

Posted: Tue Nov 08, 2005 2:59 pm
by Luke
What a weirdo.

Posted: Tue Nov 08, 2005 3:31 pm
by foobar
spamyboy wrote: But there Fu$%ing noobs here too.
AHAHAHAAahaha!!

Look who's talking, turdbrain!!

Posted: Tue Nov 08, 2005 4:00 pm
by John Cartwright
Why am I tempted to close this thread?....

Posted: Tue Nov 08, 2005 4:02 pm
by Luke
I don't blame you... it's pretty stupid.

Posted: Wed Nov 09, 2005 6:50 am
by foobar
Go ahead. It was never worthy of residing her in the first place.

Posted: Wed Nov 09, 2005 7:26 am
by Grim...
Calm down, guys.
Remember the spirit...

Posted: Wed Nov 09, 2005 8:44 am
by feyd
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...

Posted: Wed Nov 09, 2005 8:48 am
by spamyboy
WTF ???
<span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span>

p.s. I already fixed it