Jump to content
php.lv forumi

Links uz lietotāja profilu


ziedinjsh

Recommended Posts

Sveiki! šāds ir links uz lietoāja profila:

<a href='profile.php?user=".$data['user_id']."'>".$data['user_name']."</a>

 

un šis profile php

<?php
include("header.php");
include("fcs/functions.php");
if(!session_is_registered(user_email)){
include("login.php");
} else {
include("menu.php");

$user_id = (isset($_GET['user_id'])) ? $_GET['user_id'] : '';
$data = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE user_id='".$user_id."'"));

echo $data['user_name'];

include("footer.php");
}
?>

 

uzspiežot uz linka atveras lapa, bet viņa ir tukš! Kapēc tā?

Link to comment
Share on other sites

tā.. jā bija izdzēsies no headera.. uzliku atpakaļ.. tagad man visās lapās rāda:

 

Notice: Use of undefined constant user_email - assumed 'user_email' in D:\WEB\xampp\htdocs\forums\index.php on line 4

 

Deprecated: Function session_is_registered() is deprecated in D:\WEB\xampp\htdocs\forums\index.php on line 4

 

uz līnjas 4 (index.php):

if(!session_is_registered(user_email)){

Link to comment
Share on other sites

lab.. salaboju:

<?php
session_start();
include("header.php");
include("fcs/functions.php");
if(!isset($_SESSION['ID'])){
include("login.php");
} else {

include("menu.php");

$user_id = (isset($_GET['user_id'])) ? $_GET['user_id'] : '';
$data = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE user_id='".$user_id."'"));

echo $data['user_name'];

include("footer.php");
}
?>

 

uzspiežot uz linuku atveras profile.php?user=18, bet neizvada echo $data['user_name'];

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...