php $_POST problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • ali
    Corporal

    • Jul 2005
    • 17

    php $_POST problem

    Hi,

    The problem is as follows. These 2 php source:

    <?
    // login.php
    ?>
    <html>
    <head>
    <title>Login</title>
    </head>
    <body>
    <form method="POST" action="member.php">
    <p align="center"><font face="Arial" color="#000080">Nama:<br></font>
    <font color="#000080" face="Arial">
    <input type="text" name="nama" size="18"><br>
    Status:<br>
    <input type="radio" value="Pengunjung" checked name="status">Pengunjung</font>
    <font color="#000080" face="Arial">
    <input type="radio" name="status" value="Anggota">Anggota</font>
    <font color="#000080" face="Arial">
    <input type="radio" name="status" value="Admin">Admin</font><br>
    <input type="submit" value="LOGIN" name="login"></p>
    </form>
    </body>
    </html>

    <?
    // member.php
    ?>
    <html>
    <head>
    <title>Member</title>
    </head>
    <body>
    <?
    $nama = $_POST["nama"];
    $status = $_POST["status"];
    ?>
    <p><font face="Arial">Selamat datang <b><? echo $nama ?></b><br>
    Anda tercatat sebagai <b><? echo $status ?></b></font></p>
    <p><font face="Arial"><a href="halaman2.php">
    Halaman kedua</a></font><br>
    &nbsp;</p>
    </body>
    </html>

    work fine. However these two which are similar to the above:

    <?
    // daftar.php
    ?>
    <HTML><HEAD><TITLE>PENDAFTARAN ANGGOTA</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=windows-1252">
    <META content="MSHTML 6.00.2900.2668" name=GENERATOR></HEAD>
    <BODY text=#000000 vLink=#ff0000 bgColor=#ffffff>
    <DIV
    style="Z-INDEX: 22; LEFT: 17px; OVERFLOW: hidden; WIDTH: 696px; POSITION: absolute; TOP: 44px; HEIGHT: 449px"
    align=left>
    <FORM name=LayoutForm action="mail.php" method=post encType=text/plain>
    <DIV
    style="LEFT: 133px; OVERFLOW: hidden; WIDTH: 306px; POSITION: absolute; TOP: 29px; HEIGHT: 28px"
    align=left><INPUT style="WIDTH: 301px; HEIGHT: 23px" size=43 name="nama"> </DIV>
    <DIV
    style="Z-INDEX: 1; LEFT: 133px; OVERFLOW: hidden; WIDTH: 229px; POSITION: absolute; TOP: 64px; HEIGHT: 28px"
    align=left><INPUT style="WIDTH: 224px; HEIGHT: 23px" size=32 name="jabat"> </DIV>
    <DIV
    style="Z-INDEX: 2; LEFT: 133px; OVERFLOW: hidden; WIDTH: 306px; POSITION: absolute; TOP: 99px; HEIGHT: 28px"
    align=left><INPUT style="WIDTH: 301px; HEIGHT: 23px" size=43 name="usaha"> </DIV>
    <DIV
    style="Z-INDEX: 3; LEFT: 133px; OVERFLOW: hidden; WIDTH: 229px; POSITION: absolute; TOP: 135px; HEIGHT: 28px"
    align=left><INPUT style="WIDTH: 224px; HEIGHT: 23px" size=32 name="bidang"> </DIV>
    <DIV
    style="Z-INDEX: 4; LEFT: 133px; OVERFLOW: hidden; WIDTH: 299px; POSITION: absolute; TOP: 279px; HEIGHT: 28px"
    align=left><INPUT style="WIDTH: 294px; HEIGHT: 23px" size=42 name="email"> </DIV>
    <DIV
    style="Z-INDEX: 5; LEFT: 133px; OVERFLOW: hidden; WIDTH: 166px; POSITION: absolute; TOP: 316px; HEIGHT: 28px"
    align=left><INPUT style="WIDTH: 161px; HEIGHT: 23px" size=23 name="telpon"> </DIV>
    <DIV
    style="Z-INDEX: 6; LEFT: 21px; OVERFLOW: hidden; WIDTH: 104px; POSITION: absolute; TOP: 29px; HEIGHT: 23px"
    align=left><FONT style="FONT-SIZE: 10pt" face=Arial color=#000000><B>Nama
    Lengkap</B></FONT> </DIV>
    <DIV
    style="Z-INDEX: 7; LEFT: 65px; OVERFLOW: hidden; WIDTH: 60px; POSITION: absolute; TOP: 67px; HEIGHT: 23px"
    align=left><FONT style="FONT-SIZE: 10pt" face=Arial
    color=#000000><B>Jabatan</B></FONT> </DIV>
    <DIV
    style="Z-INDEX: 8; LEFT: 40px; OVERFLOW: hidden; WIDTH: 85px; POSITION: absolute; TOP: 102px; HEIGHT: 23px"
    align=left><FONT style="FONT-SIZE: 10pt" face=Arial
    color=#000000><B>Perusahaan</B></FONT> </DIV>
    <DIV
    style="Z-INDEX: 9; LEFT: 27px; OVERFLOW: hidden; WIDTH: 98px; POSITION: absolute; TOP: 139px; HEIGHT: 23px"
    align=left><FONT style="FONT-SIZE: 10pt" face=Arial color=#000000><B>Bidang
    Usaha</B></FONT> </DIV>
    <DIV
    style="Z-INDEX: 10; LEFT: 69px; OVERFLOW: hidden; WIDTH: 56px; POSITION: absolute; TOP: 174px; HEIGHT: 23px"
    align=left><FONT style="FONT-SIZE: 10pt" face=Arial
    color=#000000><B>Alamat</B></FONT> </DIV>
    <DIV
    style="Z-INDEX: 11; LEFT: 74px; OVERFLOW: hidden; WIDTH: 51px; POSITION: absolute; TOP: 282px; HEIGHT: 23px"
    align=left><FONT style="FONT-SIZE: 10pt" face=Arial
    color=#000000><B>E-mail</B></FONT> </DIV>
    <DIV
    style="Z-INDEX: 12; LEFT: 62px; OVERFLOW: hidden; WIDTH: 63px; POSITION: absolute; TOP: 317px; HEIGHT: 23px"
    align=left><FONT style="FONT-SIZE: 10pt" face=Arial
    color=#000000><B>Telepon</B></FONT> </DIV>
    <DIV
    style="Z-INDEX: 13; LEFT: 132px; OVERFLOW: hidden; WIDTH: 320px; POSITION: absolute; TOP: 171px; HEIGHT: 28px"
    align=left><INPUT style="WIDTH: 315px; HEIGHT: 23px" size=45 name="alamat1">
    </DIV>
    <DIV
    style="Z-INDEX: 14; LEFT: 132px; OVERFLOW: hidden; WIDTH: 320px; POSITION: absolute; TOP: 207px; HEIGHT: 28px"
    align=left><INPUT style="WIDTH: 315px; HEIGHT: 23px" size=45 name="alamat2">
    </DIV>
    <DIV
    style="Z-INDEX: 15; LEFT: 55px; OVERFLOW: hidden; WIDTH: 71px; POSITION: absolute; TOP: 246px; HEIGHT: 23px"
    align=left><FONT style="FONT-SIZE: 10pt" face=Arial color=#000000><B>Kode
    Pos</B></FONT> </DIV>
    <DIV
    style="Z-INDEX: 16; LEFT: 133px; OVERFLOW: hidden; WIDTH: 117px; POSITION: absolute; TOP: 244px; HEIGHT: 28px"
    align=left><INPUT style="WIDTH: 112px; HEIGHT: 23px" size=16 name="kode"> </DIV>
    <DIV
    style="Z-INDEX: 17; LEFT: 134px; OVERFLOW: hidden; WIDTH: 166px; POSITION: absolute; TOP: 352px; HEIGHT: 28px"
    align=left><INPUT style="WIDTH: 161px; HEIGHT: 23px" size=23 name="fax"> </DIV>
    <DIV
    style="Z-INDEX: 18; LEFT: 89px; OVERFLOW: hidden; WIDTH: 36px; POSITION: absolute; TOP: 354px; HEIGHT: 23px"
    align=left><FONT style="FONT-SIZE: 10pt" face=Arial
    color=#000000><B>Fax</B></FONT> </DIV>
    <DIV
    style="Z-INDEX: 19; LEFT: 133px; OVERFLOW: hidden; WIDTH: 65px; POSITION: absolute; TOP: 397px; HEIGHT: 30px"
    align=left><INPUT type=submit value=Kirim name="Register"> </DIV>
    <DIV
    style="Z-INDEX: 20; LEFT: 206px; OVERFLOW: hidden; WIDTH: 65px; POSITION: absolute; TOP: 396px; HEIGHT: 30px"
    align=left><INPUT type=reset value=Batal name="Cancel"> </DIV>
    <DIV
    style="Z-INDEX: 21; LEFT: 254px; OVERFLOW: hidden; WIDTH: 27px; POSITION: absolute; TOP: 8px; HEIGHT: 23px"
    align=left><FONT style="FONT-SIZE: 10pt" face=Arial
    color=#000000><B>Ibu</B></FONT> </DIV></FORM></DIV>
    <DIV
    style="Z-INDEX: 23; LEFT: 174px; OVERFLOW: hidden; WIDTH: 25px; POSITION: absolute; TOP: 51px; HEIGHT: 25px"
    align=left><INPUT type=radio CHECKED value=Bpk name="bi"> </DIV>
    <DIV
    style="Z-INDEX: 24; LEFT: 204px; OVERFLOW: hidden; WIDTH: 31px; POSITION: absolute; TOP: 52px; HEIGHT: 23px"
    align=left><FONT style="FONT-SIZE: 10pt" face=Arial
    color=#000000><B>Bpk</B></FONT> </DIV>
    <DIV
    style="Z-INDEX: 25; LEFT: 245px; OVERFLOW: hidden; WIDTH: 25px; POSITION: absolute; TOP: 51px; HEIGHT: 25px"
    align=left><INPUT type=radio value=Ibu name="bi"> </DIV>
    <DIV
    style="Z-INDEX: 26; LEFT: 2px; OVERFLOW: hidden; POSITION: absolute; TOP: 3px"
    align=left><IMG height=29 src="daftar_files/bv01319.gif" width=703> </DIV>
    <DIV
    style="Z-INDEX: 27; LEFT: 5px; OVERFLOW: hidden; POSITION: absolute; TOP: 485px"
    align=left><IMG height=11 src="daftar_files/bv01320.gif" width=702>
    </DIV></BODY></HTML>

    <?
    // mail.php
    ?>
    <html>
    <head>
    <title>Proses Pendaftaran Anggota</title>
    </head>
    <body>
    <?php
    $nama = $_POST['nama'];
    $jabat = $_POST['jabat'];
    $usaha = $_POST['usaha'];
    $bidang = $_POST['bidang'];
    $alamat1 = $_POST['alamat1'];
    $alamat2 = $_POST['alamat2'];
    $kode = $_POST['kode'];
    $email = $_POST['email'];
    $telpon = $_POST['telpon'];
    $fax = $_POST['fax'];
    ?>
    <p><font face="Arial">Sedang proses email <b><? echo $nama ?></b><br></font></p>
    <?php
    if ($nama == "" || $email == "") {
    echo "Harap isi nama dan e-mail";
    } else {
    $to = "faradhitam******.com";
    $subject = "Pendaftaran Anggota HRD Club";

    $body = "Nama Lengkap=".$nama."\r\n";
    $body .= "Jabatan=".$jabat."\r\n";
    $body .= "Perusahaan=".$usaha."\r\n";
    $body .= "Bidang Usaha=".$bidang."\r\n";
    $body .= "Alamat=".$alamat1."\r\n";
    $body .= $alamat2."\r\n";
    $body .= "Kode Pos=".$kode."\r\n";
    $body .= "E-mail=".$email."\r\n";
    $body .= "Telepon=".$telpon."\r\n";
    $body .= "Fax=".$fax."\r\n";
    $headers = "From: ".$email."\r\n";
    $smail = mail($to, $subject, $body, $headers);

    if ($smail) {
    echo "Pendaftaran berhasil !";
    } else {
    echo "Pendaftaran gagal !";
    }
    }
    ?>
    </body>
    </html>

    are not OK ?

    Message:
    Notice: Undefined index: nama in C:\Inetpub\wwwroot\COBA\mail.php on line 7
    Notice: Undefined index: jabat in C:\Inetpub\wwwroot\COBA\mail.php on line 8
    Notice: Undefined index: usaha in C:\Inetpub\wwwroot\COBA\mail.php on line 9
    Notice: Undefined index: bidang in C:\Inetpub\wwwroot\COBA\mail.php on line 10
    Notice: Undefined index: alamat1 in C:\Inetpub\wwwroot\COBA\mail.php on line 11
    Notice: Undefined index: alamat2 in C:\Inetpub\wwwroot\COBA\mail.php on line 12
    Notice: Undefined index: kode in C:\Inetpub\wwwroot\COBA\mail.php on line 13
    Notice: Undefined index: email in C:\Inetpub\wwwroot\COBA\mail.php on line 14
    Notice: Undefined index: telpon in C:\Inetpub\wwwroot\COBA\mail.php on line 15
    Notice: Undefined index: fax in C:\Inetpub\wwwroot\COBA\mail.php on line 16
  • George
    Customer Support

    • May 2005
    • 76

    #2
    The above tells me nothing. First of all, who are you?
    Open up a support ticket with:
    1) Your Full name
    2) Your Domain Name
    3) Username
    4) Password.
    5) Explain the problem, do not give us just code to look at.
    6) Include any error messages you might be receiving.

    George
    George Fountakos
    VodaHost
    www.VodaHost.com
    Your Website People
    +1-302-283-3777 USA / Canada / International
    (0044) 020 8816 8319 / United Kingdom

    Comment

    Working...
    X