Naar de inhoud

Ramen

Een kijk op....
seniorennet.beseniorennet.be

Test mysql-connectie :: java

Java : project Stock



Test de mysql-connectie

Rechtermuisklik "src" -package in project "Stock"
- klik new
-selecteer class
- vul de naam in van de class : "testconnection"
-vink public class void main
- laat de rest zoals aangegeven en klik "Finish"
-copieer de onderstaande code en paste deze over de door eclipse gegenereerde code.
-File > save

-klik in het pakage "Stock" met de rechtermuisknop testconnection.java aan [het zopas aangemaakte bestand] en selecteer "run as"
-gezien we geen swt-import gedaan hebben selecteren we verder : run as > "java project"

package src;

import java.sql.*;

Java-code voor testconnection:



public class testconnection {

public static void main(String[] args) {
try {
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection ("jdbc:mysql://localhost/test", "usernaam", "userpaswoord");
Statement statement = conn.createStatement();
statement.executeUpdate("CREATE TABLE adressen (id int(11) NOT NULL auto_increment,naam char(50) NOT NULL,straat char(50) NOT NULL,postnr char(4) NOT NULL,gemeente char(30) NOT NULL,PRIMARY KEY (id))");
statement.executeUpdate("INSERT INTO adressen VALUES (1, 'Naam', 'Straat en nummer', 'code', 'gemeente')");
ResultSet rs = statement.executeQuery("select * from adressen");
while (rs.next()) {
System.out.println("Adres test :");
System.out.println("ID: "+rs.getInt("id"));
System.out.println("Naam : "+rs.getString("naam"));
System.out.println("Straat : "+rs.getString("straat"));
System.out.println("Gemeente : "+rs.getString("postnr") + " " +rs.getString("gemeente"));
}
statement.executeUpdate("drop table adressen");
//wanneer je de tabel niet wil deleten na de test moet je bovenstaand statement wissen.
} catch (Exception exc) {
exc.printStackTrace();
}
}
}

Resultaat::



Adres test :

ID: 1
Naam : Naam
Straat : Straat en nummer'
Gemeente : code gemeente

Indien je hier geen gegevens krijgt is de mysql-connectie niet in orde.
Vergeet niet dat om met mysql te werken je de gratis mysqlserver moet downloaden en installeren.
Tevens moet deze server draaien [gestart zijn]

Mysql database gegevens::




-- phpMyAdmin SQL Dump
-- version 2.6.1-pl3
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generatie Tijd: 28 Jun 2007 om 13:19
-- Server versie: 5.0.24
-- PHP Versie: 5.0.3
--
-- Database: `test`
--

-- --------------------------------------------------------

--
-- Tabel structuur voor tabel `adressen`
--

