Mam dwa pliki: content.php (który zawiera js) i display_gorace_oferty.php.
część kodu content.php<script type="text/javascript">
/*Example message arrays for the two demo scrollers*/
var pausecontent=new Array()
<?php include "display_gorace_oferty.php"; ?>
/*pausecontent[0]='<a href="http://www.javascriptkit.com">JavaScript Kit</a><br />Comprehensive JavaScript tutorials and over 400+ free scripts!'
pausecontent[1]='<a href="http://www.codingforums.com">Coding Forums</a><br />Web coding and development forums.'
pausecontent[2]='<a href="http://www.cssdrive.com" target="_new">CSS Drive</a><br />Categorized CSS gallery and examples.'
*/
</script>
kod display_gorace_oferty.php<?php
?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Główna</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<?php
include "admin/globals.php";
$i=0;
$row['tresc_GoraceOferty'] = nl2br($row['tresc_GoraceOferty']); $row['tresc_GoraceOferty'] = str_replace("r","",$row['tresc_GoraceOferty']); $row['tresc_GoraceOferty'] = str_replace("\n","",$row['tresc_GoraceOferty']); echo "pausecontent[".$i."]='".$row['tresc_GoraceOferty']."'\nr"; $i++;
}
?>
</body></html>
Link:
http://poligrafia1.nazwa.pl/helmut/orbis2Link 2:
http://poligrafia1.nazwa.pl/helmut/orbisDlaczego w pierwotnej wersji (link 2) skrypt działa, a w drugiej (link) nie działa?
Przypuszczam, że jest to wina złego includowania pliku php w znaczniku <script type="text/javascript">...</script>
Ale dlaczego w takim razie w pierwotnej wersji działa?
Ten post edytował bemol 4.04.2008, 12:34:22