Autor Beitrag
LittleBen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 258
Erhaltene Danke: 4

Win 7, Mac OS
Delphi 7
BeitragVerfasst: Fr 16.09.11 15:05 
Hallo Leute,
kann mir mal jemand erklären, was diese Zeile macht? <META HTTP-EQUIV="refresh" CONTENT="0;URL=http://test.de/home.htm?test">
Habe mich über Meta schon informiert, aber nicht herausgefunden was das hinter dem Fragezeichen bedeutet. Also das: ?test">

Vielen Dank & Grüße,
Benny
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Fr 16.09.11 15:31 
Meta-Refresh aktualisiert die Seite oder führt eine Weiterleitung durch. Das hinter dem Fragezeichen gehört zur URL und ist ein Parameter ohne Wert.

Beispiele:
...index.php?param1=wert1
...index.php?param1
...index.php?param1=wert1&param2=wert2
........

EDIT: Die Parameter können dann Clientseitig (z. B. JavaScript) oder serverseitig (z. B. PHP, ASP, ..) abgefragt werden.

Z. B. so:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
<?php

  if(isset($_GET['param1']) {
    echo 'param1 ist gesetzt.';
  }

  $var = $_GET['param1'];
  echo $var; //gibt wert1 aus

?>
LittleBen Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 258
Erhaltene Danke: 4

Win 7, Mac OS
Delphi 7
BeitragVerfasst: Fr 16.09.11 15:36 
Ahaaaa! Vielen Dank! Also kann man eine Seite erstellen, auf der ein Label ist, das den Wert des Parameters anzeigt.
Bei ...index.php?param1=wert1 steht im Label "wert1" ?
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Fr 16.09.11 15:39 
Siehe mein Edit. Die Parameter können wie du schon sagst ausgegeben werden oder zur Steuerung verwendet werden. z. B.

index.php?action=delete_user

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
<?php
  if($_GET['action'] == 'delete_user') {
    // user löschen
  } else {
    // was anderes machen
  }
?>


Die Parameter sind aber nicht einfach mit einem "Control" verbunden, aber selbstverständlich könnte man ein Label in einerm <form> den Text mitgeben.
LittleBen Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 258
Erhaltene Danke: 4

Win 7, Mac OS
Delphi 7
BeitragVerfasst: Fr 16.09.11 15:40 
Das ist ja genial. Vielen vielen Dank!
buster
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 66
Erhaltene Danke: 7

WIN 7
Delphi 2010 Prof
BeitragVerfasst: Fr 16.09.11 15:42