joeyliew7

I am building a web for ordering stock for a small company.
I wanted to add data into a table for user to view before confirm the order.
Tried to use excel but can only display data and not add data on the website.
I'm currently using Dreamweaver to develop this website.
How to add a data then user click next to go next data and at the same time the first data will be shown in a table on the same page?
This process will be repeated until user decided to stop.
Any help will be highly appreciate.

joeyliew7

thank you all for the helps. appreciate it..

joeyliew7

@Glider Pilot: yes..different imahe appear when selection is make on the drop down list
@diafol: sorry for the unclear description...

joeyliew7

How to show image for the drop down list? have tried a few alternative but dont work. Thanks

 <tr>
                                <td class="label"><label for="kelas">Kelas:</label></td>
                                <td class="field">

<select id="kelas" name="kelas"  >
<option value="Pilih kelas" selected="selected"></option>
<option value="1 Tekal" >1 Tekal</option>
<option value="1 Tekad" >1 Tekad</option>
<option value="1 Tekun" >1 Tekun</option>
<option value="1 Tabah" >1 Tabah</option>
<option value="2 Tekal" >2 Tekal</option>
<option value="2 Tekad" >2 Tekad</option>
<option value="2 Tekun" >2 Tekun</option>
<option value="2 Tabah" >2 Tabah</option>
<option value="3 Tekal" >3 Tekal</option>
<option value="3 Tekad" >3 Tekad</option>
<option value="3 Tekun" >3 Tekun</option>
<option value="3 Tabah" >3 Tabah</option>
<option value="4 Tekal" >4 Tekal</option>
<option value="4 Tekad" >4 Tekad</option>
<option value="4 Tekun" >4 Tekun</option>
<option value="4 Tabah" >4 Tabah</option>
<option value="5 Tekal" >5 Tekal</option>
<option value="5 Tekad" >5 Tekad</option>
<option value="5 Tekun" >5 Tekun</option>
<option value="5 Tabah" >5 Tabah</option>
<option value="6 Tekal" >6 Tekal</option>
<option value="6 Tekad" >6 Tekad</option>
<option value="6 Tekun" >6 Tekun</option>
<option value="6 Tabah" >6 Tabah</option>
</select>
                            </tr>

