PHP Include-anweisung innerhalb von javascript
Christoph
- javascript
0 Cheatah
Hallo zusammen mein erstes Problem habe ich selber gelöst bekommen
(Frameset auf Vollbild und wieder zurück ins Frameset ...). Nun habe ich ein neues Problem.
Ich möchte, dass mein Script eine "PHP Include-anweisung" ausführt.
Die Stelle wo der Code hin soll ist mit "HIER SOLL DER PHP CODE HIN" gekennzeichnet
das ist der PHP Schnipsel ...
<? $include_file = DIR_WS_INCLUDES . 'navibar.php'; include(DIR_WS_INCLUDES . 'include_once.php'); ?>
Bitte helft mir ... ich weis nicht mehr weiter. Oder kann man vielleicht alles in javascript umwandeln, oder so ??
Den Code in javascript variable umwandeln und und dann schreiben lassen funktioniert nicht ... hm, please help me ;-)
Hier das Script ....
<SCRIPT LANGUAGE="JavaScript">
<!--
if(top.location.href != self.location.href)
document.writeln('<table width="100%" border="0" align="center">' + '<tr>' + '<td align="center">' + '<A
HREF="'+self.location.href+'" TARGET="_top">Vollbild</A>' + '</td>' + '<td align="center">'HIER SOLL DER PHP CODE HIN +
'</td>' + '</tr>' + '</table>');
else
document.writeln('<table width="100%" border="0" align="center">' + '<tr>' + '<td align="center">' + '<A
HREF="'+top.location.href+'"onClick="Framing()">Frameset</A>' + '</td>' + '<td align="center">'HIER SOLL DER PHP CODE HIN +
'</td>' + '</tr>' + '</table>');
function Framing()
{
if (this.document == top.document || top.location.host == this.location.host) {
var protocol = location.protocol + '//' + location.host + location.pathname.substring(0,
location.pathname.lastIndexOf('/catalog') + 1);
var path = location.pathname;
var rest = location.search;
var doctitle = document.title;
document.clear();
document.open("text/html");
document.writeln('<html>\n<head><title>'+doctitle+
'</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>');
document.writeln('<frameset rows="72,*" cols="*" framespacing="0" frameborder="NO" border="0">'+
'<frame src="top.php" name="topFrame" scrolling="NO" noresize>'+
'<frameset rows="*,52" frameborder="NO" border="0" framespacing="0">'+
'<frame src="'+ protocol + path + rest +' " name=mainFrame >'+
'<frame src="bottom.php" name="bottomFrame" scrolling="NO" noresize>'+
'</frameset>'+
'</frameset></html>');
document.close();
return true;
}
return false;
}
// --->
</script>
Hi,
Ich möchte, dass mein Script eine "PHP Include-anweisung" ausführt.
Client-Server-Architektur für Anfänger, am Beispiel von HTTP:
1.) Der Client schickt eine Anfrage an den Server (z.B. "Linkklick").
2.) Der Server empfängt den Request, bearbeitet ihn (z.B. PHP) und schickt die Antwort zurück.
3.) Der Server stirbt, explodiert oder wird von Außerirdischen aufgegessen.
4.) Der Client erhält die Antwort, interpretiert sie (z.B. JavaScript) und freut sich über den Tod des Servers.
Es existiert kein Weg, eine serverseitige Aktion (z.B. PHP) clientseitig zu initiieren, ohne wieder bei Schritt 1 zu beginnen.
Cheatah