Dears, how to make dynamic webpage with php for example:
website.com/pagename
website.com/gallery
website.com/page4/page6

How to do in code how to call pages?

Have you ever heard of Apache's mod_rewrite and of $_SERVER['HTTP_REFERER']? :) That's the golden combo that is usally used to achieve what I think you want to achieve.

Do you have any code yet? Can you be a bit more specific about what your starting point is?

This is my index.php :

<?php
session_start();
require_once("configuration.php");
require_once("functions.php");
require_once("session_load.php");
//require_once("connection.php");
$url_id = get_url_value();



// ucitavanje pocetne strane, homepage
if (($url_id['grupa'] == "0") and ($url_id['stranica'] == "0")){
        include_once ("includes/pocetna.php"); 
    }


// ucitavanje formi za logovanje i registraciju profesora i admina skola
if ($url_id['grupa'] == "form"){
        // ucitavanje zajednickog headera za forme za logovanje i registrovanje
        include_once ("includes/form_login_register_header.php");
        if ($url_id['stranica'] == "login_profesor"){
                include_once ("includes/form_login_profesor.php");
            }
        if ($url_id['stranica'] == "login_skola"){
                include_once ("includes/form_login_skola.php");
            }
        if ($url_id['stranica'] == "register_profesor"){
                include_once ("includes/form_register_profesor.php");
            }
        if ($url_id['stranica'] == "register_skola"){
                include_once ("includes/form_register_skola.php");
            }
        // ucitavanje zajednickog footera za forme za logovanje i registrovanje
        include_once ("includes/form_login_register_footer.php");
    }



// stranice o nama kontakt i portfolio

if ($url_id['grupa'] == "main"){
    include_once ("mainpage/main_header.php");  // header sa index strane sa prijavom
    if ($url_id['stranica'] == "kontakt"){
                include_once ("mainpage/kontakt.php");
            }
            if ($url_id['stranica'] == "onama"){
                include_once ("mainpage/onama.php");
                include_once ("mainpage/main_footer.php"); // footer sa index strane veliki
            }

            if ($url_id['stranica'] == "portfolio"){
                include_once ("mainpage/portfolio.php");
                include_once ("mainpage/main_footer.php"); // footer sa index strane veliki
            }
    include_once ("includes/form_login_register_footer.php");

    }




// stranice vezane za podatke koje modifikuje admin skole
if ($url_id['grupa'] == "skola"){
        // ucitavanje zajednickog headera za strane gde je ulogovan admin skole
        include_once ("");
        if ($url_id['stranica'] == "podaci"){
                include_once ("");
            }
        if ($url_id['stranica'] == "nastavnici_spisak"){
                include_once ("");
            }
        if ($url_id['stranica'] == "nastavnici_dodaj"){
                include_once ("");
            }
        if ($url_id['stranica'] == "nastavnici_portfolio"){
                include_once ("");
            }
        if ($url_id['stranica'] == "ucenici_spisak"){
                include_once ("");
            }
        if ($url_id['stranica'] == "ucenici_dodaj"){
                include_once ("");
            }
        if ($url_id['stranica'] == "ucenici_obrisi"){
                include_once ("");
            }
        if ($url_id['stranica'] == "ucenici_portfolio"){
                include_once ("");
            }
        // ucitavanje zajednickog footera za strane gde je ulogovan admin skole
        include_once ("");
    }






















// ucitavanje strana za obradu formi
if ($url_id['grupa'] == "submitform"){
        if ($url_id['stranica'] == "login_profesor"){
                include_once ("formsubmit/submitform_login_profesor.php");
            }
        if ($url_id['stranica'] == "login_skola"){
                include_once ("formsubmit/submitform_login_skola.php");
            }
        if ($url_id['stranica'] == "register_profesor"){
                include_once ("formsubmit/submitform_register_profesor.php");
            }
        if ($url_id['stranica'] == "register_skola"){
                include_once ("formsubmit/submitform_register_skola.php");
            }
    }




//mysql_close($connection);
?>

and this is pocenta.php(template):
...

body class="pull_top">
    <div class="navbar transparent navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
            <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>
            <a class="brand" href="index.php">
                <strong>ШКОЛСКИ ПОРТФОЛИО</strong>
            </a>
            <div class="nav-collapse collapse">
                <ul class="nav pull-right">
                    <li><a href="index.php" class="active">ПОЧЕТНА</a></li>
                    <li><a href="index.php?id_1=main&id_2=portfolio">ПОРТФОЛИО</a></li>
                    <li><a href="index.php?id_1=main&id_2=onama">О НАМА</a></li>
                    <li><a href="index.php?id_1=main&id_2=kontakt">КОНТАКТ</a></li>

                    <li><a class="btn-header" href="register.html">РЕГИСТРУЈ СЕ</a></li>

                </ul>

            </div>
        </div>

      </div>
      <ul id="prijava">
       <li class="sideli"><a class="btn-header" href="index.php?id_1=form&id_2=login_skola">Пријава за администратора</a></li> |
       <li class="sideli"><a class="btn-header" href="index.php?id_1=form&id_2=login_profesor">Пријава за наставнике</a></li></ul>
    </div>

    <section id="feature_slider" class="">

....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.