[PHP] Re: Thumbnails and access denied.
James Smith wrote: Hi, I'm having a problem with loading a page full of thumbnails. I'm useing this to load each thumbnail. header(Content-type: image/jpeg); readfile ($dir./thumbs/.$filename); but, if your connection to the server is too fast (eg, your on a lan or the same ISP with broadband) the server will display a hand full of them and then the rest won't display, and then if you try to load another page within a couple of seconds, the server gives you the 403 page Access Denied. But, when I load a page full of thumbnails that are direct links to the files it's fine. but when useing this script to read it seems to make the server pass-out momentarily. give it half a minute and it will server pages again. I have watched the server's CPU useage and memory (as it loads) and all seems fine. I have noticed that the problem goes if you run a squid proxy on the same box and it doesn't have trouble for people with slower connection eg. dial up modem. Anyone have any ideas what could be set wrong? buffer size maybe? do I have to close this function off at all? Any help much appriciated, I've been scraching my head on this for a couple of months now. J. btw - I have asked on the apache conf newsgroup with no luck. Ok, I've noticed that this happens with other Broadband ISP's, but only when they are not using a proxy. Install a proxy and it works. Anyone have any idea on where I might be able to find a setting or something... the site is http://www.digitalsnapper.net J. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] newlines in textarea boxes..
Alright, on my site, I have a news section, whenever i goto insert new news in the Admin area, I have to insert br or /n in it, while typing in the news. How do I make this a automated process I know it can be done, but addslashes doesn't work and htmlspecailchars() doesn't work what will? Thanks, James __ Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] File uploading?
Here is the code i'm running for my file upload and it work correctly: // file with submit form form name="postfile" method="post" action="./postfile.php" enctype="multipart/form-data" input type="hidden" name="MAX_FILE_SIZE" value="1000" input type="file" name="name of var" size="x" input type="submit" name="submit" value="submit" /form // This is the file that you want to use as post // example is postfile.php ?php copy($name of var_name, "/full/path/$name of var"); ? // That will copy the file. here is the full function I have implemented with my page to store path into mysql. function upload_prog($file,$filename,$des,$name,$size,$dateadded,$addedby,$type) { copy($file, "c:/full/path/to/dir/$filename"); $result = mysql_query("INSERT INTO tablename(prog_name,prog_size,prog_des,prog_url,prog_date_added,added_by,prog_type) VALUES ('$name','$size','$des','./filez/$filename','$dateadded','$addedby','$type')"); $id = mysql_insert_id(); $result = mysql_query("SELECT * FROM tablename WHERE id='$id'"); $myrow = mysql_fetch_array($result); } // this will store the path into the MySQL and you can use it as a link. Hope this helps you. James __ Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] .htpasswd?
Is there a way that when a user signs up for a user/pass on a site, to automatically update the .htpasswd on the site? Right now I'm running a Win2k Pro, with Apache installed and MySQL/PHP. Thanks, James __ Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: [PHP-DB] question ! show binary
The way you have it now, ur just storing the path to the gif. from the form field, use input type="file" name="file" then in the insert area use: $result = mysql_query("insert into (filename) VALUES ('$file')") James --- Yui Hiroaki [EMAIL PROTECTED] wrote: HI! I am using PHP in mySQL. I create table in database and insert 'binary'(*.gif). But I do not know how to use this binary using PHP and show website. Please help me. $)create table xxx (col longlob); $)insert into xxx values("image\yyy.gif"); I want to display :yyy.gif in html Thank you yui -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] __ Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] copy() ??
yes, put the whole path in the quotes, ie: copy($userfile_name, "C:/full/path/to/imgs/artiker/$userfile"); Hope that works --- Fredrik Arild Takle [EMAIL PROTECTED] wrote: I'm trying to upload i file through a webpage... -- add.php3 FORM method="post" action="do_add.php3" input type="file" size=40 name="userfile" INPUT type="submit" name="pub" value="Publiser" /form -- do_add.php3 copy($userfile, "/imgs/artikler/test.jpg"); unlink($userfile); -- ERROR msg..: Warning: Unable to create '/imgs/artikler/test.jpg': No such file or directory in c:/programfiler/apache group/apache/htdocs/do_add.php3 on line 22 -- php.ini upload_tmp_dir = c:\programfiler\apache group\apache\htdocs\temp\ Note: I'm currently running the webserver on Win98 (I know, it sucks!) Any tips anyone? - Fredrik A. Takle Bergen, Norway [EMAIL PROTECTED] __ Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Variable Problem when UPGRADING...
Alright, when i was programming with PHP3, I would use if statements like this: if(!$submit) { // display form } else { // display signup complete } to make multiple pages. Or I would do this: if($action == "signup") { if(!$submit) { //display form } else { // display signup complete } } if($action == "login") { // show login screen } But now I get an error like this: Warning: Undefined variable: submit in c:\apache\htdocs\test.php on line 3 I don't know if I misconfigured my php.ini file or what. Thanks, James __ Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]