Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 07-02-2008, 05:39 AM   #1
xentech
Confirmed User
 
xentech's Avatar
 
Join Date: Jan 2006
Location: England
Posts: 1,405
:stop 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);
?>
xentech is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2008, 05:45 AM   #2
JayS
Confirmed User
 
JayS's Avatar
 
Join Date: Oct 2007
Posts: 138
Quote:
Originally Posted by xentech View Post
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 Would be helpfull if you can mention where the error is...
JayS is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2008, 05:47 AM   #3
xentech
Confirmed User
 
xentech's Avatar
 
Join Date: Jan 2006
Location: England
Posts: 1,405
Quote:
Originally Posted by JayS View Post
Don't store it in a DB 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 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2008, 05:48 AM   #4
xentech
Confirmed User
 
xentech's Avatar
 
Join Date: Jan 2006
Location: England
Posts: 1,405
Ignore everything I just said, I am a fucking idiot. Thanks anyway
xentech is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2008, 05:51 AM   #5
JayS
Confirmed User
 
JayS's Avatar
 
Join Date: Oct 2007
Posts: 138
Quote:
Originally Posted by xentech View Post
Ignore everything I just said, I am a fucking idiot. Thanks anyway
Some old debug code in your config.php?
JayS is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2008, 06:09 AM   #6
xentech
Confirmed User
 
xentech's Avatar
 
Join Date: Jan 2006
Location: England
Posts: 1,405
Quote:
Originally Posted by JayS View Post
Some old debug code in your config.php?
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.
xentech is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2008, 06:21 AM   #7
mike-al
Confirmed User
 
Join Date: Aug 2007
Posts: 691
Not sure what book you have that is teaching you, but please burn it ASAP
__________________
Delete this account, i am done here
mike-al is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2008, 06:23 AM   #8
Serge Litehead
Confirmed User
 
Serge Litehead's Avatar
 
Industry Role:
Join Date: Dec 2002
Location: Behind the scenes
Posts: 5,190
Quote:
Originally Posted by JayS View Post
Don't store it in a DB
stored image in DB could also mean simply stored reference to it which is useful some times.
__________________
Serge Litehead is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2008, 06:27 AM   #9
xentech
Confirmed User
 
xentech's Avatar
 
Join Date: Jan 2006
Location: England
Posts: 1,405
Quote:
Originally Posted by mike-al View Post
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?
xentech is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2008, 06:35 AM   #10
JayS
Confirmed User
 
JayS's Avatar
 
Join Date: Oct 2007
Posts: 138
Quote:
Originally Posted by xentech View Post
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
JayS is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.