<?php
session_start();

include "../phpconfig/config.php";
include "../phpconfig/valida_login.php";
include "../phpconfig/funcoes.php";
include "../phpconfig/slugfy.php";


$id=$_POST['id'];

 	$tag       =$_POST['tag'];



if(trim($_POST['slug'])==''){

$slug = slugfyURL($tag);


}else{
	$slug = slugfyURL($_POST['slug']);
}



mysql_query("UPDATE tags SET tag='$tag', slug='$slug' WHERE id='$id'", $con) or die(mysql_error());


  
header("location:edit.php?id=$id");