Session on PHP with MySQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear all,

I have some confusing about my script, this is story

I  have  login  page,  and then the user got current page with various
menu,  but  when user click one of menu, its has error mesage, here my
script

<html>
<p align = "center">
<?
//require "setup.php";
require "common.php";
include "setup.php";
global $action;
banner_login();

$sql = "select user_name from iduser where user_name='$name' and " ;
        $sql =  $sql .  " user_pass = '$password' " ;

if (! $tampil = mysql_query($sql,$dbh))
   {
   echo mysql_error();
   return 0;
   }
$result  = mysql_query($sql);
if ( mysql_num_rows($result)==0)
{   echo  "<font face=verdana size=2>User ID atau Password yang anda masukkan tidak benar </font>"; }
else
    {
    echo "<center><font face=verdana size=2> Welcome <strong>$name</strong> </font></center><br>";

?>
<center><font size=-2 face=Verdana></font>
| <A href=i_login.php?action=upload_file>Upload File</a> |
<A href=i_login.php?action=upload_nilai>Upload Nilai</A> |
<A href=i_login.php?action=upload_jadwal_klh>Upload Jadwal Kuliah</A> |
<A href=i_login.php?action=upload_jadwal_bmb>Upload Jadwal Bimbingan</A> |
<A href=i_login.php?action=news>Upload News</a> |
<A href=i_login.php?action=upload_silabus>Silabus Kuliah</A> |
<A href=i_login.php?action=upload_artikel>Upload Artikel</A> |
<A href=i_login.php?action=upload_stuff>Fun & Stuff</A> |
<A href=./guestbook.php>GuestBook</a> |
<A href=i_login.php?user=<?echo $name?>$action=preference>Preference</A> |</font></center>

<?


//function list_record() {
//<a href="menu_mhs.php?nbi=$nbi&amp;th_akd=$th_akd&amp;semester=$semester" title="Menu">Menu Mahasiswa</a><br/>
$query ="SELECT count(*) FROM news where byname='$name'";
$result = mysql_query($query);
if (!$result) error_message(sql_error());
$query_data = mysql_fetch_row($result);
$total_num_news = $query_data[0];
//if (!$total_num_news) error_message('Belum Pernah Posting');
echo "<br><CENTER><font size=2 face=verdana>$name, Anda telah <strong>$total_num_news</strong>
 posting Break News</font></CEBTER>";

function upload_file() {
global $name;
echo "oke pilih upload rek";
}

function upload_nilai() {
echo "oke pilih upload rek";
}

function upload_jadwal_klh() {
echo "oke pilih upload rek";
}

function upload_jadwal_bmb() {
echo "oke pilih upload rek";
}

function upload_silabus() {
echo "oke pilih upload rek";
}

function news() {
echo "isi news";
}

function upload_stuff() {
echo "oke pilih upload rek";
}

function nilai() {
echo "isi nilai";
}

function jadwal() {
echo "isi jadwal";
}

function prefer() {
global $action,$name;
echo "$name ini isi preference";
}

   if ($action == 'preference')
      { prefer(); }
    elseif ($action == 'upload_file')
      { upload_file();}
    elseif ($action == 'upload_nilai')
      { upload_nilai();}
    elseif ($action == 'upload_jadwal_klh')
      { upload_jadwal_klh();}
    elseif ($action == 'upload_jadwal_bmb')
      { upload_jadwal_bmb();}
    elseif ($action == 'news')
      { news();}
    elseif ($action == 'upload_silabus')
      { upload_silabus();}
    elseif ($action == 'upload_artikel')
      { upload_artikel();}
    elseif ($action == 'upload_stuff')
      { upload_stuff();}

?>
</html>

<?
echo "<br>";
footer();
}
?>

do I have mistake with my script, pls give me solution
thanks all for yr help
-- 
Warm regards,
Afif
mailto:afif@sur.ogs-id.com



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux