GIF89a;
Direktori : /home/serb/www/admin/ |
Current File : /home/serb/www/admin/add_games.php |
<? include("sessionout.php"); include("../lib/globals.php"); include("../lib/common.php"); include("../lib/functions.php"); ini_set("post_max_size", "30M"); ini_set("upload_max_filesize", "30M"); ini_set("memory_limit", "20000M"); $id=$_POST["id"]; $sb=$_POST["Submit"]; if($sb=="Process") { /*ini_set("post_max_size", "30M"); ini_set("upload_max_filesize", "30M"); ini_set("memory_limit", "20000M");*/ if($_FILES['ad_img']['name']) { $manu_imagename1=time().$_FILES['ad_img']['name']; move_uploaded_file($_FILES['ad_img']['tmp_name'],'../gameimages/'.$manu_imagename1); } if($_FILES['gamefile']['name']) { $manu_imagename11=$_FILES['gamefile']['name']; move_uploaded_file($_FILES['gamefile']['tmp_name'],'../games/'.$manu_imagename11); } $date=date('Y-m-d'); $headertext=addslashes($_POST['title']); $ins="INSERT INTO games(id,name,game_image,game_file,status) VALUES('','$headertext','".$manu_imagename1."','$manu_imagename11','a')"; execute_query($ins); ?> <script> window.location.href="list_games.php"; </script> <? } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>:: Escortservice| Admin ::</title> <link href="../style.css" rel="stylesheet" type="text/css" /> <script language="javascript" src="../validator/frm_validator.js"></script> <script> function validate4() { if(document.f1.ad_img.value!=""){ var str = document.f1.ad_img.value; var lower = str.toLowerCase(); var newStr = lower.substring(lower.length-4, lower.length); //alert(newStr); if((newStr!=".jpg")&&(newStr!=".jpeg")&&(newStr!=".png")&&(newStr!=".bmp")){ alert("You cannot upload executable files...! Please upload files in jpg or jpeg or png extension."); document.f1.ad_img.focus(); return (false); } } if(document.f1.gamefile.value!=""){ var str = document.f1.gamefile.value; var lower = str.toLowerCase(); var newStr = lower.substring(lower.length-4, lower.length); //alert(newStr); if((newStr!=".swf")){ alert("You cannot upload executable files...! Please upload files in swf extension."); document.f1.gamefile.focus(); return (false); } } } </script> </head> <body> <table width="790" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="left" valign="top"><table width="790" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top" class="td1"><table width="790" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="343" align="left" valign="top"> </td> <td width="447" align="left" valign="top"> </td> </tr> <tr> <td height="38" align="right" valign="middle" class="topnav"><p style="margin-left:23px;"><img src="img/logo.png" alt="" /></p></td> <td align="center" valign="middle" class="footer-link">Administrator Control Panel</td> </tr> </table></td> </tr> <tr> <td align="left" valign="top" class="td2"> </td> </tr> </table></td> </tr> <tr> <td align="center" valign="top" class="td3"><table width="780" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="5"></td> </tr> <tr> <td align="center" valign="top" class="td4"><table width="768" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="6"></td> </tr> <tr> <td align="center" valign="top" class="td5"> </td> </tr> <tr> <td align="center" valign="top" class="td9"><table width="751" border="0" align="center" class="bordermain"> <tr> <td><? include("menu.php");?></td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td align="center"> <form action="<? print $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data" name="f1" onSubmit="return validate4();"> <table width="735" border="0" align="center" cellspacing="1" class="Table4"> <tr> <td colspan="2" align="center" class="tblHeader2">Add New Ad</td> </tr> <tr class="mouseOver"> <td align="right"> </td> <td align="left" > </td> </tr> <tr class="mouseOver"> <td width="33%" align="right"><strong>Game Title: </strong></td> <td width="67%" align="left"> <input type="text" name="title" /> </td> </tr> <tr class="mouseOver"> <td align="right"> </td> <td align="left" > </td> </tr> <tr class="mouseOver"> <td width="33%" align="right"><strong>Game Image: </strong></td> <td width="67%" align="left"> <input type="file" name="ad_img" /> </td> </tr> <tr class="mouseOver"> <td align="right"> </td> <td align="left" > </td> </tr> <tr class="mouseOver"> <td width="33%" align="right"><strong>Game File: </strong></td> <td width="67%" align="left"> <input type="file" name="gamefile" /> </td> </tr> <tr class="mouseOver"> <td align="right"> </td> <td align="left" > </td> </tr> <tr class="mouseOver"> <td align="right"> <input type="hidden" name="ad_id" value="<?=$_GET['id'] ?>" /> <input type="hidden" name="ad_img1" value="<?=$row['ad_image']?>" /> <input name="Submit" type="submit" class="butn3" value="Process" /> </td> <td align="left" > <input name="Submit2" type="reset" class="butn3" value="Reset" /></td> </tr> <tr class="mouseOver"> <td align="right"> </td> <td align="left" > </td> </tr> </table> </form> </td> </tr> </table> </td> </tr> <tr> <td width="232" align="center" valign="top" class="td5"> </td> </tr> <tr> <td height="6"></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td align="center" valign="top" class="td3"><table width="780" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center" valign="top" class="footer-bac"> <p style="text-align:center; padding:35px 0 5px 0px;"><a href="main.php" class="footer-link">Administrator Control Panel </a></p> <p class="footer-text1" style="text-align:center;">EscortSeries</p> </td> </tr> </table></td> </tr> </table> </body> </html>