Location: PHPKode > projects > OpenCabling > opencabling/toggle_vlan_port.php
<?php

$object=$_REQUEST['object'];
$port=$_REQUEST['port'];
$vlanname_id=$_REQUEST['vlanname_id'];
$action=$_REQUEST['action'];

include "opendb.php";

if ($action=="add") {
  $sql="insert into vlanports(obj_id,nport,vlanname_id) values('$object','$port','$vlanname_id')";
  $query=mysql_query($sql,$mysql_conn);
  echo "<script lang=javascript>opener.location.href = 'show_detail.php?object=$object'; window.close();</script>";

} else {
  $sql="delete from vlanports where obj_id='$object' and nport='$port' and vlanname_id='$vlanname_id'";
  $query=mysql_query($sql,$mysql_conn);
  echo "<script lang=javascript>opener.location.href = 'show_detail.php?object=$object'; window.close();</script>";

} 

?>
Return current item: OpenCabling