Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
xGSTQ
Involved
Involved



Joined: Feb 03, 2006
Posts: 269

PostPosted: Fri Dec 01, 2006 1:23 pm Reply with quote

This is a nice bit of code that you can link any image on your site to just show a pic and a java go back

it just sits in the root of your site as PicShow.php


Code:
<?php

/************************************************************************/
/* Random Image Block Version 2.0.0 Feb 27, 2005                        */                   
/************************************************************************/
include("mainfile.php");
//define('INDEX_FILE', true);
$extensions = "\.(gif|jpg|jpeg|png|bmp)$";
  if (($show != "") && (ereg($extensions, $show))) {
    include("header.php");
    OpenTable();
   echo "<br><center>"._GOBACK."<br>";
    echo "<br /><img src=\"$show\"></a><br /><br />\n";
    echo ""._GOBACK."<br /></center>";
    CloseTable();
    include("footer.php");
  } else {
    header("Location: ../index.php");
  }
 
?>


so if you had a link like <a href='show=$img'>

Change it to <a href='PicShow.php?show=$img'> it will open in a new window well thats the general therory.. it does work

My question is how can i make it full width i.e. no left blocks, is it possible ?

Thx

ped
 
View user's profile Send private message Send e-mail
evaders99
Former Moderator in Good Standing



Joined: Apr 30, 2004
Posts: 3221

PostPosted: Fri Dec 01, 2006 3:27 pm Reply with quote

Just remove the include header and footer lines
Also the Table functions if you don't want those to display

That code is terribly insecure. There is no filtering on the $show variable besides checking for the file extension. It may allow some cross-site scripting attacks. At a minimum, I would use check_html($show, 'nohtml')

_________________
- Only registered users can see links on this board! Get registered or login! -

Need help? Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
xGSTQ







PostPosted: Fri Dec 01, 2006 3:52 pm Reply with quote

Cheers evaders i took out what u suggested and it nuked it, lol i was hoping to keep it inside the site still but just without left blocks ... no worries i appreciate your assistance.

Where would i place check_html($show, 'nohtml') out of intreast ? thx
 
evaders99







PostPosted: Fri Dec 01, 2006 4:14 pm Reply with quote

Without the left blocks only, you would need to a little more complex code hack.
Something like this, except you'd have to set a different variable other than using $name
http://www.ravenphpscripts.com/nukemanual-hide-left-blocks.html

Code:


BEFORE

echo "<br /><img src=\"$show\"></a><br /><br />\n";

ADD

$show = check_html($show, 'nohtml');
 
xGSTQ







PostPosted: Fri Dec 01, 2006 4:26 pm Reply with quote

cheers that code worked, problem being its not a module it just sits in the root as a file ... might try placing it inside the module see if that works
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©