`

joeyliew7

photo
how can i build a calendar like this? Year View and can choose a day to view the event? i just need a simplest version. any help will be appreciate. thanks in advance.

joeyliew7

Thank u JorgeM for the help.. =)

joeyliew7

thank u drjohn. it works..

joeyliew7

this is the function

<SCRIPT TYPE="Text/JavaScript">
<!-- Beginning of JavaScript -

function changecolor(code) {

document.bgColor=code
}
// - End of JavaScript - -->
</SCRIPT>

this is the code

<a href="" onmouseover="document.bgColor='turquoise'">C</a>
<a href="" onmouseover="document.bgColor='pink'">h</a>
<a href="" onmouseover="document.bgColor='blue'">o</a>
<a href="" onmouseover="document.bgColor='red'">o</a>
<a href="" onmouseover="document.bgColor='yellow'">s</a>
<a href="" onmouseover="document.bgColor='green'">e</a>
<a href="" onmouseover="document.bgColor='white'">your</a> 
<a href="" onmouseover="document.bgColor='greem'">o</a>
<a href="" onmouseover="document.bgColor='seagreen'">w</a>
<a href="" onmouseover="document.bgColor='magenta'">n</a>
<a href="" onmouseover="document.bgColor='fusia'">b</a>
<a href="" onmouseover="document.bgColor='purple'">a</a>
<a href="" onmouseover="document.bgColor='navy'">c</a>
<a href="" onmouseover="document.bgColor='royalblue'">k</a>
<a href="" onmouseover="document.bgColor='Skyblue'">g</a>
<a href="" onmouseover="document.bgColor='brown'">r</a>
<a href="" onmouseover="document.bgColor='almond'">o</a>
<a href="" onmouseover="document.bgColor='coral'">u</a>
<a href="" onmouseover="document.bgColor='olivedrab'">n</a>
<a href="" onmouseover="document.bgColor='teal'">d</a>
<a href="" onmouseover="document.bgColor='black'">color!</a>

i want to change background color of the page. used this codes but it dont work. i dont know where go wrong. pls help.

joeyliew7

this is the html

<cat>
         <ul>
            <li><span><a href="#">Sekolah</a></span>
            <ul>
                    <li><a href="perutusan.html">Perutusan Guru Besar</a></li>
                    <li><a href="sejarah.html">Sejarah</a></li>
                    <li><a href="etos.html">Etos</a></li>
                    <li><a href="#">Iklim Sekolah</a>
                        <ul>
                            <li><a href="falsafah.html">Falsafah Misi Visi</a></li>
                            <li><a href="logo&bendera.html">Logo & Bendera</a></li>
                            <li><a href="piagam.html">Piagam</a></li>
                            <li><a href="lagu.html">Lagu</a></li>
                        </ul>
                      </li>  
                    <li><a href="peraturan.html">Peraturan</a></li>
                    <li><a href="pelanevakuasi.html">Pelan Evakuasi</a></li>
                    <li><a href="pelansekolah.html">Pelan Sekolah</a></li>

             </ul>
             </li>
            <li><span><a href="#">Pengurusan</a></span></li>
            <li><span><a href="#">PIBG</a></span></li>
            <li><span><a href="#">BKGS</a></span></li>
            <li><span><a href="#">Pengumuman</a></span></li>
            <li><span><a href="#">Murid</a></span></li>
            <li><span><a href="#">Pencapaian</a></span></li>
            <li><span><a href="#">Kurikulum</a></span></li>
            <li><span><a href="#">Ko-kurikulum</a></span></li>
            <li><span><a href="#">e-SEKOLAH</a></span></li>
            <li><span><a href="#">Rakan Sekolah</a></span></li>
            <li class="last"><span><a href="#">Calendar</a></span></li>
         </ul>
         </cat>

this is the css

cat {
    padding-bottom:37px;
}
 cat {
    margin: 100px auto; 
    text-align: center;
}

cat ul ul {
    display: none;
}

    cat ul li:hover > ul {
        display: block;
    }

cat ul {
    background: #efefef; 
    background: linear-gradient(top, #efefef 0%, #bbbbbb 100%);  
    background: -moz-linear-gradient(top, #efefef 0%, #bbbbbb 100%); 
    background: -webkit-linear-gradient(top, #efefef 0%,#bbbbbb 100%); 
    box-shadow: 0px 0px 9px rgba(0,0,0,0.15);
    padding: 0 20px;
    border-radius: 10px;  
    list-style: none;
    position: relative;
    display: inline-table;
}
    cat ul:after {
        content: ""; clear: both; display: block;
    }

    cat ul li {
        float: left;
    }
        cat ul li:hover {
            background: #4b545f;
            background: linear-gradient(top, #4f5964 0%, #5f6975 40%);
            background: -moz-linear-gradient(top, #4f5964 0%, #5f6975 40%);
            background: -webkit-linear-gradient(top, #4f5964 0%,#5f6975 40%);
        }
            cat ul li:hover a {
                color: #fff;
            }

        cat ul li a {
            display: block; padding: 25px 40px;
            color: #757575; text-decoration: none;
        }

    cat ul ul {
        background: #5f6975; border-radius: 0px; padding: 0;
        position: absolute; top: 100%;
    }
        cat ul li {
            float: none; 
            border-top: 1px solid #6b727c;
            border-bottom: 1px solid #575f6a; position: relative;
        }
            cat ul ul li a {
                padding: 15px 40px;
                color: #fff;
            } ...

joeyliew7

boolean in line 22. what must be change to the code to make it work?

joeyliew7

i have this problem for checking for duplicate username in database. this error appear whether the username is duplicate and does not duplicate. Please help.

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean in

<?php
include_once 'db/db.php';
include_once 'admin-class.php';
$admin = new itg_admin();

if(isset($_POST['Submit']))
{
    $con = mysql_connect("localhost","username","password","tablename");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  } 
    //---Encrypt ---//
    $confirmcode=md5(uniqid(rand()));
    $password=md5($_POST['password']);

    //---Insert value to table---//
    mysql_select_db( 'tablename' );

    $getduplicates = mysql_query("SELECT * FROM users WHERE username =$_POST[username]");
    $duplicates = mysql_num_rows($getduplicates);

 if($duplicates){
     echo "Username has been used.Please choose another username";
     ?>
        <script type="text/javascript">
        alert("Username has been used.Please choose another username");
        setTimeout('location.replace("registration.php")', 500);
    </script>

<?php
 }
 else {
     $sql = "INSERT INTO users(username,password,email,birthday,confirmcode)
    VALUES ('$_POST[username]','$password','$_POST[email]','$_POST[birthday]','$confirmcode')";
 }

    if(mysql_query($sql)){
     //----Send Comfirm Email----//
    $to = $_POST['email'];
    $subject = "Action Required to Activate Membership for Charity Techno Parts";
    $header = "From : Joey <joeyliew7@hotmail.com>";
    $message = "Thank you for your registering with us. \r\n" . "Click on the confirmation code link below to active            your account. \r\n" . 
                "http://stuweb.cms.gre.ac.uk/~lh026/webstore/confirmreg.php?confirmcode=$confirmcode" ;

    $sentmail = mail($to,$subject,$message,$header);
 }
 else {
     die('Error: ' . mysql_error());
 }

    if($sentmail)
    {
        ?>
        <script type="text/javascript">
        alert("Email is sent. You will be directeed to homepage");
        setTimeout('location.replace("index.php")', 500);
    </script>

<?php

    }
    else{
         die('Error: ' . mysql_error());
    }
}
mysql_close($con);
?>

joeyliew7

i have try to look up for error but just couldnt find. Error of undefined index keep appearing. what must i change?Please help...

Notice: Undefined index: photo in /home/lh026/public_html/webstore/getimageform.php on line 7

Notice: Undefined index: name in /home/lh026/public_html/webstore/getimageform.php on line 10

Notice: Undefined index: detail in /home/lh026/public_html/webstore/getimageform.php on line 11

Notice: Undefined index: photo in /home/lh026/public_html/webstore/getimageform.php on line 12

Notice: Undefined index: photo in /home/lh026/public_html/webstore/getimageform.php on line 22
Sorry, there was a problem uploading your file.

joeyliew7

<?php
include_once 'db/db.php';
include_once 'admin-class.php';

//This is the directory where images will be saved
$target = 'images/upload/';
$target = $target . basename( $_FILES['photo']['name']);

//This gets all the other information from the form
$name=$_POST['name'];
$detail=$_POST['detail'];
$pic=($_FILES['photo']['name']);

// Connects to your Database
mysql_connect("localhost", "username", "password") or die(mysql_error()) ;
mysql_select_db("mdb_lh026") or die(mysql_error()) ;

//Writes the information to the database
mysql_query("INSERT INTO products (productname,detail,image) VALUES ('$name', '$detail', '$pic')") ;

//Writes the photo to the server
if(move_uploaded_file($_FILES['photo']['tmp_name'], $target))
{

//Tells you if its all ok
echo "The file ". basename( $_FILES['photo']['name']). " has been uploaded, and your information has been added to the directory";
}
else {

//Gives and error if its not
echo "Sorry, there was a problem uploading your file.";
}

?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Web Store Theme - Contact</title>
<meta name="keywords" content="web store, contact page, form, free templates, website templates, CSS, HTML" />
<meta name="description" content="Web Store Theme, Contact Form, free CSS template provided by templatemo.com" />
<link href="css/templatemo_style.css" rel="stylesheet" type="text/css" />

<link rel="stylesheet" type="text/css" href="css/ddsmoothmenu.css" />

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/ddsmoothmenu.js">

/***********************************************
* Smooth Navigational Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>

<script type="text/javascript">

ddsmoothmenu.init({
    mainmenuid: "templatemo_menu", //menu DIV id
    orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
    classname: 'ddsmoothmenu', //class added to menu's outer DIV
    //customtheme: ["#1c5a80", "#18374a"],
    contentsource: "markup" //"markup" ...