Location: PHPKode > scripts > Open4Listing > cont/newsubcateg.php
<?php
include("../setari.php");
$cxn = @ConnectToDb($dbServer, $dbUser9, $dbPass9, $dbName9);
if(isset($_COOKIE['vanzinch_email'])) 
{ 
$username = $_COOKIE['vanzinch_email']; 
$pass = $_COOKIE['vanzinch_pass'];
$check = mysql_query("SELECT * FROM clienti WHERE email = '$username'")or die(mysql_error()); 
while($myrow = mysql_fetch_array( $check )) 
{ 
if ($pass != $myrow['parola']) 
{
header("Location: login.php"); 
} 
else 
if($_POST[submit])
{
$judet2=str_replace (" ", "+", $_POST[judet]);
$insert="INSERT INTO localitati(judet, localitate)VALUES('$_POST[judet]', '$_POST[localitate]')";
$rsult = mysql_query($insert) or die("Query failed aici");
header("Location: adauga_anunt1.php?judet=$judet2");
}
{

$judet=$_GET[judet];
$judet2=str_replace (" ", "+", $judet);
?> 

<html>

<head>

<title>ADMIN</title>



<style type="text/css"><!-- 

A{text-decoration:none}

-->

</style>
</head>

<body bgcolor="#333333">

 <div align="center">

 <br><br>
<?php
include 'sus.php';
?>

<div align="center">

 

<table border="1" width="860" cellspacing="0" cellpadding="0" bordercolor="#006699" bordercolorlight="#808080" bgcolor="#ffffff">

<tr><td>








<div align="center">



<table border="0" cellspacing="0" cellpadding="0" width="100%">

<tr>

<td width="800" align=center bgcolor="#FFFFFF" valign="top">

		

		

		

	<div align="center">

		

		

		

	<table cellspacing="1" cellpadding="2" width="860">

<tr><td valign="top" bgcolor="#CC3300" width="418">

<font color="#FFFFFF" face="Verdana" size="2"><b>&nbsp;

</span>Add sub-category:</b></font><td bgcolor="#333333">

<p align="center"><b><font color="#FFFFFF" size="1" face="Verdana">

<span lang="en-us"><a href="cont.php"><font color="#FFFFFF">&lt;&lt;&lt;</font></a></span></font></b><a href="cont.php"><span lang="en-us"><b><font face="Verdana" size="1" color="#FFFFFF">Back 

to Main Page</font></b></span></a><td class=anunttitlu2 width=20% bgcolor="#FF0000">

	<p align=center><b><a href=logout.php>

	<font face=Verdana color=#ffffff size=1>Logout</font></a><span lang="en-us"><font face=Verdana color=#FFFFFF size=1>&gt;&gt;&gt;</font></span></b></p></td></tr></table>

<table width=860 cellpadding=0>

<tr><td width="80%" bgcolor=#EEF3F9 align="center">

















&nbsp;<table border="0" width="60%">

	<tr>

		<td bgcolor="#4C83C8" width="60%">

<font face="Verdana" size="2" color="#FFFFFF">

<b>New sub-category:</b></font></td>

		<td bgcolor="#FF0000" width="40%">

<p align="center"><b><a href="adauga_anunt1.php?judet=<?php echo $judet2;?>">
<font size="1" face="Verdana" color="#FFFFFF">cancel</font></a></b></td>

	</tr>

	<tr>

		<td bgcolor="#EEF3F9" width="426" colspan="2">

&nbsp;</td>

	</tr>
<form method="post" action="<?php echo $PHP_SELF; ?>" enctype="multipart/form-data">
	<tr>

		<td colspan="2" bgcolor="#E1EAF4">


<font size="1" face="Verdana">&nbsp;<b>Category:</b></font></tr>

	<tr>

		<td colspan="2" bgcolor="#FFFFFF">

<input type="text" name="judet" size="58" value="<?php echo $judet;?>" READONLY></tr>

	<tr>

		<td colspan="2">
&nbsp;</tr>

	<tr>

		<td colspan="2" bgcolor="#E1EAF4">
<b>
<font face="Verdana" size="1">New sub-category:</font></b></tr>

	<tr>

		<td colspan="2" bgcolor="#FFFFFF">

<input type="text" name="localitate" size="58" style="border: 1px solid #000000"></tr>

	<tr>

		<td colspan="2">

<input type="submit" value="Add sub-category" name="submit"></td></tr>

	<tr>

		<td colspan="2" height="22">

&nbsp;</td></tr>

</form>


<tr><td bgcolor="#FFFFFF" colspan="2"><font color=#333333 size=2 face=verdana>
	<br></font><font size=1><font face=verdana>
	Example 1: New York City > <font color="#FF0000">Manhattan</font> <br>(New York City is the Main Category and Manhattan is the 
	sub-category)
<br><br>Example 2: </font><font color=#333333 face=verdana>
	New York City > </font><font color=#FF0000 face=verdana>
	Apartments for Rent </font><font color=#333333 face=verdana>
	<br>(New York City is the Main Category and Apartments for Rent is the sub-category)
<br><br>Example 3: Apartments for Rent  > </font>
	<font color=#FF0000 face=verdana>
	Manhattan</font><font color=#333333 face=verdana><br>(Apartments for Rent is the Main Category and Manhattan is the 
	sub-category)
	<font color=#333333 size=2 face=verdana>
	<p>
</td/></tr><tr><td colspan="2"><br><br><br></td></tr></table>





<?php



}}}



else 



//if the cookie does not exist, they are taken to the login screen 

{ 

header("Location: login.php"); 

} 



?>



	</table>



</td>

</tr>

</td>

</tr>



</table></div>

</td>

</tr>



</table>



<tr>

<td colspan="2">



</td>

</tr>



</table>







</tr></td></table>



</body>

</html>
Return current item: Open4Listing