TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

June 01, 2023, 03:48:45 AM

Login with username, password and session length
Members
  • Total Members: 3,864
  • Latest: Joonoz
Stats
  • Total Posts: 194,365
  • Total Topics: 21,157
  • Online today: 114
  • Online ever: 3,540
  • (September 03, 2022, 01:38:54 AM)
Users Online
Users: 0
Guests: 95
Total: 95

How can I use php in the center block?

Started by techbot, March 06, 2007, 08:44:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

techbot

I'm no php guru so I'm lost.  I have a simple script for random images located on my server.  I want to add a center block where this can be called and display the images on my TP center.

How can I do this?


techbot

#2
Sorry, I wasn't too clear on that...I know how to create the block...I have that in place. It's just not calling the php script.  I'm not good with php at all, so maybe I'm doing something wrong.  Do I create the block as a php block, a script block?  What php command do I use to call that file and display it?

IchBin

Depends on how your php script is created. Is it already in a file?

Then simply adding this to a phpbox block will call it in:
include('path/to/file.php');

If not, you can just paste the php code into a phpbox. Don't forget if you do this you need to leave out the beginning <?php and ending ?> tag or it will not work.