Html link to a folder not a file on ftp server. But this folder has html?

606 views Asked by At

I'm working on a simple website that I can reach through ftp. There is a login page, what is written in .php. I don't know php at all. My problem is: In the homepage .html file, a link only points to a folder (not a .html file or something) on the ftp server like this:

<a href="login/">

enter image description here

And it goes to a page that has html(pictures):

enter image description here

enter image description here

There is no html file on ftp server in the "login" folder. But I have to edit that login page. But my mind in now blown :D I know its kinda newbie question.

Thanks in advance!

2

There are 2 answers

3
Sam On

That is how server folder structure works.

I am assuming there's either a index.php or index.html in the /login folder.

You don't have to point to the file directly for index files. Your server will hand out the index file automatically.

For example, imagine this is my login folder:

/login
  + index.php
  + process.php
  + logout.php

If you navigate to /login it will automatically hand you index.php. If you want to logout, then you would send them to /login/logout.php.

Think of a book, it always starts with an index, which will guide you through the book. The same way the index page of a site. It guides you through that site.

2
Szilveszter On

Thanks for your answer. It has a index.php file, but...i dont get it. How is this possible that a php file contains html? This is the index.php(below):

But i dont see the html elements, that shows on the page.

<?
header('Content-Type: text/html; charset=utf-8'); 
ini_set('session.use_trans_sid', 1);
ini_set("display_errors", 1);

require_once("config.php");
require_once("libs/functions.php");

if (!empty($_POST["tluser"]) && !empty($_POST["tlpw"])) {
 $sql = "
  SELECT a.*, b.travel_agency_name 
  FROM tourleader a, travel_agency b 
  WHERE 
  a.travel_agency_id = b.travel_agency_id AND 
  a.tourleader_status = 1 AND 
  a.tourleader_user = '".mysql_real_escape_string($_POST["tluser"])."' AND 
  a.tourleader_password = '".mysql_real_escape_string($_POST["tlpw"])."'
 ";
 $res = mysql_query($sql);
 $row = mysql_fetch_assoc($res);
 if (!empty($row["tourleader_id"])) {
  $sql_phone = "SELECT * FROM tourleader_phone WHERE tourleader_id = '".$row["tourleader_id"]."' ORDER BY phone_id";
  $res_phone = mysql_query($sql_phone);
  $list_phone = array();
  while ($row_phone = mysql_fetch_array($res_phone)) {
   if ($row_phone["phone_default"] == 1) {
    $row["tourleader_phone_default"] = $row_phone["phone_number"];
    $row["tourleader_phone_type"] = $row_phone["phone_type"];
    $row["tourleader_phone_user"] = $row_phone["phone_user"];
   }
   array_push($list_phone, $row_phone);
  }
  $row["tourleader_phone"] = $list_phone;
  $sql_nation = "SELECT nation_name FROM tourleader_nation WHERE nation_id = '".$row["nation_id"]."'";
  $res_nation = mysql_query($sql_nation);
  $row_nation = mysql_fetch_row($res_nation);
  $row["tourleader_nation"] = $row_nation[0];
  $_SESSION["tourleader_id"] = $row["tourleader_id"];
  $_SESSION["tourleader_data"] = $row;
  header("Location:index.php?PHPSESSID=".session_id());
  die();
 } else {
  $_SESSION["tourleader_id"] = 0;
  $smarty->assign("loginerror", 1);
 }
}
if (empty($_SESSION["tourleader_id"])) {
 $smarty->assign("action", $_SERVER["PHP_SELF"]);
 $smarty->assign("tpl", "auth.tpl");
} else {
 $smarty->assign("tourleader_id", $_SESSION["tourleader_id"]);
 $smarty->assign("tourleader_data", $_SESSION["tourleader_data"]);
 // Nyelvi beallitasok
 $lang = $_SESSION["tourleader_data"]["lang_id"];
 include("langs/".$lang.".php");
 $smarty->assign("translatemap", $translatemap);

 $_REQUEST["page"] = (isset($_REQUEST["page"])) ? $_REQUEST["page"] : ""; 
 $_REQUEST["action"] = (isset($_REQUEST["action"])) ? $_REQUEST["action"] : ""; 

 switch ($_REQUEST["page"]) {
  case "logout" :
   unset($_SESSION["tourleader_id"]);
   unset($_SESSION["tourleader_data"]);
   header("Location:index.php");
  break;
  
  case "requestplist" :
   include("requestplist.php");
  break;
  
  case "editprofile" :
   include("editprofile.php");
  break;
  
  case "vieworder" :
   include("vieworder.php");
  break;

  case "neworder" :
   include("neworder.php");
  break;
  
  default :
   $list = getactiveorders($_SESSION["tourleader_id"]);
   $smarty->assign("list", $list);
   $smarty->assign("tpl", "mainpage.tpl");
  break;
 }
}
$smarty->display("index.tpl");

/*
echo "<pre>";
print_r($_SESSION);
echo "</pre>";
*/
?>