I'm making a website that has a simple profile system.
All my profiles have a separate .php
file with their id in a name like 1.php
, 2.php
and so on.
On index navigation bar, I have the option to go to persons own profile (my page requires login on every page so it will work fine).
That's is where my problem is. I need to take id from my cookies (1 for example) and use it to go to profile/1.php
.
Since my navigation bar is made with HTML, I need to use href
system to redirect, but href
cant recognize code from PHP $id
.
I tried to make separated redirect file but that gave me Cannot modify header information
error.
Is there a way for me to make such mess work (just learning) or do I need to scrap that idea?