Witam.
Jestem od dawna użytkownikiem php, ale nigdy nie miałem z nim problemów( potrafię podmienić lub usunąć niechcianą treść w gotowych skryptach), ale od tygodnia walczę nad rozwiązaniem pobierania nazwy użytkownika z innej strony.
Wygląda to tak, że jeśli na moim forum wpiszę: <!-- USER LOGIN -->, jest to podmieniane na nazwę aktualnie zalogowanego użytkownika.
(IMG:
http://a.imageshack.us/img299/7448/problemsk.png)
Na forum tym właśnie wstawiłem w pływającym div'ie z lokalną ramką ( <iframe> ) chatboxa z katalogu niżej.
Wiadomo jednak, że w tym momencie "<!-- USER LOGIN -->" nie zadziała.
W jaki sposób pobrać do strony chatboxa, za pomocą PHP funkcję mojego forum?
Includowanie do skórki forum nie wchodzi w rachubę, ponieważ jest ono oparte na plikach .html i funkcje php na nim nie działają.
<?php
$_SESSION['token'] = $token;
?>
<!-- 1. Important: the PHP code above must appear at the top of any page which includes the shoutbox (before any HTML is started). -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>wTag test page.</title>
<!-- Copy the code between "Start Meta and links" and "End Meta and links",
paste it before the </head> closing tag on every page which includes the shoutbox
-->
<!-- 2. Start Meta and links -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
/* for Mozilla only: create rounded corners */
#box {
-moz-border-radius: 10px 10px 10px 10px;
}
</style>
<link rel="stylesheet" type="text/css" href="wtag/css/main-style.css" />
<script type="text/javascript" src="wtag/js/dom-drag.js"></script>
<script type="text/javascript" src="wtag/js/scroll.js"></script>
<script type="text/javascript" src="wtag/js/conf.js"></script>
<script type="text/javascript" src="wtag/js/ajax.js"></script>
<script type="text/javascript" src="wtag/js/drop_down.js"></script>
<!-- 2. End Meta and links -->
</head>
<body bgcolor="#000000">
<div id="main">
<!-- 3. Shoutbox code start -->
<div id="box">
<div id="chat">
<div id="scrollArea">
<div id="scroller">
</div>
</div>
<div id="container">
<div id='content'>
</div>
</div>
<div id='form'>
<form id='cform' name='chatform' action="#" >
<div id='field_set'>
<input type='hidden' id='token' name='token' value='
<?php echo $token; ?>' />
<input type='hidden' id='url' name='url' value='http://' />
<textarea rows='4' cols='10' id='message' name='message' ></textarea>
</div>
</form>
</div>
<div id="chat_menu">
<input type='text' id='name' name='name' value='
<!-- USER LOGIN -->
' />
<div id='refresh'>
<p>refresh</p>
</div>
<div id='submit'>
<p>submit</p>
</div>
</div>
</div>
</div>
<!-- 3. Shoutbox code end -->
</div>
</body>
</html>
Jestem przekonany, że to jakieś proste rozwiązanie w którym wystarczy podać ścieżkę do importowania funkcji (IMG:
style_emoticons/default/smile.gif)
Dziękuję za pomoc.
Ten post edytował Dual Jack 10.08.2010, 14:37:11