1
konaafob
Custom block which can run php script
  • 2005/1/20 15:19

  • konaafob

  • Just popping in

  • Posts: 57

  • Since: 2005/1/10


Hi,
I want to create a custom block which can run php script. How can I do that.

Here is the script functionality I want to add in the block.

Read database select couple of values from it and display them in the main screen.

thanks in advance.
Re,
Kona

2
Mithrandir
Re: Custom block which can run php script

Create new block in System admin -> Blocks - set the type to be PHP.

Write the PHP code (without PHP start and end tags ), you are in a function scope, so variables such as $xoopsUser and $xoopsDB will have to be declared global before use.

3
konaafob
Re: Custom block which can run php script
  • 2005/1/20 15:44

  • konaafob

  • Just popping in

  • Posts: 57

  • Since: 2005/1/10


Thanks,

I tried simple syntax like echo "Hello World" and content type set to "PHP Script" but it is not displaying "Hello World"
I even tried require("/header.html"); it didn't display anything in my browser.

any thoughts.

Re,
Kona

4
konaafob
Re: Custom block which can run php script
  • 2005/1/20 15:47

  • konaafob

  • Just popping in

  • Posts: 57

  • Since: 2005/1/10


I think syntax error for echo "hello world";

I forgot ";" .. so it didn't display..

let me try require to see how it goes.

thanks for your help.

Login

Who's Online

282 user(s) are online (223 user(s) are browsing Support Forums)


Members: 0


Guests: 282


more...

Donat-O-Meter

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

Latest GitHub Commits