title: how to pass multiple PHP arguments to bash
body: <p>setip.php :</p>
  
  <pre><code>&lt;?php
  $IP_Addr = $_GET['ip'];
  $NetMask = $_GET['ip2'];
  $NetWork = $_GET['ip3'];
  $Broad = $_GET['ip4'];
  $DNS = $_GET['dns1'];
  
  $cmd="sh /var/www/cgi-bin/ipset.sh ".escapeshellarg($IP_Addr)."".escapeshellarg($NetMask)."".escapeshellarg($NetWork)."".escapeshellarg($Broad)."".escapeshellarg($DNS);
   exec("$cmd");
  </code></pre>
  
  <p><strong>example input :</strong> ip=10, ip2=20, ip3=30, ip4=40, dns1=10</p>
  
  <p>ipset.sh :</p>
  
  <pre><code>#!/bin/bash -x
  echo "IPADDR=$1"       &gt;&gt;/etc/sysconfig/network-scripts/ifcfg-eth0
  echo "NETMASK=$2"     &gt;&gt;/etc/sysconfig/network-scripts/ifcfg-eth0
  echo "NETWORK=$3"     &gt;&gt;/etc/sysconfig/network-scripts/ifcfg-eth0
  echo "Broadcast=$4"   &gt;&gt;/etc/sysconfig/network-scripts/ifcfg-eth0
  echo "DNS=$5"        &gt;&gt;/etc/sysconfig/network-scripts/ifcfg-eth0
  </code></pre>
  
  <p>result in ifcfg-eth0 :</p>
  
  <pre><code>IPADDR=1020304010
  NETMASK=
  NETWORK=
  BROADCAST=
  DNS=
  </code></pre>
  
  <p>any sugestion how to pass argument correctly ?</p>