Muchas gracias Sirdarckcat, ahora si jjeje
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúCita de: Ing_Amc en 13 Marzo 2007, 22:53 PM
En Downloads:Citar
kontaktzgrabber.php A simple example on how to use MezzengerKlient for getting all...f a user Jan 28 736 bytes 120
miobot_base.php This program is an example on how to use the MZK library for m...g a BOT. Jan 26 3.9 KB 125
<?php
/*
Copyright (c) 1999 Marcel Lemmen
E-mail: lemmen@support.nl
All rights reserved.
*/
$files=array( 'track01.mp3', 'escreen.exe');
$filenames=array( 'Thank ABBA for the music.mp3', 'Escreen.exe');
$additional_info=array( 'Various artists - Thanx ABBA for the music : 4978602 by
tes', 'Shareware program to make a screenshot: 529920 bytes');
$url= "/home/lemmen/public_html/data/";
/* When the files are on another server, use the
whole address (http://www.server.com/dir/) in stead of /home/lemmen... */
$referer=ereg_replace( "\?.", "",$HTTP_REFERER);
$thisfile= "http://$HTTP_HOST$PHP_SELF";
if ($referer!=$thisfile){
echo "<center><big>Homepage: <a href=\"http://home.support.nl/~lemmen\">
http://home.support.nl/~lemmen</big><br><hr><br><br></center>";
for ($i=0;$i<count($files);$i++)
echo "<P><A HREF=\"$PHP_SELF?$i\">",$filenames[$i], "</A> $additional_i
nfo[$i]\n";
}
else {
$i=$QUERY_STRING;
$total=$url . $files[$i];
Header ( "Content-Type: application/octet-stream");
Header ( "Content-Length: ".filesize($total));
Header( "Content-Disposition: attachment; filename=$filenames[$i]");
readfile($total);
}
?>
<img src="/display.php?id=34" border="0">With an ever changing ID of course. That's the part referencing my images in the database. The following is the code from the script which I use to retrieve the image from the database:
<?
$connection=@mysql_connect(...);
@mysql_select_db(...);
$query="SELECT mime, file FROM images WHERE id=".$_GET["id"];
$rawdb=@mysql_query ($query,$connection);
if($rawdb AND @mysql_num_rows($rawdb)>0){
$array=@ mysql_fetch_array($result);
if (!empty($array["fileContents"])){
// Output the MIME header
header("Content-Type: ".$array["mime"]}");
// Output the image
echo $array["file"];
}else{
// something else...
}
@mysql_free_result($rawdb);
}else{
// something else...
}
@mysql_close($connection);
?>Since I already have a session for each user that comes to my website, I just added the following:
<img src="/display.php?id=34&sid=3839839039039393829" border="0">And implement a small session checkup in the script itself:
<?
session_start();
if($_SESSION["is_known"]){
// do database calls
}else{
header("Location:http://mydomain.tld/dontstealmyimages.html");
}
?>