mardi 16 juillet 2019

PHP Profile with ID System

I have an Login/Register System but want Profiles with ID System too Like /user?id=1 or /user?=1

I already searched on the Internet and did find nothing.

My Table is called "users" and has id, username,password and created_at in it. Thats my userid.php file

<?php

// If is current user's profile (home.php)

if ( defined('IS_PROFILE_PAGE') && IS_PROFILE_PAGE ) {

    $user_id = get_current_id();

// If is another user's profile page

} elseif (! empty($_GET['id']) && is_numeric($_GET['id']) ) {

    $id = $_GET['id'];

// Otherwise something is wrong.

} else {

    die( 'No user id defined.' );

}

?>

Too I don't really know how to make a real profile page that shows profile pictures but if I got that it should be less work.

I Expect it to work but I only get the error message: "did not expect id at if in line 5"

Aucun commentaire:

Enregistrer un commentaire