Jump to content
php.lv forumi

profils.php


IBEX

Recommended Posts

pienjemsim man ir lapa kur radas visi lietotaaji. vinu vards ir linka, kas ved uz profila lapu. // index.php?id=user&id=lietotaaja_id..

Tas man ir, talak man vajag izveidot to lietotaaju_profils.php

es štukoju, kko tādu.. domāju, ka doma ir pareiza, bet kodā kkas nepareizs.. raada NEKO.

<?php
if(isset($_GET['id']) == 'id' AND $_GET['id'])
{
$r = mysql_query("SELECT * FROM lietotaaji WHERE id = {$_GET['id']}");
$r = mysql_fetch_arraY($r);
{
echo "
" . $r['id'] . "
" . $r['vaards'] . "
" . $r['uzvaards'] . "
";
}

?>

Edited by IBEX
Link to comment
Share on other sites

<?php
if(isset($_GET['id']) && !empty($_GET['id']))
{
$q = mysql_query("SELECT * FROM lietotaaji WHERE id = {$_GET['id']}");
$r = mysql_fetch_array($q);
echo "
" . $r['id'] . "
" . $r['vaards'] . "
" . $r['uzvaards'] . "
";
}
?>

 

vēl pieņemsim var uzlikt pārbaudi vai id is_numeric

Edited by vacant
Link to comment
Share on other sites

Hm, Grey_Wolf, kāds tam sakars ?

njaa ... garumziimiites :(

--

Domats ka panjems no 2 vienadiem ...

--

if(isset($_GET['id']) == 'id' AND $_GET['id'])

IMPHO nekad neizpildiisies ..

Jo isset() atgriez True/false (boilen) un nekad !!! nebuus vienads ar 'id' ..

Link to comment
Share on other sites

  • 3 months later...
×
×
  • Create New...