User Tools

Site Tools


kurs:einfachste_form

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

kurs:einfachste_form [2014/09/10 21:22] (current)
Line 1: Line 1:
 +<​code>​
 +<form name="​form" ​
 +      action="<?​php $PHP_SELF; ?>"
 +   method="​get">  ​
 +Name:<​input name="​name"​ type="​text"​ size="​30">​
 +<br>
 +<input type="​submit"​ value="​Get Info">​
 +</​form>​
 +<?php
  
 +if ($_GET['​name'​]) {
 +  $db = oci_connect('​hr',​ '​hr',​ '​orcl'​);​
 +  $suche = $_GET['​name'​];​
 +  $q = oci_parse($db, ​
 +  "​select last_name ln, salary from employees
 +    where last_name = :​suche"​);​
 +  oci_bind_by_name($q,​ ":​suche",​ $suche);
 +  $r = oci_execute($q,​ OCI_DEFAULT);​
 +  while ($row = oci_fetch_array($q,​ OCI_ASSOC)) {
 +    printf("​%s verdient %s<​br>", ​
 +    ​$row['​LN'​],​ $row['​SALARY'​]);​  ​  
 +  }  ​
 +}
 +</​code>​
kurs/einfachste_form.txt ยท Last modified: 2014/09/10 21:22 (external edit)