Преглед на файлове

modify absolute path in include files

miles преди 10 години
родител
ревизия
a38590a1a0
променени са 2 файла, в които са добавени 9 реда и са изтрити 10 реда
  1. 7 8
      s2u.php
  2. 2 2
      u2s.php

+ 7 - 8
s2u.php

@@ -1,8 +1,8 @@
 <?php
-include "./config.php";
-include "./ShortUrl.php";
- 
-$code = $_GET["c"];
+include dirname(__FILE__)."/config.php";
+include dirname(__FILE__)."/ShortUrl.php";
+
+$code = str_replace("/","", $_SERVER['REQUEST_URI']);
  
 try {
     $pdo = new PDO(DB_PDODRIVER . ":host=" . DB_HOST .
@@ -22,7 +22,6 @@ try {
 }
 catch (Exception $e) {
     // log exception and then redirect to error page.
-// 	header("Location: /error");
-    header("Location: index.php");
-    exit;
-}
+    //header("Location: index.php");
+    //exit;
+}

+ 2 - 2
u2s.php

@@ -1,6 +1,6 @@
 <?php
-include "./config.php";
-include "./ShortUrl.php";
+include dirname(__FILE__)."/config.php";
+include dirname(__FILE__)."/ShortUrl.php";
 
 try {
     $pdo = new PDO(DB_PDODRIVER . ":host=" . DB_HOST .