PHP Login System with Admin Features

This forum was created to talk about the PHP Login System with admin features created by jpmaster77 on evolt's website


    weird issue

    Share
    avatar
    intothefantasy

    Number of posts : 37
    Registration date : 2009-04-11

    weird issue

    Post  intothefantasy on Sat May 23, 2009 1:41 am

    well again i hope some php gurus here can sort me out with this simple problem...it seems simple...but yet is hard

    Code:
    <?php

    include("controls.php");

      if(isset($_POST['submit']))
      {   
      $name = $_POST['name'];
      $ic = $_POST['ic'];
      $sex = $_POST['sex'];
      $race = $_POST['race'];
      $rel = $_POST['rel'];
      $educationstatus = $_POST['educationstatus'];
      $occupation = $_POST['occupation'];
      $income = $_POST['income'];
     
     
     
     
      $result = mysql_query("INSERT INTO client VALUES ('0', '$name', '$ic', '$sex', '$race', '$educationstatus', '$occupation', '$income', '$rel')",$connect);
        if($result){
        echo "Success add client";
        }
        else{
        echo "sux";
        }               
                               
      }
    ?>


       
     <font size = "2" color="#000000" face="verdana"><b>Profile of client</b></font><br /><br /> 
    <form method="post" action="<?php echo $_SERVER[PHP_SELF] ?>">             
    Name: <input name="name" size="40" maxlength="255" value="">
    IC: <input name="ic" size="30" maxlength="255" value=""><br /><br />
    Sex: <input type="radio" name="sex" value="Male"> Male <input type="radio" name="sex" value="Female"> Female <br /><br />
    Race: <input type="radio" name="race" value="Islam"> Malay  <input type="radio" name="race"  value="Buddhist/Taoist"> Chinese <input type="radio" name="race" value="Indian"> Indian , Others: <input name="srace" size="30" maxlength="255">(please specify)<br /><br />
    Religion: Race: <input type="radio" name="rel" value="Malay"> Malay  <input type="radio" name="rel"  value="Chinese"> Chinese <input type="radio" name="rel" value="Indian"> Indian , Others: <input name="rel" size="30" maxlength="255">(please specify)<br /><br />
    Education Status: <input type="radio" name="educationstatus" value="No Education"> No Education <input type="radio" name="educationstatus" value="Primary"> Primary <input type="radio" name="educationstatus" value="Lower Secondary"> Lower Secondary <input type="radio" name="educationstatus" value="Upper Secondary"> Upper Secondary <input type="radio" name="educationstatus" value="STPM"> STPM <input type="radio" name="educationstatus" value="College"> College <input type="radio" name="educationstatus" value="University"> University <br /><br />
    Occupation :
    <select name="occupation">
    <option value="">4. Factory/Manual Worker</option>
    <option value="Operator">|-->4a. Operator</option>
    <option value="Supervisor">|-->4b. Supervisor</option>
    <option value="Carpenter">|-->4c. Carpenter</option>
    <option value="Technician">|-->4d. Technician</option>
    <option value="Mechanic">|-->4e. Mechanic</option>
    <option value=""></option>
    <option value="">6. Executive</option>
    <option value="Teacher">|-->6a. Teacher (private)</option>
    <option value="Nurse">|-->6b. Nurse (private)</option>
    <option value=""></option>
    <option value="">7. Sales & Service worker</option>
    <option value="Sales Executive">|-->7a. Sales executive</option>
    <option value="Promoter">|-->7b. Promoter</option>
    <option value="House keeper">|-->7c. House keeper</option>
    <option value="Cleaner">|-->7d. Cleaner</option>
    <option value="Driver">|-->7e. Driver</option>
    <option value="Babysitter">|-->7f. Babysitter</option>
    <option value="Cashier">|-->7g. Cashier</option>
    <option value="Saloon">|-->7h. Saloon</option>
    <option value=""></option>
    <option value="">8. Professional/Management</option>
    <option value="Doctor">|-->8a. Doctor</option>
    <option value="Dentist">|-->8b. Dentist</option>
    <option value="Accountant">|-->8c. Accountant</option>
    <option value="Engineer">|-->8d. Engineer</option>
    <option value="Director/CEO/Manager">|-->8e. Director/CEO/Manager</option>
    <option value="Lecturer">|-->8f. Lecturer</option>
    <option value=""></option>
    <option value="">9. Government</option>
    <option value="General worker">|-->9a. General worker (cleaner, clerk, driver)</option>
    <option value="Executive">|-->9b. Executive (nurse, medical assistant, teacher, police, fire brigade)</option>
    <option value="Professional">|-->9c. Professional (director)</option>
    </select><br /><br />
    Income: <input type="radio" name="income" value="Nill"> Nill <input type="radio" name="income" value="RM<500"> RM<500 <input type="radio" name="income" value="RM500-RM1500"> RM500-RM1500 <input type="radio" name="income" value="RM>1500"> RM>1500<br /><br />



    <input type="submit" name="submit" value="Add Client">
         
          </form>
                   

    ok from this code above you can see that i am trying to add some client information....every thing goes well till i have problem with religion part where i see inside mysql database table dont have any values of religion added in through the form and yet it has no error....strangly i the html code is as same as other radio box...like race..and other field is ok..except the damn religion field cant get any value....

    here is my sql table

    Code:
    CREATE TABLE `client` (
      `clientid` int(11) NOT NULL auto_increment,
      `name` varchar(100) default NULL,
      `IC` int(30) default NULL,
      `sex` varchar(10) default NULL,
      `race` varchar(30) default NULL,
      `educationstatus` varchar(500) default NULL,
      `occupation` varchar(50) default NULL,
      `income` varchar(50) default NULL,
      `religion` varchar(50) default NULL,
      PRIMARY KEY  (`clientid`)
    ) AUTO_INCREMENT=1 ;
    avatar
    Linchpin311

    Number of posts : 220
    Age : 32
    Localisation : Long Island
    Registration date : 2007-05-14

    Re: weird issue

    Post  Linchpin311 on Sat May 23, 2009 8:02 pm

    first off i am guessing you are doing your error reporting in session.php cause i dont see anything to do with errors here.

    second i am seeing some inconsistancy's in your forms HTML. i would start there and just double check that everything matches up to what it is suppose to be. I am willing to bet your problem is somewhere in there. let me know if you find your but there.


    _________________
    in the end, the universe tends to unfold as it should...

    Also note that it is your responsibility to die() if necessary.

      Current date/time is Mon Dec 11, 2017 7:00 pm