File: /home/httpd/html/baretube.com/admin/add_pornstar.php
<?
require "header.php";
if($_POST[name]) {
$custom = mysql_real_escape_string(serialize($_POST[custom]));
$_POST = mysql_real_escape_array($_POST);
if(mysql_query("INSERT INTO pornstars (name, aka, dob, height, weight, measurements, hair, eyes, ethnicity, official_site_name, official_site_url, biography, views, custom) VALUES ('$_POST[name]', '$_POST[aka]', '$_POST[dob]', '$_POST[height]', '$_POST[weight]', '$_POST[measurements]', '$_POST[hair]', '$_POST[eyes]', '$_POST[ethnicity]', '$_POST[official_site_name]', '$_POST[official_site_url]', '$_POST[biography]', '$_POST[views]', '$custom')")) {
$insert = mysql_insert_id();
if($_FILES[thumb][tmp_name]) {
$name = 'model'.$insert.'.jpg';
move_uploaded_file($_FILES[thumb][tmp_name], $misc_path.'/'.$name);
mysql_query("UPDATE pornstars SET thumb = '$name' WHERE record_num = '$insert'");
}
$success = true;
}
}
?>
<div id="right_column">
<!-- RIGHT -->
<div id="right_top">
<div id="right_home"></div>
<div id="right_right">
<a href="index.php">Admin Home</a>
<span><a href="add_pornstar.php">Add Pornstar</a></span>
</div>
</div>
<div id="right_bg">
<h2>Add<strong>Pornstar</strong></h2>
<p>Please enter the pornstar name, and (optionally) bio information below.</p>
<div id="index_left" style='width: 100%;'>
<form action="" method="post" enctype="multipart/form-data" name="form2" id="form2">
<input type='hidden' name='sponsor' value='<? echo $_REQUEST[id]; ?>' />
<? if($success) { ?>
<p style='color:#009900'>Success! You may now add another pornstar.</p>
<? } ?>
<table width="750" border="0" align="center" cellpadding="3" cellspacing="0" class='pagetable'>
<thead>
<tr >
<th colspan="2" align='left' >Add New Pornstar</th>
</tr>
</thead>
<tr>
<td width="130" height="25" class="style4">Name</td>
<td width="608" height="25" align="left" class="style4"><input name="name" type="text" class="style4" id="name" size="35" maxlength="255" /></td>
</tr>
<tr>
<td height="25" class="style4">AKA</td>
<td height="25" align="left" class="style4"><input name="aka" type="text" class="style4" id="url" size="35" maxlength="255" /></td>
</tr>
<tr>
<td height="25" class="style4">Date Of Birth</td>
<td height="25" align="left" class="style4"><input name="dob" type="text" class="style4" id="url2" size="35" maxlength="255" /></td>
</tr>
<tr>
<td height="25" class="style4">Height</td>
<td height="25" align="left" class="style4"><input name="height" type="text" class="style4" id="url3" size="35" maxlength="255" /></td>
</tr>
<tr>
<td height="25" class="style4">Weight</td>
<td height="25" align="left" class="style4"><input name="weight" type="text" class="style4" id="url4" size="35" maxlength="255" /></td>
</tr>
<tr>
<td height="25" class="style4">Measurements</td>
<td height="25" align="left" class="style4"><input name="measurements" type="text" class="style4" id="url5" size="35" maxlength="255" /></td>
</tr>
<tr>
<td height="25" class="style4">Hair Color</td>
<td height="25" align="left" class="style4"><select name="hair" id="select">
<option value=''>-Select-</option>
<option>Blonde</option>
<option>Red</option>
<option>Brown</option>
<option>Black</option>
<option>Grey</option>
<option>White</option>
<option>Auburn</option>
</select> </td>
</tr>
<tr>
<td height="25" class="style4">Eye Color</td>
<td height="25" align="left" class="style4"><select name="eyes" id="select2">
<option value=''>-Select-</option>
<option>Amber</option>
<option>Black</option>
<option>Blue</option>
<option>Brown</option>
<option>Grey</option>
<option>Green</option>
<option>Hazel</option>
<option>Violet</option>
</select></td>
</tr>
<tr>
<td height="25" class="style4">Ethnicity</td>
<td height="25" align="left" class="style4"><select name="ethnicity" id="select3">
<option value=''>-Select-</option>
<option>White</option>
<option>Black</option>
<option>Asian</option>
<option>Latino</option>
<option>East-Indian</option>
<option>Native</option>
<option>Islander</option>
<option>Other</option>
</select></td>
</tr>
<tr>
<td height="25" class="style4">Official Site Name</td>
<td height="25" align="left" class="style4"><input name="official_site_name" type="text" class="style4" id="url6" size="35" maxlength="255" /></td>
</tr>
<tr>
<td height="25" class="style4">Official Site URL</td>
<td height="25" align="left" class="style4"><input name="official_site_url" type="text" class="style4" id="url7" size="35" maxlength="255" /></td>
</tr>
<tr>
<td height="25" class="style4">Biography</td>
<td height="25" align="left" class="style4"><textarea name="biography" cols="60" rows="5"></textarea></td>
</tr>
<tr>
<td height="25" class="style4">Views</td>
<td height="25" align="left" class="style4"><input name="views" type="text" class="style4" id="url8" size="35" maxlength="255" /></td>
</tr>
<tr>
<td height="25" class="style4">Thumb</td>
<td height="25" align="left" class="style4"><input type="file" name="thumb" id="fileField" /></td>
</tr>
<?
foreach($custom_pornstar_fields as $k=>$v) {
?>
<tr>
<td><? echo $k; ?></td>
<td>
<? if(is_array($v)) { ?>
<select name="custom[<? echo $k; ?>]">
<? foreach($v as $i) {
if($custom[$k] == $i) { $selected = 'selected'; } else { $selected = ''; }
?>
<option <? echo $selected; ?>><? echo $i; ?></option>
<? } ?>
</select>
<? } else { ?>
<input type="text" name="custom[<? echo $k; ?>]" id="textfield" value='<? echo htmlentities($custom[$k]); ?>' />
<? } ?>
</td>
</tr>
<? } ?>
<tr>
<td height="25" colspan="2" align="center" class="style4"><input type="submit" name="Submit2" value="Save" /></td>
</tr>
</table>
<p align="center"> </p>
</form>
</div>
</div>
<div id="right_bottom"></div>
<!-- RIGHT -->
<!-- STATYSTYKI -->
</div>
<!-- STATYSTYKI -->
</div>
</div>
<? require "footer.php"; ?>