pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

jawaad private pastebin - collaborative debugging tool What's a private pastebin?


Posted by Jawaad on Thu 21 Aug 17:44
report abuse | download | new post

  1. // UPLOAD CSV CUSTOM
  2. // Ver. 1.0
  3. // by Jawaad
  4. // zaibatsu@gmail.com
  5. // File: index.php
  6.  
  7. //@ob_start();
  8. //@ob_implicit_flush(0);
  9.  
  10. @error_reporting(E_ALL ^ E_NOTICE);
  11. @ini_set('display_errors', true);
  12. @ini_set('html_errors', false);
  13. @ini_set('error_reporting', E_ALL ^ E_NOTICE);
  14.  
  15. define('jin', true);
  16.  
  17. // CONECT DATABASE
  18. @mysql_connect("localhost", "root", "") OR die ("NOT CONNECT DATABASE");
  19. @mysql_select_db("db_sms") OR die ("CONNECTED, BUT NO DATABASE");
  20.  
  21.  
  22.  
  23. ?>
  24. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  25.   "http://www.w3.org/TR/html4/strict.dtd">
  26. <html xmlns='http://www.w3.org/1999/xhtml' lang='en' xml:lang='en:us'>
  27.   <head>
  28.     <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  29.     <title>UPLOAD CSV CUSTOM</title>
  30.     <style type="text/css" media="screen">
  31.       body {
  32.         background: #fff;
  33.         color: #888;
  34.         font: 100% georgia,times,serif;
  35.       }
  36.       h1 {
  37.         font-weight: normal;
  38.         margin: 0;
  39.         padding: 0 0 .5em 0;
  40.       }
  41.       h2 {
  42.         font-weight: normal;
  43.         margin: 0;
  44.         padding: 0 0 .5em 0;
  45.       }
  46.                
  47. /*- Menu Tabs J--------------------------- */
  48.  
  49.     #tabsJ {
  50.       float:left;
  51.       width:100%;
  52.       background:#fff;
  53.       font-size:93%;
  54.       line-height:normal;
  55.           border-bottom:1px solid #24618E;
  56.       }
  57.     #tabsJ ul {
  58.         margin:0;
  59.         padding:10px 10px 0 50px;
  60.         list-style:none;
  61.       }
  62.     #tabsJ li {
  63.       display:inline;
  64.       margin:0;
  65.       padding:0;
  66.       }
  67.     #tabsJ a {
  68.       float:left;
  69.       background:url("tableftJ.gif") no-repeat left top;
  70.       margin:0;
  71.       padding:0 0 0 5px;
  72.       text-decoration:none;
  73.       }
  74.     #tabsJ a span {
  75.       float:left;
  76.       display:block;
  77.       background:url("tabrightJ.gif") no-repeat right top;
  78.       padding:5px 15px 4px 6px;
  79.       color:#24618E;
  80.       }
  81.     /* Commented Backslash Hack hides rule from IE5-Mac \*/
  82.     #tabsJ a span {float:none;}
  83.     /* End IE5-Mac hack */
  84.     #tabsJ a:hover span {
  85.       color:#FFF;
  86.       }
  87.     #tabsJ a:hover {
  88.       background-position:0% -42px;
  89.       }
  90.     #tabsJ a:hover span {
  91.       background-position:100% -42px;
  92.       }        
  93.     </style>
  94.     <script type="text/javascript">
  95. function addElement() {
  96.   var ni = document.getElementById('myDiv');
  97.   var numi = document.getElementById('theValue');
  98.   var num = (document.getElementById("theValue").value -1)+ 2;
  99.   numi.value = num;
  100.   var divIdName = "my"+num+"Div";
  101.   var newdiv = document.createElement('div');
  102.   newdiv.setAttribute("id",divIdName); //  + num +
  103.   newdiv.innerHTML = "<input type=hidden name=\"kode[" + num + "]\" value=\"" + num + "\"><input type=text name=\"field" + num + "\"> <select name=\"tipe" + num + "\"><option>TEXT</option><option>LONG-TEXT</option><option>NUMERIC</option><option>NUMERIC-2-DECIMAL</option><option>DATE</option><option>DATE-TIME</option></select> <a href=\"javascript:;\" onclick=\"removeElement(\'"+divIdName+"\')\">[- del]</a><p>";
  104.   ni.appendChild(newdiv);
  105. }
  106.  
  107. function removeElement(divNum) {
  108.   var d = document.getElementById('myDiv');
  109.   var olddiv = document.getElementById(divNum);
  110.   d.removeChild(olddiv);
  111. }
  112. </script>
  113. </head>
  114.  
  115. <body>
  116.       <h1>UPLOAD CUSTOM CSV INSERT TO MYSQL</h1>
  117. <div id="tabsJ">
  118.   <ul>
  119.     <li><a href="?do=upload_csv" title="Upload CSV"><span>Upload CSV</span></a></li>
  120.     <li><a href="?do=create_table" title="Create New Table"><span>Create New Table</span></a></li>
  121.   </ul>
  122. </div>
  123. <?php
  124. switch($_REQUEST["do"]) {
  125.         case "upload_csv":
  126.                 include ("upload_csv.php");
  127.         break;
  128.         case "create_table":
  129.                 include ("create_table.php");
  130.         break;
  131.        
  132.         default:
  133.                 include ("upload_csv.php");
  134. }
  135.  
  136. ?>
  137.  
  138.  
  139.          </body>
  140. </html>

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me so that I can delete my post