Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Apache Problem mit Button (https://www.delphipraxis.net/158698-apache-problem-mit-button.html)

xxsasch4xx 27. Feb 2011 13:30


Apache Problem mit Button
 
Hallo jedes Mal wenn ich in meiner PHP Datei auf einen Button klicke dann kommt immer eine Fehlermeldung, dass das Objekt nicht gefunden wurde.
Ich benutze den Apache Server von XAMMP.


Ich habe mal ein simples Beispiel Programm in PHP geschrieben in dem ich 2 Zahlen zusammen addiere:

Code:
<html>
<head>
<title> Rechnung </title>
</head>
<body>
<form action= "<?php echo $_server['PHP.SELF']?>" method="GET">
Erste Zahl: <br>
<input type="text" name="zahl1" size ="10"><br>
Zweite Zahl: <br>
<input type="text" name ="zahl2" size="10">
<br>
<input type="submit" name="button" value="addiere">
</form>

<?php
if (isset($_GET['button']))
{
$zahl1 =$_GET['zahl1'];
$zahl2 =$_GET['zahl2'];
$zahl3 = $zahl1+$zahl2;
echo "$zahl3";
}
?>
</body>
</html>
Mein Code stimmt doch oder nicht??

In der Adressleiste steht immer irgendwas von undefinierter Variable, vielleicht hilft das damit ihr den Fehler finden könnt.
localhost/%3Cbr%20/%3E%3Cb%3ENotice%3C/b%3E:%20%20Undefined%20variable:%20_server%20in%20 %3Cb%3EC:%5Cxampp%5Chtdocs%5Chey.php%3C/b%3E%20on%20line%20%3Cb%3E6%3C/b%3E%3Cbr%20/%3E?zahl1=4&zahl2=5&button=addiere

Grolle 27. Feb 2011 13:36

AW: Appache Problem mit Button
 
//Edit kann gelöscht werden. Doppelpost wg. Stress mit Internetverbindung.

Grolle 27. Feb 2011 13:37

AW: Appache Problem mit Button
 
Hi,

probiere mal
Code:
$_SERVER['PHP_SELF']
. Generell ist das aber eine sehr unsichere Variante (XSS).

Viele Grüße ...

xxsasch4xx 27. Feb 2011 13:50

AW: Appache Problem mit Button
 
geht. warum unsicher?

Valle 27. Feb 2011 14:08

AW: Appache Problem mit Button
 
Hi,

erstmal: Der Webserver heißt Apache, mit einem P.
Du hast aber eher ein Problem mit PHP, nicht mit Apache. ;-)

Grolle bezog sich auf so genannte Cross-Site Scripting Lücken.
Um diese musst du dir in diesem Script aber keine Sorgen machen, denn dort ist kein XSS Problem. ;-)

Liebe Grüße,
Valentin


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:23 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz