C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\zomplog\admin\newentry.php


1
<?php/* Written by Gerben Schmidt, http://scripts.zomp.nl */include_once("config.php");include('session.php');include('header.php');include("../language/$language");if(!$_POST["submit"]){echo "<form ENCTYPE='multipart/form-data' name='input' method='post' action='newentry.php'>";echo "<table width='600' border='0' cellspacing='0' class='admin'>";echo "<tr>";echo "<td>&nbsp;</td>";echo "</tr>";echo "<tr>";echo "<td class='admin_title'>$newentry</td>";echo "</tr>";echo "<tr>";echo "<td>&nbsp;</td>";echo "</tr>";if(!$use_manualdate){echo "<input name='date2' type='hidden' value='$date'>";}else{echo "<tr>"; echo "<td class='admin'>$lang_date</td>";echo "</tr>";echo "<tr>";echo "<td class='admin'><textarea name='date2' cols='45' id='text'>$date</textarea></td>";echo "</tr>";echo "</tr>";echo "<tr>"; echo "<td>&nbsp;</td>";echo "</tr>";}echo "<tr>";echo "<td class='admin'>$lang_title</td>";echo "</tr>";echo "<tr>"; echo "<td class='admin' width='200'><input name='title' type='text' id='title2'></td>";echo "</tr>";echo "<tr>"; echo "<td class='admin'>&nbsp;</td>";echo "</tr>";echo "<tr>"; echo "<td class='admin'>$lang_entry</td>";echo "</tr>";echo "<tr>"; echo "<td class='admin'><textarea name='text' cols='65' rows='15' id='text'></textarea></td>";echo "</tr>";echo "<tr>"; echo "<td class='admin'>&nbsp;</td>";echo "</tr>";echo "<tr>"; echo "<td class='admin'>$lang_extendedentry</td>";echo "</tr>";echo "<tr>"; echo "<td class='admin'><textarea name='extended' cols='65' rows='15' id='extended'></textarea></td>";echo "</tr>";echo "<tr>"; echo "<td class='admin'>&nbsp;</td>";echo "</tr>";echo "<tr>";echo "<td class='admin'>$lang_upload</td>";echo "</tr>";echo "<tr>";echo "<td class='admin'><INPUT TYPE='file' NAME='userfile'></td>";echo "</tr>";echo "</td>";echo "<tr>"; echo "<td class='admin'>&nbsp;</td>";echo "</tr>";echo "<tr>";echo "<td class='admin'>$lang_select_cat</td>";echo "</tr>";echo "<tr><td class='admin' width='200'>";?> <select name="catid" style="width: 140px"> <option selected>category</option> <? // group permissions$username $_SESSION['login'];$query2 mysql_query("SELECT * FROM $table_users WHERE (login = '$username')"); while ($row mysql_fetch_array ($query2)) {$admin $row['permissions'];$userid $row['id'];}if($admin!=0){$query mysql_query("SELECT * FROM $table_cat ORDER BY id ASC");while($row mysql_fetch_array($query)) { echo '<option value="'.$row["id"].'">'.$row["name"]; }}else {$query3 mysql_query("SELECT * FROM $table_cat WHERE (permissions = '0') ORDER BY id ASC");while($row mysql_fetch_array($query3)) { echo '<option value="'.$row["id"].'">'.$row["name"];}}?> </select><?echo "</td></tr>";echo "<tr>"; echo "<td class='admin'>&nbsp;</td>";echo "</tr>";echo "<tr>"; echo "<td class='admin'><input type='submit' name='submit' value='submit'></td>";echo "</tr>";echo "<tr>";echo "<td class='admin'>&nbsp;</td>";echo "</tr>";echo "</form>";echo "</table>";}if($_POST["submit"]){if(!$_POST["title"]) {$error "$providetitle $back <a href='$_SERVER[HTTP_REFERER]'>$prevpage</a>";}elseif(!$_POST["text"]) {$error "$providearticle $back <a href='$_SERVER[HTTP_REFERER]'>$prevpage</a>";}else {// uploadinclude('upload.php');// get userid$username $_SESSION['login'];$query5 mysql_query("SELECT * FROM $table_users WHERE (login = '$username')"); while ($row mysql_fetch_array ($query5)) {$userid $row['id'];mysql_query("INSERT INTO $table (title,text,extended,image,catid,date,userid,username) VALUES ('$_POST[title]','$_POST[text]','$_POST[extended]','".$HTTP_POST_FILES['userfile']['name']."','$_POST[catid]','$_POST[date2]','$userid','$username')") or die (mysql_error()); $error "$data_added $backmembersarea";}}}DisplayError($error);include('footer.php');?>