title: How to send variables using exec() PHP
body: <p>I am trying to send php variables to a function, but none of the following are passing the variables.  </p>
  
  <pre><code>$vars='email=' . $_POST['email'] . '&amp;password=' . $_POST['password'] . '&amp;server=' . $_POST['server'];
  $function = 'nohup php unsubscribefunction.php ' . escapeshellarg($vars);
  exec($function); 
  exec('nohup php unsubscribefunction.php ' . $vars);
  exec('nohup php unsubscribefunction.php $vars ');
  
  
  $vars='?email=' . $_POST['email'] . '&amp;password=' . $_POST['password'] . '&amp;server=' . $_POST['server'];
  $function = 'nohup php unsubscribefunction.php' . $vars;
  exec($function); 
  </code></pre>
  
  <p><strong>Here's what <a href="http://php.net/manual/en/function.exec.php" rel="nofollow">the php.net page</a> says about this</strong> </p>
  
  <blockquote>
    <p>When allowing user-supplied data to be
    passed to this function, use
    escapeshellarg() or escapeshellcmd()
    to ensure that users cannot trick the
    system into executing arbitrary
    commands.</p>
  </blockquote>
  
  <p>However, there are no examples on how to pass the variables, any insights or examples would be appreciated.  </p>