1
Viper5
Include php file
  • 2004/11/23 5:57

  • Viper5

  • Just popping in

  • Posts: 2

  • Since: 2004/11/23


Hey guys,

First of all I wanna say XOOPS rulez!!

But I want something included in my right block on the top page.

Now I use <? include "file.php" ?> and when I click Preview it all works, but when I save it and look at it in the top page it doesn't work how come?

Really need help!

2
de_muis
Re: Include php file
  • 2004/11/23 8:34

  • de_muis

  • Just popping in

  • Posts: 15

  • Since: 2004/11/8


I don't no much about it but I think it has something to do with template.html
You can vind it in system admin. You have to turn it on. When you made the change you must turn it off.

3
irmtfan
Re: Include php file
  • 2004/11/23 8:40

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Quote:

Viper5 wrote:
Hey guys,

First of all I wanna say XOOPS rulez!!

But I want something included in my right block on the top page.

Now I use <? include "file.php" ?> and when I click Preview it all works, but when I save it and look at it in the top page it doesn't work how come?

Really need help!

do use custom block and save it in "php script" format?
and you must put the file in the <?php ?> tags

4
emmade
Re: Include php file
  • 2005/1/2 20:34

  • emmade

  • Just popping in

  • Posts: 9

  • Since: 2003/3/17


Hi (and happy new year!)

I Keep the problem with including a php file in a block

what I do is.

I make a custom block

insert:
<?php include "http://www.mydomain.com/module.php"; ?>

and save it as content type php script.

Update module template .html files from themes/your theme/templates directory? is turned on

(it is working in the preview mode) But I do not get it working in the saved mode.

Can someone give me a direction where to look for a sollution?

Thanks and again happy new year!
Emma

5
wtravel
Re: Include php file

Hi,

You can try a few things.

Did you make the block visible in the module you want to show it (or on the top page or all pages) and did you give the access rights to all necessary groups?

When you turn on php debug mode in the administration menu (general settings) you might see an error if a parsing problem caused the code for not executing.

Regards,

Martijn

6
emmade
Re: Include php file
  • 2005/1/2 22:34

  • emmade

  • Just popping in

  • Posts: 9

  • Since: 2003/3/17


Hi,

And thanks for your reply

I get this error:

Parse error: parse error, unexpected '<' in /home/content/html/xoops/html/class/xoopsblock.php(146) : eval()'d code on line 1

I am using this code in the block
<?php include "http://www.mydomain.com/module.php"; ?>

For your information it works in preview.

I hope you can help me

thanks
emma

7
Dave_L
Re: Include php file
  • 2005/1/2 23:02

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Remove the
<?php ?>
brackets. They're inserted automatically when the content type is PHP.

8
CiberEspia
Re: Include php file

I have the same problem:
a block witch php:

<?PHP
$number = "3";
include("/home/animaweb/public_html/noticias/show_news.php");

?>

no work
and other block:
<?php
// aqui llamamos la funcion encuesta
include_once "/home/animaweb/public_html/encuestas/booth.php";
/* the third poll */
$php_poll->set_template_set("popup");
if ($php_poll->is_valid_poll_id(9)) {
echo $php_poll->display_poll(9);
}
?>
no block works I and removed <?php ?> tags and nothing

Login

Who's Online

222 user(s) are online (123 user(s) are browsing Support Forums)


Members: 0


Guests: 222


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits