Jump to content

Semas

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Everything posted by Semas

  1. After i updated PHP to new version this is happening to every single variable in my all codes...
  2. $i = 0 One more thing: I edited the code: <?php $i = 0; function rate($awsome, $very_good, $good, $not_good, $bad){ $total = $awsome + $very_good + $good + $not_good + $bad; $vawsome = $awsome / $total * 100; $vvgood = $very_good / $total * 100; $vgood = $good / $total * 100; $vbad = $not_good / $total * 100; $vvbad = $bad / $total * 100; echo " <table border=\"0\">\n"; echo " <tr>\n <td align=\"right\">Awsome: </td>\n <td>"; while($i < round($vawsome)){ echo "|"; $i++; } echo $vawsome."</td>\n </tr>\n"; $i = 0; echo " <tr>\n <td align=\"right\">Very good: </td>\n <td>"; while($i < round($vvgood)){ echo "|"; $i++; } echo $vvgood."</td>\n </tr>\n"; $i = 0; echo " <tr>\n <td align=\"right\">Good: </td>\n <td>"; while($i < round($vgood)){ echo "|"; $i++; } echo $vgood."</td>\n </tr>\n"; $i = 0; echo " <tr>\n <td align=\"right\">Bad: </td>\n <td>"; while($i < round($vbad)){ echo "|"; $i++; } echo $vbad."</td>\n </tr>\n"; $i = 0; echo " <tr>\n <td align=\"right\">Very bad: </td>\n <td>"; while($i < round($vvbad)){ echo "|"; $i++; } echo $vvbad."</td>\n </tr>\n"; $i = 0; echo " </table>\n"; } ?>
  3. Hello everyone again. I'll try to explain what problems i have. 1st. When i define variables I'm keep getting: Notice: Undefined variable: i in D:\wamp\www\a.php on line 12 Notice: Undefined variable: i in D:\wamp\www\a.php on line 13 Notice: Undefined variable: i in D:\wamp\www\a.php on line 14 Notice: Undefined variable: i in D:\wamp\www\a.php on line 15 Notice: Undefined variable: i in D:\wamp\www\a.php on line 15 2Nd. Here is the code : <?php $i = 0; function rate($awsome, $very_good, $good, $not_good, $bad){ $total = $awsome + $very_good + $good + $not_good + $bad; $vawsome = $total / 100 * $awsome; $vvgood = $total / 100 * $very_good; $vgood = $total / 100 * $good; $vbad = $total / 100 * $not_good; $vvbad = $total / 100 * $bad; echo " <br />Awsome: "; while($i < round($vawsome)){ echo "|"; $i++; } $vawsome; echo " <br />Very good: "; while($i < round($vvgood)){ echo "|"; $i++; } $vvgood; echo " <br />Good: "; while($i < round($vgood)){ echo "|"; $i++; } $vgood; echo " <br />Bad: "; while($i < round($vbad)){ echo "|"; $i++; } $vbad; echo " <br />Very bad: "; while($i < round($vvbad)){ echo "|"; $i++; } $vvbad; } echo rate(1, 2, 3, 4, 5); ?> Apache2.2.11 || php5.2.8
  4. Ok... found prblem... with new php is different coding, i didnt knew it. Still found what problem i had.
  5. Filepaths are ok. But im not sure about the permisions... And there is no errors.
  6. I offer you to get Wamp (http://www.wampserver.com/en/) it works fine, and when latest updates comes out you can get em instantly. Using it i never had any errors like thet.
  7. There you go. Hope it will help. [attachment deleted by admin]
  8. If anyone has any ideas tell me.
  9. Hello everyone, i have some problems using readfile(); it worked before i reinstalled windows and now... it doesn't. Here is the code: <?php include("config.php"); //there is connection to mysql server and so on... $query = mysql_query("SELECT * FROM files WHERE file_code=\"{$_GET['file']}\""); //selects a file from mysql server with hash that is in url $result = mysql_fetch_array($query); //puts everything in array /* im not sure but i think there is one more problem with headers */ if($result['file_type'] == "Image"){ $header = "Content-type: image/jpg"; $dir = "images"; $dl_header = "Content-Disposition: attachment; filename=\"$site_linkimages/{$result['file_name_full']}\""; }else if($result['file_type'] == "Flash"){ $header = "Content-type: application/x-shockwave-flash"; $dir = "flash"; $dl_header = "Content-Disposition: attachment; filename=\"$site_linkflash/{$result['file_name_full']}\""; }else if($result['file_type'] == "Games"){ $header = "Content-type: application/x-shockwave-flash"; $dir = "games"; $dl_header = "Content-Disposition: attachment; filename=\"$site_linkgames/{$result['file_name_full']}\""; }else if($result['file_type'] == "Music"){ $header = "Content-type: audio/mpeg"; $dir = "music"; $dl_header = "Content-Disposition: attachment; filename=\"$site_linkmusic/{$result['file_name_full']}\""; } if($_GET['type'] == "download"){ if(mysql_num_rows($query) > 0){ /* i can download the file */ header($header); header($dl_header); header("Content-Type: application/download"); header("Content-Length: ".filesize("$dir/{$result['file_name_full']}")); readfile("$dir/{$result['file_name_full']}"); } }else if($_GET['type'] == ""){ if(mysql_num_rows($query) > 0){ /* download works but readinng and displayng in site dosent work, i have no idea why. */ header($header); readfile("$dir/{$result['file_name_full']}"); }else { header("Location: $site_link"); } } ?> P.S. When i open files directly trough browser i can see them, but when using files.php and this code it does not work P.SS. If I'm doing something wrong, tell me. examples: http://78.63.197.71/?page=Files&type=Image&file=525bceda113719785656d3b3b238336b http://78.63.197.71/images/funny-hellos-172.jpg
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.