wcf.regNote.message

). wär ich für jede hilfe dankbar

|
|
PHP Source code |
1 2 3 4 5 6 7 8 9 10 |
$result = $db->query_first("SELECT count(*) FROM bb".$n."_fotovoting_bilder");
$minid = 1;
$maxid = $result['0'];
mt_srand((double)microtime()*1000000);
$bilder = mt_rand(0,count($ausgabebild)-1);
$result = $db->query("SELECT * FROM bb".$n."_fotovoting_bilder WHERE bilderid = '".$zufallszahl."'");
if ($_FILES = $db->fetch_array($result)) {
$ausgabebild ="./fotovoting/".$_FILES['bilder']['name'];
}
|

|
|
PHP Source code |
1 2 3 4 5 6 7 8 9 |
$result = $db->query_first("SELECT count(*) FROM bb".$n."_fotovoting_bilder");
$minid = 1;
$maxid = $result['0'];
mt_srand((double)microtime()*1000000);
$zufallszahl = mt_rand($minid,$maxid);
$result = $db->query("SELECT * FROM bb".$n."_fotovoting_bilder WHERE bilderid = '".$zufallszahl."'");
if ($bilder = $db->fetch_array($result)) {
$ausgabebild ="./fotovoting/$bilder[bildname]".".".$bilder[dateiendung];
}
|
Quoted
DROP TABLE IF EXISTS `bb1_fotovoting_bilder`;
CREATE TABLE `bb1_fotovoting_bilder` (
`bilderid` int(11) NOT NULL auto_increment,
`bilder` varchar(100) NOT NULL default '0',
`bild_name` varchar(100) NOT NULL default '0',
`comment` varchar(255) NOT NULL default '0',
KEY `bilderid` (`bilderid`)
) TYPE=MyISAM AUTO_INCREMENT=17 ;
|
|
PHP Source code |
1 2 3 4 5 6 7 8 9 |
$result = $db->query_first("SELECT count(*) FROM bb".$n."_fotovoting_bilder");
$minid = 1;
$maxid = $result['0'];
mt_srand((double)microtime()*1000000);
$zufallszahl = mt_rand($minid,$maxid);
$result = $db->query("SELECT * FROM bb".$n."_fotovoting_bilder WHERE bilderid = '".$zufallszahl."'");
if ($bilder = $db->fetch_array($result)) {
$ausgabebild ="./fotovoting/$bilder[bild_name]";
}
|
|
|
PHP Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
<?php
$filename = 'fotovoting_upl.php';
require('./global.php');
if (!ini_get('register_globals')) { //globals = OFF ??
$types_to_register = array('GET','POST','COOKIE','SESSION','SERVER');
foreach ($types_to_register as $type){
if (@count(${'HTTP_' . $type . '_VARS'}) > 0){
extract(${'HTTP_' . $type . '_VARS'}, EXTR_OVERWRITE);
}
}
}
$lang->load('FOTOVOTING');
//if (!$wbbuserdata['can_fotovoting_bild_upload']) access_error();
if($action=="add"){
$uploaddir = "./fotovoting/" ;
if (move_uploaded_file($_FILES['bilder']['tmp_name'], $uploaddir . $_FILES['bilder']['name'])) {
$ausgabebild ="fotovoting/".$_FILES['bilder']['name'];
} else {
$ausgabebild="";
}
}
$db->query("INSERT INTO bb".$n."_fotovoting_bilder SET bild_name='".addslashes($bild_name)."',comment='".addslashes($comment)."',bilder='".$ausgabebild."'");
eval("\$tpl->output(\"".$tpl->get("fotovoting_upl")."\");");
?>
|
This post has been edited 1 times, last edit by "Günny" (Jul 22nd 2005, 3:19pm)

|
|
PHP Source code |
1 2 3 4 |
$result = $db->query("SELECT * FROM bb".$n."_fotovoting_bilder ORDER BY RAND() LIMIT 1");
if ($bild = $db->fetch_array($result)) {
$ausgabebild ="./fotovoting/$bild[bild_name]";
}
|