<?php
session_start();

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


    $tag       =$_POST['tag'];



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

$slug = slugfyURL($tag);


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


mysql_query("INSERT INTO tags SET  
tag='$tag', 
slug='$slug'", $con) or die(mysql_error());

header("location:index.php");