Autor Beitrag
mexx
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mi 07.06.06 10:16 
Dieses Thema, hat mit dem letzten nix zu tun. :lol:

Ich habe ein PHP Script, das wie folgt ausschaut.

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
<html>
<head>
  <title>PHP-Test</title>
</head>
<body>
<?php 

require("class_fbird.php");
$db= new fbird('D:\DataBase\TESTD3.FDB', 
  'ich', 'passwort');

$erg=$db->query("SELECT * from KUNDE");
$spalte=$db->fetch_row($erg);
echo $spalte[0];

$db->close();

 ?>
</body>
</html>


Da ich von PHP und HTML keine Ahnung habe, frage ich nach.

1. Ist der Code so wie er ist richtig?
2. Wie bringe ich Ihn nun zum laufen? Muss er als *.php oder *.html abgespeichert werden?

Moderiert von user profile iconChristian S.: Delphi- durch Code-Tags ersetzt

_________________
Das Unsympathische an den Computern ist, dass sie nur ja oder nein sagen können, aber nicht vielleicht.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 07.06.06 10:31 
Zitat:
1. Ist der Code so wie er ist richtig?
Es kommt darauf an, was er machen soll. Es scheint die erste Zeile der Tablel "Kunden" einer Firebird-Datenbank anzuzeigen.

Zitat:
2. Wie bringe ich Ihn nun zum laufen? Muss er als *.php oder *.html abgespeichert werden?
Da es PHP-Code ist .php

_________________
Markus Kinzler.
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mi 07.06.06 10:35 
Ja, man könnte auch das Ergebniss mit einer While-Schleife darstellen. Die Syntacs von PHP sei jetzt mal nicht das ausschlaggebende Thema. Ich habe eher fragen bzgl. der Handhabung. Wenn ich die Datei nun aber als PHP speicher, wie rufe ich sie nun auf. Doppelklick öffnet Sie.

Ich vermute mal, dass ich einen Server-Dienst brauche?

_________________
Das Unsympathische an den Computern ist, dass sie nur ja oder nein sagen können, aber nicht vielleicht.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 07.06.06 10:41 
Zitat:
Ich vermute mal, dass ich einen Server-Dienst brauche?
Entweder einen Webserver mit PHP-Interpreter als Modul (ISAPI/DSO) oder als CGI.

_________________
Markus Kinzler.
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mi 07.06.06 10:46 
Okay, ich nutze jetzt den IIS-Server von Microsoft. Ich kopiere die Notwendigen Dateien in das Verzeichnis des Servers und rufe es mit der IP/connect.php auf. Jedoch sagt er mir, Seite nicht gefunden.

_________________
Das Unsympathische an den Computern ist, dass sie nur ja oder nein sagen können, aber nicht vielleicht.
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Mi 07.06.06 11:15 
die beste lösung ist ein lokaler apache-server apache.org
und php php.net

einfach in der apache.conf das php-Modul aktivieren durch löschen des voranstehenden Semikolons bei ;loadmodule xy oder du liest in der php-hilfe nach wie du es installierst
kommt auf die apache-version drauf an =)

bissl umständlich ausgedrückt oder?

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mi 07.06.06 11:45 
Ich kenne diese lokalen Systeme, eine Weile her, aber noch bekannt. Aber in der Theorie sollte es doch so gehen? Ich meine das PHP-Script und der Aufruf?

_________________
Das Unsympathische an den Computern ist, dass sie nur ja oder nein sagen können, aber nicht vielleicht.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 07.06.06 11:47 
In Prinzip schon, ist den die PHP-ISAPI-Erweiterung installiert und konfiguriert?

_________________
Markus Kinzler.
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mi 07.06.06 11:57 
Nein! Mir ist gerade eingefallen, dass ich auch noch eine andere Testumgebung nutzen kann. Ein Linux-Server, der den Apache-Dienst verwendet. Muss ich da noch was beachten?
Hab den Server zwar selber aufgesetzt und da läuft auch ne Intranet-Page, aber die ist ne einfach NEWS Seite für die Bürokräfte.

_________________
Das Unsympathische an den Computern ist, dass sie nur ja oder nein sagen können, aber nicht vielleicht.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 07.06.06 12:02 
Es muß die DSO für PHP installiert sein. Ist aber in den meißten Fällen sichergestellt.

_________________
Markus Kinzler.
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mi 07.06.06 12:07 
Ich habe dem Dienst nun die php Seite als Standart-Site vergeben und die Syntacs ist auch ok. Rufe ich die Seite auf, führt er jedoch einen Download durch, statt das PHP-Scrip auszuführen. Was mache ich falsch?

Kann ich auch eine HTML-Seite verwenden, um das PHP aufzurufen? Wenn ja, wie?

_________________
Das Unsympathische an den Computern ist, dass sie nur ja oder nein sagen können, aber nicht vielleicht.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 07.06.06 12:15 
Zitat:
Kann ich auch eine HTML-Seite verwenden, um das PHP aufzurufen? Wenn ja, wie?
In dem du alles durch den PHP-Interpreter jagst ;-) Ist aber wenig sinnvoll.
Ich würde mal überprüfen, ob:
1.) Php installiert ist
2.) Die Zuordnungen in der Apache-konfiguration stimmen.

_________________
Markus Kinzler.
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mi 07.06.06 12:20 
PHP als Paket nehme ich an?

_________________
Das Unsympathische an den Computern ist, dass sie nur ja oder nein sagen können, aber nicht vielleicht.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 07.06.06 12:22 
Welche Linuxversion/Distribution?

_________________
Markus Kinzler.
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mi 07.06.06 12:23 
Suse 9.2

_________________
Das Unsympathische an den Computern ist, dass sie nur ja oder nein sagen können, aber nicht vielleicht.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 07.06.06 12:24 
Dann schau mal im Yast ob das Apache-Modul php4 oder php5 installiert ist.

_________________
Markus Kinzler.
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mi 07.06.06 12:33 
Ich befinde mich nun im Menü, wo ich Pakete und Software installiern kann. Wenn ich PHP als Suche eintrage erhalte ich kein Ergebnis. Sehr merkwürdig!

_________________
Das Unsympathische an den Computern ist, dass sie nur ja oder nein sagen können, aber nicht vielleicht.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 07.06.06 12:36 
suche mal nach libapache

_________________
Markus Kinzler.
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mi 07.06.06 12:43 
Jedesmal kein Suchergebniss!

_________________
Das Unsympathische an den Computern ist, dass sie nur ja oder nein sagen können, aber nicht vielleicht.
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mi 07.06.06 14:20 
Hol dir einfach XAMPP und es läuft fantastisch :-D

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot