Welcome to Geeklog, Anonymous Monday, December 30 2024 @ 12:51 pm EST
Geeklog Forums
unable to use php code in block
damental
Anonymous
A script I installed says I should be able to use the following code to show their script on a PHP page
Problem is, it doesn't show anything? Is there something I'm missing or doing wrong? I put it in as a Normal block.
Problem is, it doesn't show anything? Is there something I'm missing or doing wrong? I put it in as a Normal block.
8
10
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
You can't use PHP in blocks directly. You will need to add a function to your lib-custom.php and create a block of type "PHP block" to call it.
Also see the FAQ.
bye, Dirk
(Edit: lib-custom.php, of course, not lib-common.php)
Also see the FAQ.
bye, Dirk
(Edit: lib-custom.php, of course, not lib-common.php)
10
9
Quote
Ken
Anonymous
I'm trying to use a block to trigger php121 chat window. I basically want to put a button in a block to trigger the chat. The button requires php so I need to make a function call from the custum library which I understand. Problem is I have no idea how to do that. Please Help
Anyway to see an example of this using the following code:
<html>
<head>
<title>Arcane Chat</title>
</head>
<body>
<?php
echo "<script type="text/javascript">n";
echo "<!--n";
echo "var newwindow;n";
echo "function poptastic(url){n";
echo "newwindow=window.open(url,'name','height=500,width=230,left=20,top=20,toolbar=no,menubar=no,directories=no,location=no,scrollbars=yes,status=no,resizable=yes,fullscreen=no');n";
echo "if (window.focus) {newwindow.focus()}n";
echo "}n";
echo "//-->n";
echo "</SCRIPT>nn";
echo "<font style="FONT-FAMILY: Verdana,Helvetica; FONT-SIZE: 12px">";
echo "<b>PHP121 Standalone version</b><p>";
echo "<a href="javascript:poptastic('php121im.php');">Instant Messenger</a><br>n";
echo "</font>";
?>
</body>
</html>
Anyway to see an example of this using the following code:
Text Formatted Code
<html>
<head>
<title>Arcane Chat</title>
</head>
<body>
<?php
echo "<script type="text/javascript">n";
echo "<!--n";
echo "var newwindow;n";
echo "function poptastic(url){n";
echo "newwindow=window.open(url,'name','height=500,width=230,left=20,top=20,toolbar=no,menubar=no,directories=no,location=no,scrollbars=yes,status=no,resizable=yes,fullscreen=no');n";
echo "if (window.focus) {newwindow.focus()}n";
echo "}n";
echo "//-->n";
echo "</SCRIPT>nn";
echo "<font style="FONT-FAMILY: Verdana,Helvetica; FONT-SIZE: 12px">";
echo "<b>PHP121 Standalone version</b><p>";
echo "<a href="javascript:poptastic('php121im.php');">Instant Messenger</a><br>n";
echo "</font>";
?>
</body>
</html>
7
8
Quote
All times are EST. The time is now 12:51 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content