0
function sendSMS($msg, 
                 $to, 
                 $profileID="(if (@$_GET['debug'] == "true") { 
                                 echo "21409"; 
                              } else { 
                                 echo "21410"; })", 
                 $user="User", 
                 $pass="Pass", 
                 $serverID="", 
                 $msgid="", 
                 $shortCode="00000"){

I would like it so that when Debug is called it gives a different number

Debug True = 21409

Debug False = 21410

1
  • I think you might be using the function weirdly, generally, you pass values to a function, you don't just set the default params and not ever change them... If they are hard coded, they shouldn't be params. Commented Jul 21, 2013 at 2:02

2 Answers 2

1

well...You can't do it, logic goes in the body of the function, not in the header.
And since the value for $profileID is calculate anyway, why would u even put it in the header of the function?

function sendSMS($msg, 
                 $to, 

                 $user="User", 
                 $pass="Pass", 
                 $serverID="", 
                 $msgid="", 
                 $shortCode="00000"){
$profileID=($_GET['debug'])?21409:21410;
...
...
} 
Sign up to request clarification or add additional context in comments.

Comments

0

Why are you trying to write an if statement in the signature of the function??

And echo directly writes the string into the output stream. What you need to do is to establish the variable $profileId depending on $_GET[DEBUG] and use it in the statement that sends the email.

function sendSMS($msg, 
                 $to,  
                 $user="User", 
                 $pass="Pass", 
                 $serverID="", 
                 $msgid="", 
                 $shortCode="00000"){


    if ($_GET['debug'] == "true") { 
        $profileID = "21409"; 
    } else { 
        $profileID= "21410";
    }

    ....
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.