Hi I have an email script that can be triggered without a recipent address, so I want I think an if or else statment to default it to my address if its triggered by mistake.? I have a data base of email addresses and I want a bit of code that checks to see if row_rs_details['email'] exsists if, not then siwtch to my default of Hope that makes sense Jim bob
Hello, You need to use the isset function to check if the variable exists and you might want to check it's not empty too. To check it's not empty you can use the empty() function, heres an example: if( !isset ( $row_rs_details['email'] ) || empty( $row_rs_details['email'] ) ) $row_rs_details['email'] = 'me@me.com'; Code (markup): Sky22
thank you if I want the result to be a variable ie $email can I do $email= if( !isset ( $row_rs_details['email'] ) || empty( $row_rs_details['email'] ) ) $row_rs_details['email'] = 'me@me.com'; PHP: seems I cant.....