[PHP] A strange problem..
Hi, i have a strange problem. In my site i have to counters for file downloads. One is general, other is weekly. On the main page i display a list sorted according to weekly hits. The problem is there: i give this prompt mysql_query(SELECT * FROM table ORDER BY weekly_hits DESC LIMIT 15) to display top 15 but if the hit is greater than 9 itz not displayed. What maybe the reason? Is it possible to be because of the place of the weekly_hits column in the table? When i try to sort by general hit, it does, but general hits are started with 600s so i couldn't get what happens.. Thanx for help.. __ Do you Yahoo!? Yahoo! Personals - Better first dates. More second dates. http://personals.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Download system
Hi, i want to add my site a more specific download system. The redirecting is now done by directly giving the path of the file to variable. I want to do it over an id number. (now: dl.php?rel=/files/somefile.zip, i want: dl.php?id=64b3j283) The file path and id is read from mysql table. System is now; it matches from table and lets visitor to download but putting this kind of path is something useless. Download script is just used for counting the hit but for example i want to rename the file while giving to visitor instead of letting user to learn where it is stored and its real name, The_Justice_by_Someone_MyDomain_com.zip looks like what i want to have. I tried this system with header(Location: ..); but it just opened a new page and nothing happened else. For example if visitor uses FlashGet i want him to see just an address which doesnt involve the real path and name. If any body can help me, please.. Thanx a lot.. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Download system
--- Richard Lynch [EMAIL PROTECTED] wrote: On Mon, March 21, 2005 3:45 pm, JoShQuNe \(TR\) said: Hi, i want to add my site a more specific download system. The redirecting is now done by directly giving the path of the file to variable. I want to do it over an id number. (now: dl.php?rel=/files/somefile.zip, i want: dl.php?id=64b3j283) The file path and id is read from mysql table. System is now; it matches from table and lets visitor to download but putting this kind of path is something useless. Download script is just used for counting the hit but for example i want to rename the file while giving to visitor instead of letting user to learn where it is stored and its real name, The_Justice_by_Someone_MyDomain_com.zip looks like what i want to have. I tried this system with header(Location: ..); but it just opened a new page and nothing happened else. For example if visitor uses FlashGet i want him to see just an address which doesnt involve the real path and name. If any body can help me, please.. Thanx a lot.. Some snippets of ideas that should be useful to you: Build a table that relates secret tokens to filenames: create table downloads ( token char(32) unique not null primary key, filename varchar(255), whattime time_stamp ); Generate a secret token: $token = md5(uniqid(rand(), true)); Put the file they asked for and the token in the table: $query = insert into downloads (token, filename) values ('$token', '$download'); You're on your own for the rest. -- Like Music? http://l-i-e.com/artists.htm Thanx for answer but i ve already done this part of job. I have got generated tokens for files but at the time of download i can not use the token instead of file name and path. I want to redirect to file while showing a senseless token but i can not imagine how to do it.. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can i calculate total process time?
Hi, i wanna ask if anybody knows how to calculate the total process time of a script. I guess there exists a function to perform but i dont know which one it is. I mean if u c any PHP Nuke site, it says this page is produced in seconds. I made some codes it calculates but i dont believe that it is equal to total process time.. Thanx.. __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can i calculate total process time?
Thnx for yr answers. I fixed it. Problem was the places of codes. They were line under line now i took to the beginning and itz calculating correctly.. The code was: //Beginning $mtime = explode( ,microtime()); $starttime = $mtime[1] + $mtime[0]; //Just before i print $mtime = explode( ,microtime()); $endtime = $mtime[1] + $mtime[0]; //Print prompt round($endtime-$starttime,3); Also thanx for reminding abs(), i ll use it.. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can i calculate total process time?
Hi, i wanna ask if anybody knows how to calculate the total process time. I guess there exists a function to perform but i dont know which one it is. I mean if u c any PHP Nuke site, it says this page is produced in seconds. I made some codes it calculates but i dont believe that it is equal to total process time.. Thanx.. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] I really need help...
I really need help to solve this problem. Help me to solve, please do not say to ask someone else. My problem is i have .txt file size of 3-5 kb with long rows. I have a mysql table and a column type of longtext, name html. What I have to do is: I have to open .txt and read inside and insert the content to html. My purpose is this but the problem is: I easily upload .txt to server, and read inside, BUT i can not enter it's content to html. I followed the program up to mysql query row its working correctly but when i write mysql_query(INSERT INTO abc (col1,col2,html) VALUES ('$col1','$col2','$file_contents')) or die(ERROR!); it dies and give error. My observations: I put $file_contents instead of ERROR! message i saw the content, i set the type of html column to longblob, nothing changed: ERROR!, i made another .php file which uses a form, i copied .txt's content manually into textarea, it succesfully inserted. Then i made 3 steps program; i uploaded .txt in first step then in second step i inserted the content to a textarea as it's value and at the third step i tried to add to mysql, message was: ERROR! again. I tought it may be because of touching the textarea's content and i clicked textarea and pressed SPACE BAR :) really but of course nothing changed. One more thing i tried to insert by mysql_query(UPDATE abc SET html='$file_contents' WHERE col1='$col1' and col2='$col2'); but still it answered I can not enter this variable to html. When i delete the long rows it achieves but i need them and i need to this automatically by selecting the file and inserting to mysql. Please please help me if you can. Below i've added the codes of program. I will go insane if i can not solve it. I am thinking about learning Perl to do that. Thank you very much... ?php $html=html head titleHTML document/title styleinput,textarea,td {font-family:verdana;font-size:10px;border:1px #2D7BA2 solid;background:#BECCE7} /style /head body form action='admin.php' method='POST' ENCTYPE='multipart/form-data' table align='Center' tr tdMarka:/td tdinput name='alan1' type='Text' size=30 value='$alan1'/td /tr tr tdÜrün Grubu:/td tdinput name='alan2' type='Text' size=30 value='$alan2'/td /tr tr tdAlt Ürün Grubu:/td tdinput name='alan3' type='Text' size=30 value='$alan3'/td /tr tr tdResmin türü:/td tdinput name='tur' type='Radio' value='jpg' checkedJPG input name='tur' type='Radio' value='gif'GIF/td /tr tr tdDosya:/td tdinput name='file' type='File'/td /tr tr td colspan=2 align='Center'input type='Submit' value='Yolla'/td /tr /table /form ; if(empty($HTTP_POST_VARS)){echo $html;} else { $absolute_path = ../beyazesya/Del; $size_limit = var; $limit_size = 15; $limit_ext = var; $ext_count = 2; $extensions = array(.jpg, .gif); $geri = brbra href='#' onclick='javascript:history.go(-1)'Geri/a; $endresult = 'DOSYA BAÞARIYLA GÖNDERÝLDÝ..'; if ($file_name == ) { $endresult='DOSYA SEÇMEDÝNÝZ.. $geri'; }else{ if (($size_limit == var) ($limit_size $file_size)) { $endresult = 'DOSYA ÇOK BÜYÜK, EN FAZLA 150KB OLABÝLÝR $geri'; } else { $ext = strrchr($file_name,'.'); if (($limit_ext == var) (!in_array($ext,$extensions))) { $endresult = 'DOSYA TÜRÜ YALNIZCA .ZIP VEYA .RAR OLABÝLÝR.. $geri'; }else{ [EMAIL PROTECTED]($file, $absolute_path/file.txt) or die(DOSYA KOPYALANAMADI.. $geri); $dosyam=../beyazesya/Del/file.txt; $fp=fopen($dosyam,r) or die(Cant open file); while(!feof($fp)){ $buf = fgets($fp,8192); $buffer=$buffer.$buf; } $buffer=eregi_replace(\t,,$buffer); $buffer=trim($buffer); $f_a=$file_name; $model=str_replace(.txt,,$f_a); $resim=$model.$tur; mysql_connect(xxx,yyy,zzz); mysql_select_db(aaa); $bb=mysql_query(SELECT * FROM beyaz WHERE alan1='$alan1' AND alan2='$alan2' AND alan3='$alan3' AND model='$model'); $say_bb=mysql_num_rows($bb); if($say_bb1) { $b=mysql_query(INSERT INTO beyaz (alan1,alan2,alan3,resim,model,html) VALUES ('$alan1','$alan2','$alan3','$resim','$model','$buffer')) or die(ERROR!); if($b) {echo $html; $yazili=mysql_query(SELECT * FROM beyaz WHERE alan1='$alan1' AND alan2='$alan2' AND alan3='$alan3'); echo table align=centertrtd; $top_yaz=mysql_num_rows($yazili); echo Toplam: b$top_yaz/bhr; while($read=mysql_fetch_row($yazili)) { echo $read[4]br; } echo /td/tr/table; }} else echo (this record is done before); fclose ($fp); unlink(../beyazesya/Del/file.txt); $buffer=0; ? /body /html __ Do you Yahoo!? Send holiday email and support a worthy cause. Do good. http://celebrity.mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php