function shortcode_ldjam($atts) { ld_get_vars(); // Populate the $ldvar global // global $ldvar; // Verify URL // if (isset($_GET['u'])) { $url = to_slug($_GET['u']); if ($url !== $_GET['u']) { $_GET['u'] = $url; $link = "//{$_SERVER['HTTP_HOST']}{$_SERVER['REDIRECT_URL']}"; $link = htmlspecialchars($link, ENT_QUOTES, 'UTF-8'); $link .= "?" . http_build_query($_GET); $link = str_replace('%2F', '/', $link); // Replace % code for / with an actual slash // ld_redirect($link); } } $id = null; // Verify ID // if (isset($_GET['i'])) { $id = base_decode(base_fix($_GET['i'])); } // ld_redirect // print_r($_GET); // echo( to_slug($_GET['u']) ); $shimmy = apcu_fetch('shimmy'); echo $_GET['u']; echo " | " . $id; echo " | " . base_encode($id); //print_r($_SERVER); return "<br />I am very important"; }
// database connectivity require 'main.php'; //file having the base_encode and base_decode dode $short = $_POST['short']; echo $short; echo "<br/>"; // http://po.lo/ $len = strlen($short); if ($short[$len - 1] == "/") { //remove the last forward slash in the link $short[$len - 1] = NULL; } $short = substr($short, strpos($short, '/', 12) + 1); // echo $short; // echo "<br/>"; $short = trim($short); echo "<br/>"; $decoded_id = base_decode($short, $alphabet); // echo $decoded_id; session_start(); $sql_long = "SELECT long_url from data where id = '{$decoded_id}'"; $update = "UPDATE data SET clicks = clicks+1 WHERE id = '{$decoded_id}'"; if (!mysqli_query($con, $update)) { echo "Err"; } $results = mysqli_query($con, $sql_long); while ($result = $results->fetch_assoc()) { echo $result['long_url']; // echo "<br/>helo"; } $con->close();
} $c_arr && ($all_arr[] = $c_arr); } //读取完毕============================================= //准备写入 $msgWorkSheet = new PHPExcel_Worksheet($excel_obj, strval($i)); //创建一个工作表 $excel_obj->addSheet($msgWorkSheet); //插入工作表 $excel_obj->setActiveSheetIndex($i); $act_sheet_obj = $excel_obj->getActiveSheet(); //内容处理,并写入 foreach ($all_arr as $k => $v) { if ($k != 0) { $act_sheet_obj->setCellValue('A' . ($k + 1), $v['A']); $act_sheet_obj->setCellValue('B' . ($k + 1), base_decode($v['B'])); $act_sheet_obj->setCellValue('C' . ($k + 1), $v['C']); $act_sheet_obj->setCellValue('D' . ($k + 1), date('Y-m-d', $v['D'])); $act_sheet_obj->setCellValue('E' . ($k + 1), date('Y-m-d H:i:s', $v['E'])); $act_sheet_obj->setCellValue('F' . ($k + 1), $reg_host[$v['F']]); $act_sheet_obj->setCellValue('G' . ($k + 1), $v['G']); $act_sheet_obj->setCellValue('H' . ($k + 1), $v['H']); $act_sheet_obj->setCellValue('I' . ($k + 1), date('Y-m-d H:i:s', $v['I'])); $act_sheet_obj->setCellValue('J' . ($k + 1), $cust_type_reason[$v['J']]); } else { $act_sheet_obj->setCellValue('A' . ($k + 1), $v['A']); $act_sheet_obj->setCellValue('B' . ($k + 1), $v['B']); $act_sheet_obj->setCellValue('C' . ($k + 1), $v['C']); $act_sheet_obj->setCellValue('D' . ($k + 1), $v['D']); $act_sheet_obj->setCellValue('E' . ($k + 1), $v['E']); $act_sheet_obj->setCellValue('F' . ($k + 1), $v['F']);