Код: Выделить всё
<?php
$dbcon=pg_connect("port=5432 dbname=videoteka user=pgsql password=******") or die("Error connect");
$stat=pg_connection_status($dbcon);
if ($stat === 0) { echo "Связь с базой видеотеки установлена\n";}
else { echo "Связь с базой видеотеки не установлена\n";}
$query="select username,password,(select role_name from role where role=id_role) from users where username='".$_POST['Login_name']."' and password='".$_POST['password']."';";
$result=pg_query($dbcon,$query);
$rows_count=pg_num_rows($result);
print "<span style ='color: rgb(255,0,0)'>".$rows_count."</span>";
print "<span style ='color: rgb(255,0,0)'>".$_POST['Login_name']."</span>";
// echo "pg_fetch_array($result,$i,PGSQL_ASSOC)";
$line=(pg_fetch_row($result,$i));
if (strlen($_POST['Login_name'])!=0){
Header('Location: '.trim($line[2]).".php");
}
print "<span style ='color: rgb(0,0,255)'>-=".strlen(trim($line[2]))."=-</span>";
print "<span style ='color: rgb(0,0,255)'>-=".$line[2]."=-</span>";
?>
как можно перейти на другую страницу не используяWarning: Cannot modify header information - headers already sent by (output started at /usr/home/manefesto/www/index.php:4) in /usr/home/manefesto/www/index.php on line 38
Код: Выделить всё
Header('Location: '.trim($line[2]).".php");