M.Dessel: Variablenübergabe

Beitrag lesen

Hallo zusammen,

hat jemand eine Idee warum ich mit diesem Code die Variable $id nur
an das Formular übergeben kann, wenn sie statisch vergebe?

$id=123;    //Das funktioniert

Wenn ich versuche dies über eine Input-Box zu übergeben nimmt er sie nicht.

Print ("<input type="text" name="id" size="30" maxlength="30" value="$id")> ");

//Das funktioniert nicht

Index.php
<?php  include("ausgabe.php");

global $id;

Print("<html> ");
Print(" <head> ");
Print("  <title>PHP Test</title> ");
Print(" </head> ");
Print(" <body> ");

$id=123;

Print ("<input type="text" name="id" size="30" maxlength="30" value="$id")> ");

print("            <input type="hidden"");
print("                   name="id"");
print("                   value="$id"");
print("            >\n");

print("        <input type="button"
                      class="buttons"
                      value="abc"
                      onclick="javascript:location.href='".$HTTP_SERVER_VARS['PHP_SELF']."?action=edit1&id=$id';">");

if ($_REQUEST['action'] == "edit1") {
  edit1_entry($_REQUEST['id']);
}

Print(" </body> ");
Print("</html> ");

?>

ausgabe.php
<?php

function edit1_entry($id) {
global $action;
global $HTTP_SERVER_VARS;
global $HTTP_GET_VARS;
global $HTTP_POST_VARS;

print("$id");

} // endfunction edit1_entry

?>

Über eure Hilfe würde ich mich sehr freuen.

Gruss Manfred