GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   PHP Experts! Help me please :) (https://gfy.com/showthread.php?t=838661)

xentech 07-02-2008 05:39 AM

PHP Experts! Help me please :)
 
http://bigtitsvideos.info/dl.php?id=5

I'm trying to display an image which is stored in a mediumblob table field, any ideas? Here is my code:

Code:

<?php
include "config.php";
$result = mysql_query("select * from [MASKED] where id = '$id'");

while($r=mysql_fetch_array($result))
{       
  $content=$r["content"];
  $type=$r["type"];

header("Content-type: $type");
echo ($content);
}

mysql_close($connection);
?>


JayS 07-02-2008 05:45 AM

Quote:

Originally Posted by xentech (Post 14402695)
I'm trying to display an image which is stored in a mediumblob table field, any ideas? Here is my code:

Don't store it in a DB :2 cents: Would be helpfull if you can mention where the error is...

xentech 07-02-2008 05:47 AM

Quote:

Originally Posted by JayS (Post 14402704)
Don't store it in a DB :2 cents: Would be helpfull if you can mention where the error is...

http://bigtitsvideos.info/dl.php?id=5

Go to that url, for me it just shows "http://bigtitsvideos.info/dl.php?id=5" instead of an image... And I thought storing it in a DB would be easier but apparently not, I just can't see how its not working. Perhaps it is to do with my PHP settings?

xentech 07-02-2008 05:48 AM

Ignore everything I just said, I am a fucking idiot. Thanks anyway :)

JayS 07-02-2008 05:51 AM

Quote:

Originally Posted by xentech (Post 14402715)
Ignore everything I just said, I am a fucking idiot. Thanks anyway :)

Some old debug code in your config.php? :winkwink:

xentech 07-02-2008 06:09 AM

Quote:

Originally Posted by JayS (Post 14402724)
Some old debug code in your config.php? :winkwink:

Nah I had

Code:

$content=$r["content"];
instead of

Code:

$content=$r["image"];
That is the worst part about programming, some problems can just marvel you for ages and you can't figure out what they are. Then they turn out to be the most simple things you have missed.

mike-al 07-02-2008 06:21 AM

Not sure what book you have that is teaching you, but please burn it ASAP

Serge Litehead 07-02-2008 06:23 AM

Quote:

Originally Posted by JayS (Post 14402704)
Don't store it in a DB :2 cents:

stored image in DB could also mean simply stored reference to it which is useful some times.

xentech 07-02-2008 06:27 AM

Quote:

Originally Posted by mike-al (Post 14402832)
Not sure what book you have that is teaching you, but please burn it ASAP

I just ripped some code from some random tutorial, never worked with images in SQL before. Why, is it insecure?

JayS 07-02-2008 06:35 AM

Quote:

Originally Posted by xentech (Post 14402867)
I just ripped some code from some random tutorial, never worked with images in SQL before. Why, is it insecure?

You may check out en.wikipedia.org/wiki/SQL_injection and I highly recommend that you better not use every piece of code that you can find on the web unless you have checked it :2 cents:


All times are GMT -7. The time now is 06:12 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123