Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9199729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:36:06+00:00 2026-06-17T22:36:06+00:00

I have created a script which takes a random IMAGE ID from the database,

  • 0

I have created a script which takes a random IMAGE ID from the database, converts it to a valid file name and then I use it to generate random images from a link.

This is how such a link looks like (works – try it):
http://imgit.org/roll.php?image=3J9N0Y4k8g4l4G7

When you reload that link, you’ll notice the image changes. If I add this image to <img src="THAT LINK" /> it works, however, it doesn’t work on message board like phpBB or vBulletin when I put that link inside [img][/img] BBCode tags.

I suppose there is a problem with my script, because there are various services out there that do exactly the same thing (link on forums) and it works.

Here is my roll.php script:

<?php

$imgit_root_path = '.';
include("{$imgit_root_path}/common.php");

if ($config['disable_roll'])
{
    redirect('index.php');  
}

$roll_key = request_var('image', '');
$roll_key = substr($roll_key, 0, 15);

if (!$roll_key)
{
    redirect('index.php?action=404');   
}

if (!$image->roll_key_exists($roll_key))
{
    redirect('index.php?action=404');   
}

$images = $image->roll_info($roll_key);
$images = explode('|', $images);

$count = sizeof($images);
$index = mt_rand(0, $count - 1);

$extList = array();
$extList['gif']  = 'image/gif';
$extList['jpg']  = 'image/jpeg';
$extList['jpeg'] = 'image/jpeg';
$extList['png']  = 'image/png';

$image_url  = generate_site_url() . IMAGES_PATH . $image->get_name($images[$index]);
$image_inf  = pathinfo($image_url);

header('Content-type: ' . $extList[$image_inf['extension']]);
readfile($image_url);
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T22:36:07+00:00Added an answer on June 17, 2026 at 10:36 pm

    I believe the problem may be that phpBB will disallow links which aren’t confirmed as images. That is, don’t have a known image extension, such as .jpg;

    https://www.phpbb.com/community/viewtopic.php?f=46&t=1285255

    For security reasons, images whose extensions cannot be confirmed
    (such as in the first example) aren’t allowed by BBCode. Instead of an
    image, it’s fully possible for someone to embed a JavaScript script,
    or even worse, onto a page which could be a security risk to anyone
    visiting the page, or possibly even the server.

    This is most likely the same in vBulletin.

    Seems you can override it in the forum settings maybe?

    Alternatively, if you can change you script, so that you can append a “.jpg” extension to the end, then that may also work!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a script which takes names from my db and for each name
I have a script which prints out messages from within a database. Each message
I have built a simple script which takes a string and converts it to
I have a task of creating a script which takes a huge text file
I need to have an executable file (.exe) which takes some parameters from a
I have created a PHP script which builds a table from an XML document
I have created a shell script to backup my webfiles + database dump, put
I have created a php script to import rss feed into the database. The
I'm trying to write a Python script which takes a special type of file
I have a shell script which I'd like to trigger from a J2EE web

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.