0

i am a beginner at web developing but trying to improve my skills,
To make a simple page that view a users data from database i will had to use GET method like that:

if (isset($_GET['id'])){
        $id=$_GET['id'];
        $stmt = $con->prepare("SELECT * FROM series WHERE seriesID = $id");
        $stmt->execute();
        $rows = $stmt->fetchAll();

something like: users.php?id=1 but i saw some website uses a different ways 1- the first way is to make it looks like a directory
ex. www.website.com/username/
2- make a sub-domain for every user
ex. username.website.com
i hope you understand what i'm saying

edit: i understand the pretty urls now but i still don't know how to make a subdomain for every registered member

  • 4
    Possible duplicate of [Reference: mod\_rewrite, URL rewriting and "pretty links" explained](https://stackoverflow.com/questions/20563772/reference-mod-rewrite-url-rewriting-and-pretty-links-explained) –  Aug 05 '17 at 05:24
  • You should also be aware of [How can I prevent SQL injection in PHP?](https://stackoverflow.com/questions/60174/how-can-i-prevent-sql-injection-in-php?lq=1]). –  Aug 06 '17 at 16:01

0 Answers0