DROP TABLE IF EXISTS adressen;
CREATE TABLE adressen (
id int(11) NOT NULL auto_increment,
naam char(50) NOT NULL,
straat char(50) NOT NULL,
postnr char(4) NOT NULL,
gemeente char(30) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Gegevens worden uitgevoerd voor tabel `adressen`
--

INSERT INTO adressen VALUES (1, 'Naam', 'Straat en nummer', 'code', 'gemeente');
 

Geschreven door de makers om 00:00 Reageer op dit bericht
Reageer op dit bericht

Reageer op dit bericht

Een titel of je eigen website toevoegen

Java :: eclipse :: check of internal frame bestaat

Eclipse :: java :: check of een internal frame zichtbaar is, enz...
Eclipse :: java :: check if an internal frame exists : title, name, visibility
 public void checkandcreateFrame(String naam){

       

        boolean bool;bool = false;
       
        JInternalFrame[] frames = desktop.getAllFrames();
        if (frames.length > 0){
            for (int i=0; i<frames.length; i++) {
                    if (frames[i].getTitle() == naam){bool = true;}
                    }
                    //of frames[i].getName()
                    //je moet dan wel bij het initieren een naam geven :: frame.setName("klantenvenster");
                    // kijken of een internal frame zichtbaar is::
                    //boolean isVisible = frames[i].isVisible();

                    }
        if((frames.length == 0) || (bool == false)){
                        createFrameKlanten();

                    }
        }
       
        //Maak een nieuw internal frame :.
        protected void createFrame() {

                Klanten frame = new Klanten();
                frame.setVisible(true);
                desktop.add(frame);
                try {
                    frame.setSelected(true);
                    //frame.setName("klantenvenster"); Indien je wil controleren op de framenaam
                } catch (java.beans.PropertyVetoException e) {}
        }

 

 

Geschreven door de makers om 00:00 Reageer op dit bericht

Java :: eclipse :: JTabel addRow

Eclipse :: java ::
De tabel opnieuw met gegevens vullen na vewijden van de rijen

Fill JTable when the rows of a table were deleted
                             int x;x=0;
                            while (rs.next()) {
                                // hier dient eerst een rij aan de tabel toegevoegd worden bvb:
                                // deze methode kan je gebruiken om elementen in een rij aan te passen
                                myModel.addRow(columnNames);
                                record[x][0]=String.valueOf(rs.getInt("id"));
                                myModel.setValueAt(record[x][0], x, 0);
                                record[x][1]=rs.getString("achternaam");
                                myModel.setValueAt(record[x][1], x, 1);
                                record[x][2]=rs.getString("voornaam");
                                myModel.setValueAt(record[x][2], x, 2);                           
                                record[x][3]=rs.getString("straat");
                                myModel.setValueAt(record[x][3], x, 3);
                                record[x][4]=rs.getString("huisnr");
                                myModel.setValueAt(record[x][4], x, 4);                           
                                record[x][5]=rs.getString("postnr");
                                myModel.setValueAt(record[x][5], x, 5);
                                record[x][6]=rs.getString("gemeente");
                                myModel.setValueAt(record[x][6], x, 6);       
                                x++;
                            }
of
                            int x;x=0;
                            while (rs.next()) {
                                record[x][0]=String.valueOf(rs.getInt("id"));
                                record[x][1]=rs.getString("achternaam");
                                record[x][2]=rs.getString("voornaam");                      
                                record[x][3]=rs.getString("straat");
                                record[x][4]=rs.getString("huisnr");                     
                                record[x][5]=rs.getString("postnr");
                                record[x][6]=rs.getString("gemeente"); 
                                myModel.addRow(record[x]);
                                x++;
                            }

Een enkelvoudig aray "record" zou hier beter passen maar dit vb-object werd gebruikt om de basistabel aan te maken met de volgende vorm : [) myModel.addRow(record[x][y]]  dient dan niet gebruikt te worden(]

Object[][] record= new Object[1000][7];
DefaultTableModel myModel = new DefaultTableModel(record,columnNames )


Geschreven door de makers om 00:00 Reageer op dit bericht

Java :: eclipse :: tabel leegmaken [clear JTable]

Eclipse :: JAVA :: tabel   leegmaken   [clear JTable]
pw   
   int y = myModel.getRowCount();
        for(int a = 0; a < y; a++)

        {
            myModel.removeRow(0);
                // deze waarde moet nul zijn anders werkt de code niet
                //this value has to be 0 not a !
        }

       //nadien tabel terug opvullen met bvb myModel.addRow(record[x]);

Rijen werwijderen :: Remove rows
bvb a = 0 > removeRow(0) > rij 1 in de tabel wordt nu 0 en blijft dus staan bij a=1 removeRow(1) enz...

Geschreven door de makers om 00:00 Reageer op dit bericht

Java :: eclipse :: omzetting nr string

Eclipse :: java  :: Omzetten (conversie) naar string van :

boolean v,byte v,short v,int v,long v,float v,double v,char v :

String.valueOf(v);

of

Boolean.toString(v);
Short.toString(v);
Integer.toString(v);
Long.toString(v);
Float.toString(v);
Double.toString(v);
Character.toString(c);
Geschreven door de makers om 00:00 Reageer op dit bericht

Java :: eclipse :: arrays

Eclipse :: Java :: arrays

pw

public class ar01 {


    /**
     * @param args
     */
    public static void main(String[] args) {
           int[] teller;
           String[] naam;
           int[][] matrix; //array van arrays
           
           teller = new int[5];
           naam = new String[100];
           matrix = new int[5][10];
           
           teller[1] = 2;
           naam[51] = "Luc";
           matrix[0][0] = 452;
           matrix[0][1] = 453;
           
           System.out.println("Teller :"+teller[1]);
           System.out.println("Naam :"+naam[51]);
           System.out.println("Matrix :"+matrix[0][0]+"|"+matrix[0][1]);
           
           
           String[] boeken = {"liefdes romans", "dedectieve romans", "fictie"};
           System.out.println("Boeken: " + boeken[2]);

           String[] maanden = {"Jan", "Feb", "Maa", "Apr", "Mei", "Jun","Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};

           for(int i = 0; i < maanden.length; i++ ) {
              System.out.println("Maand: " + maanden[i]);
               }
    }
}

Run als : java application of SWT application

Resultaat :

Teller :2
Naam :Luc
Matrix :452|453
Boeken: fictie
Maand: Jan
Maand: Feb
Maand: Mar
Maand: Apr
Maand: May
Maand: Jun
Maand: July
Maand: Aug
Maand: Sep
Maand: Oct
Maand: Nov
Maand: Dec


Geschreven door de makers om 00:00 Reageer op dit bericht

Linux en XP op medion MD 8386

Linux [Windows-XP] installatie op MEDION MD 8386
Medion Titanium MD8386
3.2Ghz, 2MB l2 cache , 800 MHz FSB
1024 MB Geheugen
Analoog stereo - TV & FM
Schijven : 2 * 160 GB
SLACKWARE 10.1 EN LAGER MISLUKT
hda en hdb worden gekozen maar zijn dvd - schijven
De andere schijven worden gedetecteerd als "alleen lezen".
ASP 9 [RUSSISCHE REDHAT] MISLUKT Geen schijven gevonden
REDHAT MISLUKT Geen schijven gevonden
SUSE 9.2 MISLUKT Loopt vast
SUSE 10.1 [ALFA 2] OK
Geïnstalleerd :
-KD3
-Gnome
Alles werkt op beide installatie's behalve de klank van programma's
De geluiden die het systeem gebruikt werken wel.

[Ook de tv-kaart werkt maar zonder klank.]

Belangrijk :

Zolang de schijven niet volledig leeg gemaakt zijn , zal ook de SUSE 10.1 - installatie niet lukken.

Je dient vooraf in windows XP de 2de-schijf volledig vrij te maken dwz. alle partities verwijderen zodat windows in de visualisering "Vrije ruimte" - vermeld.

Hoe :

open in windows vervolgens :
-configuratiescherm
-systeembeheer
-computerbeheer
kies hier in het menu -schijfbeheer
je krijgt een visuele voorstelling van de partities op de schijven:
dubbelklik in een partitie: dit geeft je een snelmenu
- kies verwijderen partitie, doe dit tot alle partities van de 2de schijf verwijderd zijn.

 

Geschreven door de makers om 03:38 1 reactie Reageer op dit bericht

Salpeterzuurinstallatie 1










Eén van de salpeterzuurinstallaties van [ASED GECHEM] KEMIRA , die in de jaren 1990 volledig werd ontmanteld en opnieuw werd geinstalleerd in Tertre.
Vooraan zie je de CO2 - gasbol :: bijproduct van de Linde-installatie.[gefractioneerde destillatie van vloeibare lucht].Dit CO2 - gas gold als het zuiverste van Europa.
Geschreven door de makers om 00:46 Reageer op dit bericht

Kerstlijsten php-code Internet

Kerstlijst geschenkwensen.

Werking :

Ieder deelnemer krijgt één waardevol geschenk van +- een bepaald overeengekomen bedrag.
Alle namen van de deelnemers worden op een papiertje geschreven en in een hoed gestopt.
Elke deelnemer kiest uit de hoed één naam (indien je eigen naam : papier terug in de hoed en ander papiertje trekken).
De naam die getrokken wordt, wordt niet meegedeeld aan de anderen. Voor deze deelnemer
dien jij dan een geschenk te kiezen uit een lijst voorstellen die deze
persoon heeft ingegeven via het internet (volgens het moment van ingeving) met onderstaande
php-programma.


Nodig :
4 bestanden.
1 map met animatiefoto's : in het programma css genoemd
1 mysql - database : hier : tribuun_agbook1

aan te passen :
gebruikersnaam , wachtwoord (database)
het gebruikte inlogwachtwoord hier is : "driekoningen" en wordt ingegeven bij de eerste gebruikersnaam in de tabel "lijst" van de database tribuun_adbook1

Hier de code:

1: index.php
------------
<html>
<head>
<meta http-equiv="Content-Language" content="nl-be">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Kerst familie .....</title>
<meta http-equiv="Content-Language" content="nl-be">
</head>


<body link="#808000" vlink="#808000" alink="#999966">

<p align="center"> </p>
<div align="center">
<table border="0" width="80%">
 <tr>
 <td>
 <p align="left">
 <font color="#000000">
 <a style="color: black; font-family: verdana; font-size: 8pt; text-decoration: none" href="login.php">
 <img height="87" alt="Inkom" src="css/carol.gif" width="130" border="3"></a></font><font face="Arial" size="6"><b> 
 <font color="#999966"><a Href=login.php>Kom binnen</a></font></b></p>
 <p align="left"><img height="40" src="css/line1.gif" width="733" border="0"></td>
 </tr>
 <tr>
 <td>
  </td>
 </tr>
 <tr>
 <td>
 <blockquote>
  <blockquote>
   <blockquote>
    <address>
     De inlognaam vervalt na 10 minuten. » Opnieuw inloggen</address>
    <address>
     Aanvullen van de lijst kan je met één per één - (nadien
     opnieuw inloggen) of max 5 voorstellen gelijkertijd.</address>
    <address>
     Inlognaam : selecteer je "eigen" naam uit de combobox</address>
   </blockquote>
  </blockquote>
 </blockquote>
 </td>
 </tr>
</table>
</div>
<p align="right"><font face="Arial Narrow" size="1">Created by : piet willems</font></p>

</body>
</html>

2: login.php
-----------
<?php
Global $kerstkonijn;
$con= mysql_connect(localhost,gebruikersnaam,gebruikerspass) or die ("fout");
$db = mysql_select_db(tribuun_agbook1,$con) or die ("fout");

$time=time();
 
if ($_POST[user]&& $_POST[pass])
 {
 

 $pass = md5($_POST[pass]);
 $user_data = mysql_fetch_array(mysql_query("select id,mode from lijst where mode='$pass'"));
 if ($user_data[id] >0)
  {
  setcookie ("user", $_POST[user],$time + 600);
  setcookie ("pass", $user_data[mode],$time + 600);   
  header("Location: kerstform.php?kerstkonijn=$_POST[user]"); 
  $kerstkonijn = $_POST[user];

  }
 else 
  {
  $login_error= true;  
  }
 }
 
 
if ($login_error == true)
{
?>
 <div align="center">
  <table width="80%" cellspacing="9" cellpadding="0" bordercolor="#A6A393" bordercolorlight="#A6A393" bordercolordark="#A6A393">
  <tr>
   <td style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium; border-bottom-style:solid; border-bottom-width:1px" colspan="5">
    <p align="left"> </td>
   <td style="border-style:none; border-width:medium; "> </td>
   <td style="border-style:none; border-width:medium; " width="76" valign="top">
    </td>
  </tr>
  <tr>
   <td width="69%" height="10" align="right" valign="top" colspan="4">
   <dl>
   <div align="right">
   <dt><b>
   <font size="4" face="Arial" color="#828268">
   Vrolijk   </font></b></dt>
   </div>
   <div align="right">
   <dt><b>
   <font size="4" face="Arial" color="#828268">
   Kerstfeest  
   </font></b></dt>
   </div>
   </dl>
   </td>
   <td style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1px; border-top-style: none; border-top-width: medium; " colspan="2" height="20" valign="bottom" width="15%" rowspan="2">
   <p align="right"><b>
   <font face="Arial" size="2" color="#000080">TRIBUUN </font><font face="Arial" size="2" color="#993300">  
   </font></b></td>
   <td style="border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium; " height="20" width="76" align="center" rowspan="2">
   <a style="color: black; font-family: verdana; font-size: 8pt; text-decoration: none">
   <img height="75" alt="Kerstmiswensen" src="css/wishes.gif" width="110" border="2"></a></td>
  </tr>
  <tr>
   <td width="73%" height="10" align="left" valign="top" colspan="4">
   <address align="left"><font size="2" face="Arial">De gebruikersnaam met dit wachtwoord is
   niet geregistreerd.</font></address>
   <address align="left"><font face="Arial" size="2">De inlogprocedure
    wordt hier afgesloten.</font></address>
   </td>
  </tr>
  <tr>
   <td style="border-style:none; border-width:medium; " width="10%" align="left">
    </td>
   <td width="25%">
    </td>
   <td style="border-style:none; border-width:medium; " width="17%">
   <p align="center">
    </td>
   <td style="border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: solid; border-bottom-width: 1px" width="21%">
   <div align="right">
    <font face="Arial" size="2"><a href="index.php">Inloggen</a></font>
   </div>
   </td>
   <td style="border-left-style:none; border-left-width:medium; border-right-style:solid; border-right-width:1px; border-top-style:solid; border-top-width:1px; border-bottom-style:solid; border-bottom-width:1px" width="6%" bgcolor="#F7F7F5"> </td>
   <td style="border-style: solid; border-width: 1px; " bgcolor="#F7F7F5" width="3%"> </td>
   <td style="border-left-style:solid; border-left-width:1px; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1px; border-bottom-style:solid; border-bottom-width:1px" bgcolor="#F7F7F5" width="75"> </td>
  </tr>
  <tr>
   <td style="border-style:none; border-width:medium; " width="10%" height="21"> </td>
   <td style="border-style:none; border-width:medium; " width="25%" height="21">
   <font size="2" face="Arial"> </font></td>
   <td style="border-style:none; border-width:medium; " width="17%" height="21"> </td>
   <td style="border-left: medium none #89868A; border-right-style: solid; border-right-width: 1px; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px" width="20%" bgcolor="#F7F7F5" height="21"> </td>
   <td style="border-style:solid; border-width:1px; " width="6%" valign="bottom" bgcolor="#F7F7F5" height="21">
   <font face="Arial" size="2"> </font></td>
   <td style="border-style:solid; border-width:1px; " bgcolor="#F7F7F5" width="3%" height="21"> </td>
   <td style="border-left-style: solid; border-left-width: 1px; border-top-style: solid; border-top-width: 1px" bgcolor="#F7F7F5" width="75" height="21"> </td>
  </tr>
  <tr>
   <td style="border-style:none; border-width:medium; " colspan="7">
   <p align="right">
   <font face="Arial Narrow" size="1" color="#993300">
   <a href="#Websiteinformatie" style="text-decoration: none">Websiteinfo</a> 
   Webzuilpublicatie : pw-electropost</font></td>
  </tr>
  </table>
 </div>
<?
}
else
{
?>
 <form action=login.php method=post>
 <div align="center">
  <table width="80%" cellspacing="9" cellpadding="0" bordercolor="#A6A393" bordercolorlight="#A6A393" bordercolordark="#A6A393">
  <tr>
   <td style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium; border-bottom-style:solid; border-bottom-width:1px" colspan="5">
    <p align="left"> </td>
   <td style="border-style:none; border-width:medium; "> </td>
   <td style="border-style:none; border-width:medium; " width="76" valign="top">
    </td>
  </tr>
  <tr>
   <td width="69%" height="10" align="right" valign="top" colspan="4">
   <dl>
   <div align="right">
   <dt><b>
   <font size="4" face="Arial" color="#828268">
   Vrolijk   </font></b></dt>
   </div>
   <div align="right">
   <dt><b><font face="Arial" size="4" color="#828268">Kerstfeest  
   </font></b></dt>
   </div>
   </dl>
   </td>
   <td style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1px; border-top-style: none; border-top-width: medium; " colspan="2" height="20" valign="bottom" width="15%" rowspan="2">
   <p align="right"><b>
   <font face="Arial" size="2" color="#000080">TRIBUUN</font><font face="Arial" size="2" color="#993300">  
   </font></b></td>
   <td style="border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium; " height="20" width="76" align="center" rowspan="2">
   <font color="#000000">
   <a style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: verdana; TEXT-DECORATION: none">
   <img height="75" alt="Kerstmiswensen" src="css/carol.gif" width="112" border="3"></a></font></td>
  </tr>
  <tr>
   <td style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-bottom-style:none; border-bottom-width:medium" width="10%" height="10" align="left" valign="top">
   <font face="Arial" size="2">Inlognaam</font></td>
   <td style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-bottom-style:none; border-bottom-width:medium" width="25%" height="10" align="right" valign="top">
   <p align="left">
    <!--webbot bot="Validation" b-disallow-first-item="TRUE" --><select size="1" name="user" style="width: 145; height: 20; border: 1px solid #808080">
   <option>hiernaamdeelnemer1</option>
   <option>hiernaamdeelnemer2</option>
   <option>hiernaamdeelnemer3</option>
   <option>hiernaamdeelnemer4</option>
   <option>hiernaamdeelnemer5</option>
   <option>hiernaamdeelnemer6</option>
   <option>hiernaamdeelnemer7</option>
   <option>hiernaamdeelnemer8</option>
   <option>hiernaamdeelnemer9</option>
   </select></td>
   <td style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-bottom-style:none; border-bottom-width:medium" width="17%" height="10" align="right" valign="top">
   <input type="reset" value="Herstel" name="B2" style="background-color:#F7F7F5 ; width: 80; height: 21; float: left; border: 1px solid #858A91"></td>
   <td style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-bottom-style:none; border-bottom-width:medium" width="21%" height="10" align="right" valign="top">
   </td>
  </tr>
  <tr>
   <td style="border-style:none; border-width:medium; " width="10%" align="left">
   <font size="2" face="Arial">Paswoord</font></td>
   <td width="25%">
   <input type=password name=pass  size="20" style="border: 1px solid #C0C0C0"><font size="2" face="Arial">
   </font></td>
   <td style="border-style:none; border-width:medium; " width="17%">
   <p align="center">
   <input type="submit" value="Inloggen"  style="background-color:#F7F7F5 ; width: 80; height: 21; float: left; border: 1px solid #858A91">
   </td>
   <td style="border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: solid; border-bottom-width: 1px" width="21%">
   <p align="left"><font face="Arial" size="2"> </font></td>
   <td style="border-left-style:none; border-left-width:medium; border-right-style:solid; border-right-width:1px; border-top-style:solid; border-top-width:1px; border-bottom-style:solid; border-bottom-width:1px" width="6%" bgcolor="#F7F7F5"> </td>
   <td style="border-style: solid; border-width: 1px; " bgcolor="#F7F7F5" width="3%"> </td>
   <td style="border-left-style:solid; border-left-width:1px; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1px; border-bottom-style:solid; border-bottom-width:1px" bgcolor="#F7F7F5" width="75"> </td>
  </tr>
  <tr>
   <td style="border-style:none; border-width:medium; " width="10%" height="21"> </td>
   <td style="border-style:none; border-width:medium; " width="25%" height="21">
   <font size="2" face="Arial"> </font></td>
   <td style="border-style:none; border-width:medium; " width="17%" height="21"> </td>
   <td style="border-left: medium none #89868A; border-right-style: solid; border-right-width: 1px; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px" width="20%" bgcolor="#F7F7F5" height="21"> </td>
   <td style="border-style:solid; border-width:1px; " width="6%" valign="bottom" bgcolor="#F7F7F5" height="21">
   <font face="Arial" size="2"> </font></td>
   <td style="border-style:solid; border-width:1px; " bgcolor="#F7F7F5" width="3%" height="21"> </td>
   <td style="border-left-style: solid; border-left-width: 1px; border-top-style: solid; border-top-width: 1px" bgcolor="#F7F7F5" width="75" height="21"> </td>
  </tr>
  <tr>
   <td style="border-style:none; border-width:medium; " colspan="7">
   <p align="right">
   <font face="Arial Narrow" size="1" color="#993300">
   <a href="#Websiteinformatie" style="text-decoration: none">Websiteinfo</a> 
   Webzuilpublicatie : pw-electropost</font></td>
  </tr>
  </table>
 </div>
 </form>
 
<?
}
?>

3: kersform.php
---------------
<?php

$con= mysql_connect(localhost,gebruikersnaam,gebruikerspass) or die ("fout");
$db = mysql_select_db(tribuun_agbook1,$con) or die ("fout");

$time=time();

 $invoer = array($_POST['een'],$_POST['twee'],$_POST['drie'],$_POST['vier'],$_POST['vijf']);
if ($_COOKIE['pass'])
 {
 if (!$_POST[een])
  {$lijst = false;}
 else
  {
  for($x=0; $x<5; $x++){
  if ($invoer[$x])
   {
    $sql = "INSERT INTO lijst (naam, voorstel) VALUES ('$_COOKIE[user]', '$invoer[$x]')";
         mysql_query($sql) or die(mysql_error());
         }
        }
  ?>
  <div align="center">
  <table width="80%" cellspacing="9" cellpadding="0" bordercolor="#A6A393" bordercolorlight="#A6A393" bordercolordark="#A6A393">
  <tr>
   <td style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium; border-bottom-style:solid; border-bottom-width:1px" colspan="5">
    <p align="left"> </td>
   <td style="border-style:none; border-width:medium; "> </td>
   <td style="border-style:none; border-width:medium; " width="76" valign="top">
    </td>
  </tr>
  <tr>
   <td width="69%" height="10" align="right" valign="top" colspan="4">
   <dl>
   <div align="right">
   <dt><b>
   <font size="4" face="Arial" color="#828268">
   Vrolijk     </font></b></dt>
   </div>
   <div align="right">
   <dt><b>
   <font size="4" face="Arial" color="#828268">
   Kerstfeest  
   </font></b></dt>
   </div>
   </dl>
   </td>
   <td style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1px; border-top-style: none; border-top-width: medium; " colspan="2" height="20" valign="bottom" width="15%" rowspan="2">
   <p align="right"><b>
   <font face="Arial" size="2" color="#000080">TRIBUUN</font><font face="Arial" size="2" color="#993300">  
   </font></b></td>
   <td style="border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium; " height="20" width="76" align="center" rowspan="2">
   <a style="color: black; font-family: verdana; font-size: 8pt; text-decoration: none">
   <img height="75" alt="Kerstmiswensen" src="css/wishes.gif" width="110" border="2"></a></td>
  </tr>
  <tr>
   <td width="73%" height="10" align="left" valign="top" colspan="4">
   <address align="left">
    <font face="Arial" size="2">
    <?echo $_COOKIE['user'] ?> het volgende werd aan je lijst toegevoegd :<br>
   <hr size="1">
   <?
   for($x=0; $x<5; $x++)
   {
   if ($invoer[$x])
    {echo $invoer[$x]."<br>";}
   }
   ?>
    </font></address>
   </td>
  </tr>
  <tr>
   <td style="border-style:none; border-width:medium; " width="10%" align="left">
    </td>
   <td width="25%">
    </td>
   <td style="border-style:none; border-width:medium; " width="17%">
   <p align="center">
    </td>
   <td style="border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: solid; border-bottom-width: 1px" width="21%">
   <div align="right">
    <a href="login.php"><font face="Arial" size="2">Nieuw Toevoegen</font>
    </a>
   </div>
   </td>
   <td style="border-left-style:none; border-left-width:medium; border-right-style:solid; border-right-width:1px; border-top-style:solid; border-top-width:1px; border-bottom-style:solid; border-bottom-width:1px" width="6%" bgcolor="#F7F7F5"> </td>
   <td style="border-style: solid; border-width: 1px; " bgcolor="#F7F7F5" width="3%"> </td>
   <td style="border-left-style:solid; border-left-width:1px; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1px; border-bottom-style:solid; border-bottom-width:1px" bgcolor="#F7F7F5" width="75"> </td>
  </tr>
  <tr>
   <td style="border-style:none; border-width:medium; " width="10%" height="21"> </td>
   <td style="border-style:none; border-width:medium; " width="25%" height="21">
   <font size="2" face="Arial"> </font></td>
   <td style="border-style:none; border-width:medium; " width="17%" height="21"> </td>
   <td style="border-left: medium none #89868A; border-right-style: solid; border-right-width: 1px; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px" width="20%" bgcolor="#F7F7F5" height="21">
   <p align="right">
    <font face="Arial" size="2"><a href="kerstlijst.php">Lijst inkijken</a> </font>
   </td>
   <td style="border-style:solid; border-width:1px; " width="6%" valign="bottom" bgcolor="#F7F7F5" height="21">
   <font face="Arial" size="2"> </font></td>
   <td style="border-style:solid; border-width:1px; " bgcolor="#F7F7F5" width="3%" height="21"> </td>
   <td style="border-left-style: solid; border-left-width: 1px; border-top-style: solid; border-top-width: 1px" bgcolor="#F7F7F5" width="75" height="21"> </td>
  </tr>
  <tr>
   <td style="border-style:none; border-width:medium; " colspan="7">
   <p align="right">
   <font face="Arial Narrow" size="1" color="#993300">
   <a href="#Websiteinformatie" style="text-decoration: none">Websiteinfo</a> 
   Webzuilpublicatie : pw-electropost</font></td>
  </tr>
  </table>
 </div>  
  
 
  <?
     $lijst = true;
  }
 }
else 
 {
 $login_error= true;  
 }
 //}
 


if ($login_error == true)
{

?>
 <div align="center">
  <table width="80%" cellspacing="9" cellpadding="0" bordercolor="#A6A393" bordercolorlight="#A6A393" bordercolordark="#A6A393">
  <tr>
   <td style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium; border-bottom-style:solid; border-bottom-width:1px" colspan="5">
    <p align="left"> </td>
   <td style="border-style:none; border-width:medium; "> </td>
   <td style="border-style:none; border-width:medium; " width="76" valign="top">
    </td>
  </tr>
  <tr>
   <td width="69%" height="10" align="right" valign="top" colspan="4">
   <dl>
   <div align="right">
   <dt><b>
   <font size="4" face="Arial" color="#828268">
   Vrolijk     </font></b></dt>
   </div>
   <div align="right">
   <dt><b>
   <font size="4" face="Arial" color="#828268">
   Kerstfeest  
   </font></b></dt>
   </div>
   </dl>
   </td>
   <td style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1px; border-top-style: none; border-top-width: medium; " colspan="2" height="20" valign="bottom" width="15%" rowspan="2">
   <p align="right"><b>
   <font face="Arial" size="2" color="#000080">TRIBUUN</font><font face="Arial" size="2" color="#993300">  
   </font></b></td>
   <td style="border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium; " height="20" width="76" align="center" rowspan="2">
   <a style="color: black; font-family: verdana; font-size: 8pt; text-decoration: none">
   <img height="75" alt="Kerstmiswensen" src="css/wishes.gif" width="110" border="2"></a></td>
  </tr>
  <tr>
   <td width="73%" height="10" align="left" valign="top" colspan="4">
   <address align="left"><font size="2" face="Arial">De gebruikersnaam met dit wachtwoord is
   niet geregistreerd.</font></address>
   <address align="left"><font face="Arial" size="2">De inlogprocedure
    wordt hier afgesloten.</font></address>
   </td>
  </tr>
  <tr>
   <td style="border-style:none; border-width:medium; " width="10%" align="left">
    </td>
   <td width="25%">
    </td>
   <td style="border-style:none; border-width:medium; " width="17%">
   <p align="center">
    </td>
   <td style="border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: solid; border-bottom-width: 1px" width="21%">
   <div align="right">
    <font face="Arial" size="2"><a href="index.php">Inloggen</a></font>
   </div>
   </td>
   <td style="border-left-style:none; border-left-width:medium; border-right-style:solid; border-right-width:1px; border-top-style:solid; border-top-width:1px; border-bottom-style:solid; border-bottom-width:1px" width="6%" bgcolor="#F7F7F5"> </td>
   <td style="border-style: solid; border-width: 1px; " bgcolor="#F7F7F5" width="3%"> </td>
   <td style="border-left-style:solid; border-left-width:1px; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1px; border-bottom-style:solid; border-bottom-width:1px" bgcolor="#F7F7F5" width="75"> </td>
  </tr>
  <tr>
   <td style="border-style:none; border-width:medium; " width="10%" height="21"> </td>
   <td style="border-style:none; border-width:medium; " width="25%" height="21">
   <font size="2" face="Arial"> </font></td>
   <td style="border-style:none; border-width:medium; " width="17%" height="21"> </td>
   <td style="border-left: medium none #89868A; border-right-style: solid; border-right-width: 1px; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px" width="20%" bgcolor="#F7F7F5" height="21">
   <p align="right">
    <font face="Arial" size="2"><a href="kerstlijst.php">Lijst inkijken</a> </font>
   </td>
   <td style="border-style:solid; border-width:1px; " width="6%" valign="bottom" bgcolor="#F7F7F5" height="21">
   <font face="Arial" size="2"> </font></td>
   <td style="border-style:solid; border-width:1px; " bgcolor="#F7F7F5" width="3%" height="21"> </td>
   <td style="border-left-style: solid; border-left-width: 1px; border-top-style: solid; border-top-width: 1px" bgcolor="#F7F7F5" width="75" height="21"> </td>
  </tr>
  <tr>
   <td style="border-style:none; border-width:medium; " colspan="7">
   <p align="right">
   <font face="Arial Narrow" size="1" color="#993300">
   <a href="#Websiteinformatie" style="text-decoration: none">Websiteinfo</a> 
   Webzuilpublicatie : pw-electropost</font></td>
  </tr>
  </table>
 </div>
<?
}
else if ($lijst == true)
{echo "maaklijst";}

else
{
?>
 
 <form action="kerstform.php" method="post">
 <div align="center">
  <table width="80%" cellspacing="9" cellpadding="0" bordercolor="#A6A393" bordercolorlight="#A6A393" bordercolordark="#A6A393" style="border-right-width: 0px; border-top-width: 0px">
  <tr>
   <td style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium; border-bottom-style:solid; border-bottom-width:1px" colspan="5">
    <p align="right"><font color="#FF0000" face="Arial" size="1">
   Minimum : 1 voorstel voor een geldige registratie [bovenste invoervak ]</font></td>
   <td style="border-style:none; border-width:medium; "> </td>
   <td style="border-style:none; border-width:medium; " width="76" valign="top">
    </td>
  </tr>
  <tr>
   <td width="69%" height="10" align="right" valign="top" colspan="4">
   <dl>
   <div align="right">
   <dt><b><font face="Arial" size="4" color="#828268">Geschenkenlijst  
   </font></b></dt>
   </div>
   <div align="right">
   <dt><b><font face="Arial" size="4" color="#828268">Aanvullen -
   Inkijken  
   </font></b></dt>
   </div>
   </dl>
   </td>
   <td style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1px; border-top-style: none; border-top-width: medium; " colspan="2" valign="bottom" width="15%" rowspan="6">
   <p align="right"><b>
   <font face="Arial" size="2" color="#000080">TRIBUUN</font><font face="Arial" size="2" color="#993300">  
   </font></b></td>
   <td style="border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium; border-bottom-style:none; border-bottom-width:medium" width="76" align="center" rowspan="6" valign="bottom">
   <font color="#000000">
   <a style="font-size: 8pt; color: black; font-family: verdana; text-decoration: none">
   <img height="75" alt="Kerstmiswensen" src="css/carol.gif" width="112" border="3"></a></font></td>
  </tr>
  <tr>
   <td style="border:1px solid #808080; " width="10%" height="10" align="left" valign="top" bgcolor="#F7F7F5">
   <font face="Arial" size="2">Naam</font></td>
   <td width="27%" height="10" align="right" valign="top">
   <p align="left">
   <? echo $GLOBALS['kerstkonijn'] ?></td>
   <td style="border-right-style:none; border-right-width:medium; border-bottom-style:none; border-bottom-width:medium" width="11%" height="10" align="right" valign="top">
   </td>
   <td style="border-style:none; border-width:medium; " width="21%" height="10" align="right" valign="top">
   </td>
  </tr>
  <tr>
   <td style="border-style:none; border-width:medium; " width="10%" align="left">
   <font face="Arial" size="2">Voorstel</font></td>
   <td width="27%">
   <input type=text name="een" value="" size="26" style="border: 1px solid #C0C0C0"></td>
   <td style="border-style:none; border-width:medium; " width="11%">
    </td>
   <td style="border-style:none; border-width:medium; " width="21%">
    </td>
  </tr>
  <tr>
   <td style="border-style:none; border-width:medium; " width="10%" align="left">
   <font face="Arial" size="2">Voorstel</font></td>
   <td width="27%">
   <input type=text name="twee"  size="26" style="border: 1px solid #C0C0C0"></td>
   <td style="border-style:none; border-width:medium; " width="11%">
    </td>
   <td style="border-style:none; border-width:medium; " width="21%">
    </td>
  </tr>
  <tr>
   <td style="border-style:none; border-width:medium; " width="10%" align="left">
   <font face="Arial" size="2">Voorstel</font></td>
   <td width="27%">
   <input type=text name=drie  size="26" style="border: 1px solid #C0C0C0"></td>
   <td style="border-style:none; border-width:medium; " width="11%">
    </td>
   <td style="border-style:none; border-width:medium; " width="21%">
    </td>
  </tr>
  <tr>
   <td style="border-style:none; border-width:medium; " width="10%" align="left">
   <font face="Arial" size="2">Voorstel</font></td>
   <td width="27%">
   <input type=text name=vier  size="26" style="border: 1px solid #C0C0C0"></td>
   <td style="border-style:none; border-width:medium; " width="11%">
    </td>
   <td style="border-style:none; border-width:medium; " width="21%">
    </td>
  </tr>
  <tr>
   <td style="border-style:none; border-width:medium; " width="10%" align="left">
   <font face="Arial" size="2">Voorstel</font></td>
   <td width="27%">
   <input type=text name=vijf  size="26" style="border: 1px solid #C0C0C0"></td>
   <td style="border-style:none; border-width:medium; " width="11%">
   <p align="center">
   <input type="submit" value="Toevoegen" name="voorstellen" style="background-color:#F7F7F5 ; width: 80; height: 21; float: left; border: 1px solid #858A91">
   </td>
   <td style="border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: solid; border-bottom-width: 1px" width="21%">
   <p align="left"><font face="Arial" size="2"> </font><div align="right">
    <font face="Arial" size="2"><a href="index.php">Inloggen</a></font>
   </div>
   </td>
   <td style="border-left-style:none; border-left-width:medium; border-right-style:solid; border-right-width:1px; border-top-style:solid; border-top-width:1px; border-bottom-style:solid; border-bottom-width:1px" width="6%" bgcolor="#F7F7F5"> </td>
   <td style="border-style: solid; border-width: 1px; " bgcolor="#F7F7F5" width="3%"> </td>
   <td style="border-left-style:solid; border-left-width:1px; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1px; border-bottom-style:solid; border-bottom-width:1px" bgcolor="#F7F7F5" width="75"> </td>
  </tr>
  <tr>
   <td style="border-style:none; border-width:medium; " width="10%" height="21"> </td>
   <td style="border-style:none; border-width:medium; " width="27%" height="21">
   <font size="2" face="Arial"> </font></td>
   <td style="border-style:none; border-width:medium; " width="11%" height="21">
   <input type="reset" value="Herstel" name="B2" style="background-color:#F7F7F5 ; width: 80; height: 21; float: left; border: 1px solid #858A91"></td>
   <td style="border-left: medium none #89868A; border-right-style: solid; border-right-width: 1px; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px" width="20%" bgcolor="#F7F7F5" height="21">
   <p align="right">
    <font face="Arial" size="2"><a href="kerstlijst.php">Lijst inkijken</a> </font>
   </td>
   <td style="border-style:solid; border-width:1px; " width="6%" valign="bottom" bgcolor="#F7F7F5" height="21">
   <font face="Arial" size="2"> </font></td>
   <td style="border-style:solid; border-width:1px; " bgcolor="#F7F7F5" width="3%" height="21"> </td>
   <td style="border-left-style: solid; border-left-width: 1px; border-top-style: solid; border-top-width: 1px" bgcolor="#F7F7F5" width="75" height="21"> </td>
  </tr>
  <tr>
   <td style="border-style:none; border-width:medium; " colspan="7">
   <p align="right">
   <font face="Arial Narrow" size="1" color="#993300">
   <a href="#Websiteinformatie" style="text-decoration: none">Websiteinfo</a> 
   Webzuilpublicatie : pw-electropost</font></td>
  </tr>
  </table>
 </div>
 </form>
 
<?
}
?>

Vervolg php-code Kerstlijst : zie hieronder

Geschreven door de makers om 02:05 Reageer op dit bericht

Meer van Ramen

↑ Terug naar de berichten