Re: [PHP] dl(): Invalid library (maybe not a PHP library)
Okay, solved that as well. SED environment variable was not defined! How come I had to define it myself?! Shouldn't the build process take care of that? Anyway, now when I try to load the extension my_ext.la in my PHP as follows: if(!extension_loaded('my_ext')) { dl('my_ext.la'); } I get the following error: Warning: dl(): Unable to load dynamic library '/usr/local/apache/htdocs/my_ext.la' - /usr/local/apache/htdocs/my_ext.la: invalid ELF header in /usr/local/apache/htdocs/my_ext.php on line 4 It is very strange to see this error. I have done all my development on one Redhat Linux box. I didn't switch OS platforms. Please advise. Thanks. Anas Mughal wrote: I found one problem. I had to add "=shared" after --enable-my_ext. So, this is what I did: ./configure --enable-my_ext=shared Now, the makefile looks much better. (I have attached the Makefile.) However, I get errors in make. Those errors are generated when invoking the libtool command. ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dl(): Invalid library (maybe not a PHP library)
I figured it out! I was loading the wrong file (slap-on-the-forehead). Sorry about my last email. Curt, thank you for helping me out. Now, my first dummy extension is working :)) Anas Mughal wrote: Okay, solved that as well. SED environment variable was not defined! How come I had to define it myself?! Shouldn't the build process take care of that? Anyway, now when I try to load the extension my_ext.la in my PHP as follows: if(!extension_loaded('my_ext')) { dl('my_ext.la'); } I get the following error: Warning: dl(): Unable to load dynamic library '/usr/local/apache/htdocs/my_ext.la' - /usr/local/apache/htdocs/my_ext.la: invalid ELF header in /usr/local/apache/htdocs/my_ext.php on line 4 It is very strange to see this error. I have done all my development on one Redhat Linux box. I didn't switch OS platforms. Please advise. Thanks. Anas Mughal wrote: I found one problem. I had to add "=shared" after --enable-my_ext. So, this is what I did: ./configure --enable-my_ext=shared Now, the makefile looks much better. (I have attached the Makefile.) However, I get errors in make. Those errors are generated when invoking the libtool command. ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] converting string into array with regex
"CPT John W. Holmes" wrote: > From: "Adam i Agnieszka Gasiorowski FNORD" <[EMAIL PROTECTED]> > > > No, no spaces between letters (otherways > > it would be very easy, indeed). So there is > > no way to match the "space between alphanumeric > > chars" and split on it? I was trying to avoid > > the loop solution. > > Of course there is. In fact, this example, direct from the manual, does > exactly what you want... > > $str = 'string'; > $chars = preg_split('//', $str, -1, PREG_SPLIT_NO_EMPTY); > print_r($chars); > ?> > Imagine that!---John Holmes... LOL! :8]] You are SO right. I just KNEW the solution existed, I must have even read it a long time ago in the very manual... Sorry for wasting your precious time :8]. Thank you and all the others that tried to help! -- Seks, seksić, seksolatki... news:pl.soc.seks.moderowana http://hyperreal.info { iWanToDie } WiNoNa) ( http://szatanowskie-ladacznice.0-700.pl foReVeR( * ) Poznaj jej zwiewne kształty... http://www.opera.com 007 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache 2 + PHP
it doesn't matter! whatever u think, and what your job is. it's all up to IT manager(?) are they listen to us or do they know what's the newest verion in php or mysql. i wouldn't think so (it got to kidding!) as we are professional... we got to act like a real prof. but.. ? here u go! my dev. env. is on win2k pro + sp4, php 5.00b2, apache 2.0.48, mysql 4.0.16, MS Access(?), XML, XSLT and without worries. production env. - i do not care (actually i can't do anything about it.) but recommend whatever linux (free), and php 4.3.4, apache 2.0.48, and mysql 4.0.16. in real life, our server runs php 4.1x, mysql 3.0x, apache 1.3.x. (register_globals = on, what a life, but i codes it eveything for OFF so that it should work later on if they upgraded it php 5.0x, r they?). is there anyone check updates except us. that's my story. Yves Arsenault wrote: Would anyone know of the issues that might affect PHP 4.3.4 and Apache 2.0.48 ? Thanks, Yves -Original Message- From: Martin Hudec [mailto:[EMAIL PROTECTED] Sent: 5 décembre 2003 10:52 To: PHP-General Subject: Re: [PHP] Apache 2 + PHP Hi there, when I had Gentoo Linux, I was using Apache 2.0.48 with PHP 4.3.4 installed from Gentoo portage. It was running <10 smallscale php/mysql based virtualhosts without any difficulties. On Friday 05 December 2003 15:24, Yves Arsenault wrote: Is this warning outdated? http://www.php.net/manual/en/install.apache2.php "Do not use Apache 2.0 and PHP in a production environment neither on Unix nor on Windows." I'm running RedHat 9. I've got Apache 2.0.48 running and was ready to install the latest php 4.3.x.. Just thought I would check. -- : :. kind regards :.. Martin Hudec :.: :.: =w= http://www.aeternal.net :.: =m= +421.907.303393 :.: [EMAIL PROTECTED] [EMAIL PROTECTED] :.: :.: "When you want something, all the universe :.: conspires in helping you to achieve it." :.: - The Alchemist (Paulo Coelho) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP RSS sites and SlashDot
Ryan A wrote: Hi, I am totally new to using RSS feeds and need a little help. I downloaded a few good classes to use RSS but dont know where to get the feeds from... Say hello to www.syndic8.com :D (had the same problem trying to get a list of feeds for my own non-commercial site) our site is going to be totally PHP geared: eg: PHP Articles Program snippets (forum (maybe)) etc Any idea how I can get a feed from Slashdot? or any other good programming\tech sites Some sites that provide RSS feeds also include this tag in their HTML : http://www.domain.com/path/to/feed.xml"; /> You could search for that. If you have a windows computer around, I would recommend downloading a copy of FeedDemon [ http://www.bradsoft.com/feeddemon/index.asp ] (yes, that's the same guy that created TopStyle) -- it comes with a lot of Web Development related feeds (you can then use the URLs in your own reader). am basically trying to get a feed from around 4 sites for around 5 links each... http://www.zend.com/zend_rss.php is a good one to have -- Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com --- "Documentation is like sex: when it is good, it is very, very good; and when it is bad, it is better than nothing." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can't exec() a program that uses mem alloc?
I am trying tooth and nail to create a method of copying a string of text to the server's clipboard via php. I have found a couple of short pieces of code to do exactly that in C, so compiled the program and in a command prompt it works like a charm - in my case it reads the contents of a text file and copies that to the clipboard. I then try using a php script to execute that file using shell_exec(), exec() and system() to no luck, every time the command: $outpt = shell_exec("clipboard.exe") or die ("failed to execute");Would just print out the die message. I set about writing my own C program to copy the contents of the text file first to the screen, and then to a char array which could then be passed to the clipboard. All of these self made programs could be executed by shell_exec() - so I thought I was finally onto a winner. However it seems that I can't just pass a char array to SetClipboardData - it has to be a block of Globally Movable memory, which sadly I don't understand. Is there any reason why PHP shell_exec() or other execution commands are unable to run a program that tampers with memory? I can't say I understand.. The other question would be - how could I modify either of the exe files to work with PHP? Thankyou for your time and knowledge :) clipper.php <-- php code for shell_exec commands. change which line is commented to test the second method clipboard.cpp <-- clipboard executable found from google, works in command prompt but 'fails to execute' with PHP clipper.cpp <-- clipboard executable I wrote, which doesn't actually work, but can be executed with PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 6 Dec 2003 12:54:36 -0000 Issue 2457
php-general Digest 6 Dec 2003 12:54:36 - Issue 2457 Topics (messages 172032 through 172054): Maximum execution time 172032 by: John J Foerch 172033 by: Pablo Gosse 172038 by: James Hicks Re: Spamming bastardly problem, please help 172034 by: John Nichel 172035 by: Vail, Warren 172036 by: Vail, Warren 172037 by: John Nichel 172039 by: John Nichel 172040 by: Ajai Khattri 172044 by: Ryan A Whitespace filter 172041 by: Justin Hendrickson 172042 by: Chris W. Parker 172043 by: John Coggeshall Re: Not able to execute Linux binary 172045 by: Karam Chand count() 172046 by: Anthony Ritter Re: Invalid library (maybe not a PHP library) 172047 by: Anas Mughal 172049 by: Anas Mughal 172050 by: Anas Mughal UIEE? 172048 by: Leif K-Brooks Re: converting string into array with regex 172051 by: Adam i Agnieszka Gasiorowski FNORD Re: Apache 2 + PHP 172052 by: Seung Hwan Kang Re: PHP RSS sites and SlashDot 172053 by: Burhan Khalid Can't exec() a program that uses mem alloc? 172054 by: Iain Staffell Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- --- Begin Message --- Hi, Is there some way to turn off maximum execution time? Preferably within the script itself? Thanks, John --- End Message --- --- Begin Message --- John J Foerch wrote: > Hi, > Is there some way to turn off maximum execution time? > Preferably within the script itself? Thanks, John ini_set('max_execution_time',0); --- End Message --- --- Begin Message --- On Friday 05 December 2003 05:22 pm, John J Foerch wrote: > Hi, > Is there some way to turn off maximum execution time? Preferably > within the script itself? > Thanks, > John set_time_limit(0); zero is for not timeout, change to # of seconds if you want. James --- End Message --- --- Begin Message --- Ryan A wrote: Hi, Some son of a * is spamming people and using one or our websites as a return address, so all the emails that get bounced are coming right back to us, as you can imagine thats quite a lot, plus we are getting angry people writing to us. I had a look at the emails and I see its the usual crap: viagra, prescription meds and getting collage degrees etc What can I do about it? complaining to the sites that the spam is promoting is stupid since they are using this method to promote their crap Problem is we have a catch all address as the site is large and we have been using differient email ids all around the place which basically goes into one, so turning of the catch all can/would result in us missing some important stuff... ANY ideas? Thanks, -Ryan Same problem with my by-tor.com domain. First thing I checked was to make sure that I wasn't an open relay...make sure the spammers aren't using your mail server. Most of the headers are forged, so tracking them down is almost impossible. And if you complain to the site that these emails are linking too, they'll just say it's not them, but someone in an affiliate program...they might even tell you that they banned that user, but can't do anything about them sending the emails. Basically, there's not much you can do save reply nicely to the people who've come to you because they got spammed. -- By-Tor.com It's all about the Rush http://www.by-tor.com --- End Message --- --- Begin Message --- http://spamassassin.org/index.html you might also try filtering on the body looking for a common phrase. Spam assassin looks for phrases like "you opted" and instructions on how to stop receiving these emails, a single source will often use the same opt out phrase. hang in there, you can lick this Warren -Original Message- From: Eric Bolikowski [mailto:[EMAIL PROTECTED] Sent: Friday, December 05, 2003 2:27 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: Spamming bastardly problem, please help "Ryan A" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > Some son of a * is spamming people and using one or our websites as a > return address, so all the emails that get bounced are coming right back to > us, as you can imagine thats quite a lot, plus we are getting angry people > writing to us. > > I had a look at the emails and I see its the usual crap: viagra, > prescription meds and getting collage degrees etc > > What can I do about it? complaining to the sites that the spam is promoting > is stupid since they are using this method to promote their crap > > Problem is we have a catch all address as the site is large and we have been > using differient email ids all around the place which basically goes into > one, so turning of the catch all can/would result in us missin
Re: [PHP] count()
Anthony Ritter wrote: Greetings- I'm have the follwing string called $text and throughout this string I'd like to split this into an array by calling spliti() at the tag called PAGEBREAK. So, I count the array elements starting at 0 and get to 9. When I call count(), I get 11. Could somebody please explain why this is? Thank you. TR . aaa[PAGEBREAK] //this is the 0 element bbb[PAGEBREAK] //[1] ccc[PAGEBREAK] //[2] ddd[PAGEBREAK] //[3] eee[PAGEBREAK] //[4] fff[PAGEBREAK] //[5] ggg[PAGEBREAK] //[6] hhh[PAGEBREAK] //[7] iii[PAGEBREAK] //[8] jjj[PAGEBREAK] //...and this is the 9th element "; There are 10 '[PAGEBREAK]' substrings in the string. If the string is split apart at these substrings, it will give you total 11 parts. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache 2 + PHP
Yves: I am not sure of the exact technical issues that affect it, but when I was forced to use it in a production environment (does anyone actually admit to CHOOSING to use it? anyway) I received a lot of errors on includes, intermittently. This was most noticable when using phpmyadmin - but it was noticed throughout the application. Errors including a file, then you refresh and there are no errors. In general the webserver was very unstable, prone to hanging processes and needing the webserver stopped and restarted. In the beginning it was no big deal - once twice a week, but in the last 3 weeks it has been 5-6 times a day. We just switched to Apache 1.3.2 (using PHP 4.3.4 on both machines.) and we have had 0 problems across the board in 3 days of operation now. So there you go - if you are OK with instability then go for it - if not, choose Apache 1.3.x PS. Anyone out there know/work with PLESK? 6.0 comes with Apache 2.0 and PHP 4.3.something - I want to 'downgrade' it to apache 1.3 - but *shrug* no idea. If there is anyone out there that has done It successfully, msg me offline to chat. WHY OH WHY do these companies not work WITH the php community? If only they had asked Itools is the same way (server manager for Mac OSX - for the love of GOD DO NOT EVER USE IT! That is what was forced upon us and caused the above problems - you could not use it unless you used Apache 2, and they 'said' that there are no 'instabilities' with PHP - either they lied or just have a terrible QC division!!!) On 12/5/03 1:00 PM, "Yves Arsenault" <[EMAIL PROTECTED]> wrote: > > Would anyone know of the issues that might affect PHP 4.3.4 and Apache > 2.0.48 ? > > Thanks, > > Yves > > -Original Message- > From: Martin Hudec [mailto:[EMAIL PROTECTED] > Sent: 5 décembre 2003 10:52 > To: PHP-General > Subject: Re: [PHP] Apache 2 + PHP > > > Hi there, > > when I had Gentoo Linux, I was using Apache 2.0.48 with PHP 4.3.4 installed > from Gentoo portage. It was running <10 smallscale php/mysql based > virtualhosts without any difficulties. > > On Friday 05 December 2003 15:24, Yves Arsenault wrote: >> Is this warning outdated? >> http://www.php.net/manual/en/install.apache2.php >> "Do not use Apache 2.0 and PHP in a production environment neither on Unix >> nor on Windows." >> I'm running RedHat 9. >> >> I've got Apache 2.0.48 running and was ready to install the latest php >> 4.3.x.. >> Just thought I would check. > -- > : > :. kind regards > :.. Martin Hudec > :.: > :.: =w= http://www.aeternal.net > :.: =m= +421.907.303393 > :.: [EMAIL PROTECTED] [EMAIL PROTECTED] > :.: > :.: "When you want something, all the universe > :.: conspires in helping you to achieve it." > :.: - The Alchemist (Paulo Coelho) > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Cheers Mike Morton * * Tel: 905-465-1263 * Email: [EMAIL PROTECTED] * "Indeed, it would not be an exaggeration to describe the history of the computer industry for the past decade as a massive effort to keep up with Apple." - Byte Magazine Given infinite time, 100 monkeys could type out the complete works of Shakespeare. Win 98 source code? Eight monkeys, five minutes. -- NullGrey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] POST upload script timeout
I have a script on my local machine to allow friends to send me files, as IM or FTP transfers don't work, and so I would like to accept reasonably large files (10mb max). I followed some of the examples shown around the net, but continually found that the file would completely upload before giving an error message that the maximum execution time of 30 seconds was exceeded in line 3. Not great when line 3 was set_time_limit(3600); I was under the impression that the time spent recieving the file from the user wasn't included in the execution time, and so timeouts wouldn't be caused by this? The only solution I could find was to physically change the time limit in php.ini to a large value, which I would rather not do. I am completely stumped as to why the script times out, I am reasonably sure it behaved the same when I enclosed everything in one set of and put echo's infront of all the html. Here are snippets of my code and ini: PHP.INI: max_execution_time = 30 max_input_time = 60 post_max_size = 10M upload_max_filesize = 10M UPLOADS.PHP http://tcc.hopto.org/uploads.php.txt Thankyou for your time :o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Local PHP installation conflict
Hi, I have been running my site successfully on a remote server for sometime now. However I have just installed PHP, MySQL and Apache on my local Windows XP Pro machine and when I try to log on to my site I get the following errors: Warning: session_start(): open(/tmp\sess_3bfb39a88b7b180b859aa17f1661031b, O_RDWR) failed: No such file or directory (2) in c:\program files\apache group\apache\htdocs\mysite\authenticate_user.php on line 13 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at c:\program files\apache group\apache\htdocs\ncdt\authenticate_user.php:13) in c:\program files\apache group\apache\htdocs\mysite\authenticate_user.php on line 13 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at c:\program files\apache group\apache\htdocs\ncdt\authenticate_user.php:13) in c:\program files\apache group\apache\htdocs\mysite\authenticate_user.php on line 13 Warning: Unknown(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0 Warning: Unknown(): open(/tmp\sess_3bfb39a88b7b180b859aa17f1661031b, O_RDWR) failed: No such file or directory (2) in Unknown on line 0 Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0 Is this because I am running different versions of PHP? Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Local PHP installation conflict
On Sat, Dec 06, 2003 at 02:07:53PM -, Shaun wrote: > Hi, Hi! > > I have been running my site successfully on a remote server for sometime > now. However I have just installed PHP, MySQL and Apache on my local Windows > XP Pro machine and when I try to log on to my site I get the following > errors: > > Warning: session_start(): open(/tmp\sess_3bfb39a88b7b180b859aa17f1661031b, > O_RDWR) failed: No such file or directory (2) in c:\program files\apache > group\apache\htdocs\mysite\authenticate_user.php on line 13 > Is this because I am running different versions of PHP? Create directory tmp on disk C: (c:\tmp). -- zhuravlev alexander u l s t u n o c ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] query_data
I have a query $query="select a,b,c,d,e from table where id='z'"; $result=mysql_query(); $query_data=mysql_fetch_array($result); I normally would do this: $a=$query_data["a"]; etc.. is there a way to do this is in a loop so I do not have to do all that typing? Thanks Randy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Local PHP installation conflict
"Zhuravlev Alexander" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sat, Dec 06, 2003 at 02:07:53PM -, Shaun wrote: > > Hi, > > Hi! > > > > I have been running my site successfully on a remote server for sometime > > now. However I have just installed PHP, MySQL and Apache on my local Windows > > XP Pro machine and when I try to log on to my site I get the following > > errors: > > > > Warning: session_start(): open(/tmp\sess_3bfb39a88b7b180b859aa17f1661031b, > > O_RDWR) failed: No such file or directory (2) in c:\program files\apache > > group\apache\htdocs\mysite\authenticate_user.php on line 13 > > > Is this because I am running different versions of PHP? > > Create directory tmp on disk C: (c:\tmp). > > -- zhuravlev alexander >u l s t u n o c > ([EMAIL PROTECTED]) Thanks for your help, That got rid of all of the error essages except this one: Warning: Unknown(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0 So I guess I need register_globals to be enabled, how can I do this? Thanks again for your help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RSS pagenting (was PHP RSS sites and SlashDot)
Hi again everyone, Thank you to everyone who replied with suggestions and locations for getting RSS feeds, from your own sites and from others, some good and some.not so good :-D We have finally decided on around 12 differient feeds/places for 3-5 differient pages on the new site. Nearly all the programs/scripts/classes I downloaded to pharse the feeds allow you to limit how many "records" to display, so I am displaying 3 records from eachunfortunately of the 8-12 "pharsers" that I downloaded I couldnt find one that could pagenate the feed eg: blah 1 blah 2 blah 3 click here to read more When clicked it would display from "blah 4" to "blah 6" then another click here for 7-9 etc Any body know of such a script? I'm pretty sure they must be around coz I'm a total newbie to this but others too must have had this requirment before. Thanks in advance. Cheers, -Ryan http://Bestwebhosters.com - Php web hosting and programming contests! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] query_data
On Sat, Dec 06, 2003 at 09:34:24AM -0500, Randy Johnson wrote: > I have a query > > $query="select a,b,c,d,e from table where id='z'"; > $result=mysql_query(); > > $query_data=mysql_fetch_array($result); > > I normally would do this: > > $a=$query_data["a"]; > etc.. > > is there a way to do this is in a loop so I do not have to do all that > typing? use list (http://www.php.net/list) list ($a, $b, $c, $d, $e) = mysql_fetch_row($result); -- zhuravlev alexander u l s t u n o c ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] query_data
Randy Johnson wrote: I have a query $query="select a,b,c,d,e from table where id='z'"; $result=mysql_query(); $query_data=mysql_fetch_array($result); I normally would do this: $a=$query_data["a"]; etc.. is there a way to do this is in a loop so I do not have to do all that typing? You already have a variable called $query_data['a']... why do you need to make another variable? You're just wasting time and memory. If you want it shorter, then assign the result to $r so you have $r['a'], or something similar. However, if you just _have_ do to this, then use extract(). -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: POST upload script timeout
"Iain Staffell" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have a script on my local machine to allow friends to send me files, as IM > or FTP transfers don't work, and so I would like to accept reasonably large > files (10mb max). I followed some of the examples shown around the net, but > continually found that the file would completely upload before giving an > error message that the maximum execution time of 30 seconds was exceeded in > line 3. Not great when line 3 was set_time_limit(3600); > > I was under the impression that the time spent recieving the file from the > user wasn't included in the execution time, and so timeouts wouldn't be > caused by this? > > The only solution I could find was to physically change the time limit in > php.ini to a large value, which I would rather not do. I am completely > stumped as to why the script times out, I am reasonably sure it behaved the > same when I enclosed everything in one set of and put echo's infront > of all the html. > > Here are snippets of my code and ini: > > PHP.INI: > max_execution_time = 30 > max_input_time = 60 > post_max_size = 10M > upload_max_filesize = 10M > > UPLOADS.PHP > http://tcc.hopto.org/uploads.php.txt > > Thankyou for your time :o) ini_set('max_execution_time', '3600'); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] query_data
oh my gosh, I have been coding php for 4 years now. They way I did it before I saw in numerous examples from the books that I had bought. I think of all the code I have wrote and I did not even have to do it that way. Thanks a bunch, Randy - Original Message - From: "John W. Holmes" <[EMAIL PROTECTED]> To: "Randy Johnson" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Saturday, December 06, 2003 10:04 AM Subject: Re: [PHP] query_data > Randy Johnson wrote: > > I have a query > > > > $query="select a,b,c,d,e from table where id='z'"; > > $result=mysql_query(); > > > > $query_data=mysql_fetch_array($result); > > > > I normally would do this: > > > > $a=$query_data["a"]; > > etc.. > > > > is there a way to do this is in a loop so I do not have to do all that > > typing? > > You already have a variable called $query_data['a']... why do you need > to make another variable? You're just wasting time and memory. If you > want it shorter, then assign the result to $r so you have $r['a'], or > something similar. > > However, if you just _have_ do to this, then use extract(). > > -- > ---John Holmes... > > Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ > > php|architect: The Magazine for PHP Professionals – www.phparch.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Apache Installation Query
Hi, I have just installed Apache on my local machine. However, when browsing a directory I get the listing of it's contents rather than it defaulting to the index.php file, is there a way to make this happen? Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache Installation Query
On Sat, Dec 06, 2003 at 03:56:49PM -, Shaun wrote: > Hi, > > I have just installed Apache on my local machine. However, when browsing a > directory I get the listing of it's contents rather than it defaulting to > the index.php file, is there a way to make this happen? DirectoryIndex index.php index.html in your httpd.conf -- zhuravlev alexander u l s t u n o c ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache Installation Query
On Sat, 2003-12-06 at 10:56, Shaun wrote: > Hi, > > I have just installed Apache on my local machine. However, when browsing a > directory I get the listing of it's contents rather than it defaulting to > the index.php file, is there a way to make this happen? > > Thanks for your help move to your apache conf dir and grep -n DirectoryIndex * to see which config file has this directive, typically httpd.conf but not necessarily. Then: sed 's/DirectoryIndex index.html/DirectoryIndex index.html index.php/g' httpd.conf > httpd.conf.new or something similar, check results and move the .new file to httpd.conf or whatever it is called on your system and restart apache. Oh, assuming UNIX BTW... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problems downloading files via https in IE 6
I posted this once under another subject, but didn't get any responses. I'm stuck on this, and could really use some help. I have the following php code for downloading a file to the user via the browser: // Open csv file. $fp = fopen("fileOnServer.csv", "r"); // Set headers for csv download. header("Content-Type:application/csv"); header("Content-Disposition:attachment; filename=downloadFile.csv"); header("Content-Transfer-Encoding:binary"); // Put it to the browser. fpassthru($fp); This works great in Mozilla and IE 6 via http, and it works in Mozilla via https, but for some reason in IE 6 via https, my filename is mysteriously replaced by a truncated version of my page url. This results in an error, because the file (obviously) cannot be found to be downloaded. Is it something I'm doing, or is this an IE problem? And if so, are there any work-arounds? I can get it working with a re-direct to the file after saving it, but that means my server file and my download file have to have the same name, which I would like to avoid. Thanks in advance, Geoff Thompson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache Installation Query
"Brian V Bonini" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sat, 2003-12-06 at 10:56, Shaun wrote: > > Hi, > > > > I have just installed Apache on my local machine. However, when browsing a > > directory I get the listing of it's contents rather than it defaulting to > > the index.php file, is there a way to make this happen? > > > > Thanks for your help > > move to your apache conf dir and grep -n DirectoryIndex * to see which > config file has this directive, typically httpd.conf but not > necessarily. > > Then: > > sed 's/DirectoryIndex index.html/DirectoryIndex index.html index.php/g' > httpd.conf > httpd.conf.new > > or something similar, check results and move the .new file to httpd.conf > or whatever it is called on your system and restart apache. > > Oh, assuming UNIX BTW... Sorry no, Windows XP Pro... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] password protection/encryption
Greetings, I'm working on a project that involves a password protected area of a website. Some one also involved brought up the point that this area should be secure (Whit the lock icon indicating it is encrypted). In this particular project the password protected area will be a quote generating system for a company. Users would log in and choose the products they are interested in purchasing and the site would generate a quote depending on what they selected from the list of products. So my question is.. At what point is encryption necessary? I've always thought encryption was only needed when dealing with stuff like credit card information, am I wrong? How secure is a password protected page done with just PHP? Thanks Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: password protection/encryption
Some questions to ask yourself... 1. Am I storing personally identifiable information (eg. Names, addresses, phone numbers, email addresses, credit card data)? 2. Will this data be stored in a text file or database? 3. Is this text file or database directly connected to the internet? 4. What type of data am I trying to protect? Answer these questions and you will know if you need to use public/private key encryption technology in your application. You are currently interested (from your post) in encrypting the data link layer of your website using SSL (Secure Socket Layer). The SSL or lock icon as you pointed out only encrypts data in a streaming manner (eg. when I click the submit button my username / password combination gets passed to the SSL protocol and wrapped in a layer of encryption to be decoded on the server). If you are storing data in a text file / database that would be a "yes" answer to the 4 quesitons listed above I would recommend using some sort of public / private key encrytion. PHP has several encryption functions for your use and links are listed below. When in doubt consult the manual at php.net. http://us4.php.net/manual/en/function.base64-encode.php http://us4.php.net/manual/en/function.base64-decode.php http://us4.php.net/manual/en/function.crypt.php http://us4.php.net/manual/en/ref.mcrypt.php Also a great recommendation... google.com is your friend you can find all sorts of good tips locating information on various encryption techniques and definitions. A great primer on public / private encrytion vs. one-way encryption can be found here... http://www.webopedia.com/TERM/e/encryption.html This site gives you basics of encryption and how it works. http://computer.howstuffworks.com/encryption.htm SSL information can be found here. http://www.webopedia.com/TERM/S/SSL.html Hope this helps Jas Chris Mach wrote: Greetings, I'm working on a project that involves a password protected area of a website. Some one also involved brought up the point that this area should be secure (Whit the lock icon indicating it is encrypted). In this particular project the password protected area will be a quote generating system for a company. Users would log in and choose the products they are interested in purchasing and the site would generate a quote depending on what they selected from the list of products. So my question is.. At what point is encryption necessary? I've always thought encryption was only needed when dealing with stuff like credit card information, am I wrong? How secure is a password protected page done with just PHP? Thanks Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Not able to execute Linux binary
have you tried using the full path to the executable (eg /usr/bin/myapp rather than ./myapp)? Mike On Sat, 2003-12-06 at 04:56, Karam Chand wrote: > Hello > > looking at manuals and help and some help from you. i > wrote the attached code- > > error_reporting (E_ALL); > ini_set('display_errors', 1); > > $result = `./myapp`; > print_r ( $result ); > > echo ( "2" ); > > exec("./myapp",$result); > print_r($result); > > It is returning output > > 2Array ( ) > > which means the array is empty !!! > > it should have outputted ErrorError > > Both the php and the binary exsits in > http://www.mydomain.com/mgmt/ > > Can I send you the binary so that you can check it > out? > > Karam > > --- Jason Wong <[EMAIL PROTECTED]> wrote: > > On Saturday 06 December 2003 02:44, Karam Chand > > wrote: > > > > > The output is > > > > > > StartEnd > > > > Good, that shows your PHP program is being executed. > > > > > I am sure that the linux binary is ok. coz if in > > the > > > sheel you just do > > > > > > ./myapp > > > > > > it outputs > > > > > > error > > > > > > seems that the binary is not getting executred. I > > > think there is some permission info. > > > > Not necessarily. Now it's time to check the manual > > entry for exec() to see > > what *exactly* that function does. You'll find that > > you're using it > > incorrectly (or it doesn't do what *you* think it > > should do). > > > > > if i do phpinfo() i get the following output for > > safe > > > stuff - > > > > > > safe_mode Off Off > > > > Good, that rules out a lot of other possibilities as > > to why your program isn't > > working. > > > > -- > > Jason Wong -> Gremlins Associates -> > > www.gremlins.biz > > Open Source Software Systems Integrators > > * Web Design & Hosting * Internet & Intranet > > Applications Development * > > -- > > Search the list archives before you post > > http://marc.theaimsgroup.com/?l=php-general > > -- > > /* > > The doctrine of human equality reposes on this: that > > there is no man > > really clever who has not found that he is stupid. > > -- Gilbert K. Chesterson > > */ > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > __ > Do you Yahoo!? > Free Pop-Up Blocker - Get it now > http://companion.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Not able to execute Linux binary
On Saturday 06 December 2003 12:56, Karam Chand wrote: > looking at manuals and help and some help from you. i > wrote the attached code- > > error_reporting (E_ALL); > ini_set('display_errors', 1); > > $result = `./myapp`; > print_r ( $result ); > > echo ( "2" ); > > exec("./myapp",$result); > print_r($result); > > It is returning output > > 2Array ( ) > > which means the array is empty !!! > > it should have outputted ErrorError I believe you mean to say that it should output: 2Error OK, does your "myapp" program dump its output to STDOUT?, Remember exec() only captures STDOUT. > Both the php and the binary exsits in > http://www.mydomain.com/mgmt/ One way to satisfy yourself that exec() is working is to create a small test program, eg: 8<- #!/bin/bash echo "test" 8<- Then exec() it. > Can I send you the binary so that you can check it > out? No thank you. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* The girl who stoops to conquer usually wears a low-cut dress. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] new set of eyes?
I think I am loosing my mind this afternoon... could someone review this snippit and tell me why it isn't working? $sql = mysql_query("SELECT $i FROM $table WHERE $i = $i",$db)or die(mysql_error()); while($b = mysql_fetch_array($sql)) { while($ar = current($b) != 0) { $v = array(); list($v) = explode("}",$ar); } print_r($v); } I am hoping to get something like array([0]=>first row of data[1]=>second row of data) Any help would be great... Jas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] memory_get_usage()
First time trying out this function, but the output doesnt make any sense to me. An example -> '; /* PHP CODE HERE WITH A BUNCH OF INCLUDES/CLASSES/SMARTY ETC */ echo memory_get_usage(); ?> Gives me -> 22408 1347416 According to the manual, my example says the script starts off with 22k bytes, then end up with 1.3M bytes at the end. (Now thats scalable :P) But seriously, has anyone seen anything like this? Tried it on FreeBSD 4.9/php 4.3.4 Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] new set of eyes?
try this: $ar = array(); while ($row = mysql_fetch_assoc($sql)) { $ar[] = $row; } olinux --- Jas <[EMAIL PROTECTED]> wrote: > I think I am loosing my mind this afternoon... could > someone review this > snippit and tell me why it isn't working? > > $sql = mysql_query("SELECT $i FROM $table WHERE $i = > $i",$db)or > die(mysql_error()); > while($b = mysql_fetch_array($sql)) { > while($ar = current($b) != 0) { > $v = array(); > list($v) = explode("}",$ar); } > print_r($v); } > > I am hoping to get something like > array([0]=>first row of data[1]=>second row of data) > > Any help would be great... > Jas > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] new set of eyes?
On Sat, 06 Dec 2003 11:38:18 -0700, you wrote: >I think I am loosing my mind this afternoon... could someone review this >snippit and tell me why it isn't working? > >$sql = mysql_query("SELECT $i FROM $table WHERE $i = $i",$db)or >die(mysql_error()); > while($b = mysql_fetch_array($sql)) { > while($ar = current($b) != 0) { > $v = array(); > list($v) = explode("}",$ar); } >print_r($v); } > >I am hoping to get something like >array([0]=>first row of data[1]=>second row of data) Your code doesn't have any context, so I can't be sure whether you're doing something very smart or very dumb with the SQL statement. The explode() is kinda weird, too. Try running this: and let us know how close it comes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and IIS
Hi all, I'm running IIS 5.0 on win 2000 professional. I want to include SSI and PHP code in one single file of HTML. How can I do this? Vincent
Re: [PHP] new set of eyes?
I should probably clarify a bit more on the data in the field and what I am trying accomplish.. First the data: host dhcp-01 { hardware ethernet 00:D0:B7:BD:D2:8D; fixed-address 155.97.1.190; } host dhcp-02 { hardware ethernet 00:02:B3:A2:B6:FD; fixed-address 155.97.1.191; } Second the plan: Trying to break up (only one row in database & always will be only one row to retrieve) contents of field into an array so I can break it down into individual editable fields (eg. etc.) the explode() is so I can separate numerous static dhcp hosts into one big array of each setting. eg. $hosts = array("0" => "host", "1" => "dhcp-02", "2" => "{", "3" => "hardware", "4" => "ethernet", "5" => "00:02:B3:A2:B6:FD", "6" => ";", etc... I hope this clarifies my problem. I have tried a few things such as a eregi statement, explode etc. and so far explode has done what i need it to by separating one db entry into multiple components for editing. Jas David Otton wrote: On Sat, 06 Dec 2003 11:38:18 -0700, you wrote: I think I am loosing my mind this afternoon... could someone review this snippit and tell me why it isn't working? $sql = mysql_query("SELECT $i FROM $table WHERE $i = $i",$db)or die(mysql_error()); while($b = mysql_fetch_array($sql)) { while($ar = current($b) != 0) { $v = array(); list($v) = explode("}",$ar); } print_r($v); } I am hoping to get something like array([0]=>first row of data[1]=>second row of data) Your code doesn't have any context, so I can't be sure whether you're doing something very smart or very dumb with the SQL statement. The explode() is kinda weird, too. Try running this: $rs = mysql_query ($sql, $db) or die (mysql_error ()); $result = array(); while ($row = mysql_fetch_array ($rs)) { $result[] = $row; } print_r ($result); ?> and let us know how close it comes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problems downloading files via https in IE 6
On Sat, 6 Dec 2003, Geoffrey Thompson wrote: > header("Content-Type:application/csv"); > header("Content-Disposition:attachment; filename=downloadFile.csv"); > header("Content-Transfer-Encoding:binary"); > fpassthru($fp); > > This works great in Mozilla and IE 6 via http, and it works in Mozilla > via https, but for some reason in IE 6 via https, my filename is > mysteriously replaced by a truncated version of my page url. This > results in an error, because the file (obviously) cannot be found to be > downloaded. Is it something I'm doing, or is this an IE problem? This is the workaround I use for the IE/https download problems. Not sure if it's the same problem, but let me know if this helps: -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MySQL Dump using PHP
Hi all, I am wondering if someone could point me to the right functions to use to make a script to dump all the tables in a specific MySQL DB. I need this to keep a daily backup from my site as the hackers are screwing up my site very often these days. Thanks in advanced, ___ Cesar L. Aracena Commercial Manager / Developer ICAAM Web Solutions 2K GROUP Neuquen, Argentina Tel: +54.299.4774532 Cel: +54.299.6356688 E-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem With Apache / PHP Installation
Hi, I have installed PHP and Apache but when i try to view a PHP file i.e. http://127.0.0.1/hello.php i get a dialog box asking me if i want to open or save the file? Any ideas why this is happening? Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] new set of eyes?
Ok well I think I have it partially solved... $table = "settings"; $db_vlans = array("hosts01","hosts02","hosts03","hosts04","hosts05","hosts06","hosts07","hosts08","hosts09","hosts10"); $vlans = array("VLAN-22","VLAN-27","VLAN-29","VLAN-56","VLAN-57","VLAN-151","VLAN-314","Empty-01","Empty-02","Empty-03"); $i = str_replace($vlans,$db_vlans,$_POST['dhcp_hosts']); $_SESSION['dhcp_table'] = $i; $sql = mysql_query("SELECT $i FROM $table WHERE $i = $i",$db)or die(mysql_error()); $result = array(); while($b = mysql_fetch_array($sql)) { $result[] = explode(" ",$b); print_r($result); $num = count($result); print $num; for ($x = 0; $x < $num; $x++) { print "$result[$x]\n"; } ?> On data in "one" field that looks like: host dhcp-01 { hardware ethernet 00:D0:B7:BD:D2:8D; fixed-address 155.97.1.190; } host dhcp-02 { hardware ethernet 00:02:B3:A2:B6:FD; fixed-address 155.97.1.191; } Is returning this: Array ( [0] => Array ( [0] => Array ) ) 1Array So it sees 1 array and inside are two indexes both containing a new array... now I need to know how to pull the contents out of the second arrays. Sorry, still trying to figure out arrays. Jas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem With Apache / PHP Installation
On Sat, Dec 06, 2003 at 07:46:07PM -, Shaun wrote: > I have installed PHP and Apache but when i try to view a PHP file i.e. > http://127.0.0.1/hello.php i get a dialog box asking me if i want to open or > save the file? > > Any ideas why this is happening? Assuming, your Apache is configured to load the php module: Your Apache is not configured to handle .php files. You need to add directives in httpd.conf for PHP files. See PHP installation docs. -- Aj. Sys. Admin / Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Dump using PHP
On Sat, Dec 06, 2003 at 04:39:22PM -0300, Cesar Aracena wrote: > I am wondering if someone could point me to the right functions to use to > make a script to dump all the tables in a specific MySQL DB. I need this to > keep a daily backup from my site as the hackers are screwing up my site very > often these days. Much easier to use mysqldump in a shell script to do this. man mysqldump -- Aj. Sys. Admin / Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache Installation Query
On Sat, Dec 06, 2003 at 03:56:49PM -, Shaun wrote: > I have just installed Apache on my local machine. However, when browsing a > directory I get the listing of it's contents rather than it defaulting to > the index.php file, is there a way to make this happen? Yes, you need to add index.php to the DirectoryIndex configuration directive in Apche's httpd.conf file. -- Aj. Sys. Admin / Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] count()
Marek Kilimajer <[EMAIL PROTECTED]> wrote in message: > There are 10 '[PAGEBREAK]' substrings in the string. If the string is > split apart at these substrings, it will give you total 11 parts. Thank you. TR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Dump using PHP
The thing is that I don't have phisical access to the server and it doesn't have telnet access either. What I want to achieve is to make a password protected page inside my site were a button is kept to start a full backup of my MySQL DB and after clicking on it, be able to select the Internet Explorer's option to store the file xxx.sql in my HDD. Is this possible? I use the built'in function of phpbb that does exactly that and it's just beautifull. Thanks again, ___ Cesar L. Aracena Commercial Manager / Developer ICAAM Web Solutions 2K GROUP Neuquen, Argentina Tel: +54.299.4774532 Cel: +54.299.6356688 E-mail: [EMAIL PROTECTED] "Ajai Khattri" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > On Sat, Dec 06, 2003 at 04:39:22PM -0300, Cesar Aracena wrote: > > > I am wondering if someone could point me to the right functions to use to > > make a script to dump all the tables in a specific MySQL DB. I need this to > > keep a daily backup from my site as the hackers are screwing up my site very > > often these days. > > Much easier to use mysqldump in a shell script to do this. > > man mysqldump > > -- > Aj. > Sys. Admin / Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Dump using PHP
On Sat, Dec 06, 2003 at 06:02:40PM -0300, Cesar Aracena wrote: > The thing is that I don't have phisical access to the server and it doesn't > have telnet access either. What I want to achieve is to make a password > protected page inside my site were a button is kept to start a full backup > of my MySQL DB and after clicking on it, be able to select the Internet > Explorer's option to store the file xxx.sql in my HDD. Is this possible? > I use the built'in function of phpbb that does exactly that and it's just > beautifull. Of course it is possible to do it that way (in which case, you can probably look at how phpBB does it). The only problem with this is if the script takes too long to execute (rare, but possible) in which case your browser could timeout. -- Aj. Sys. Admin / Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Dump using PHP
Cesar Aracena wrote: The thing is that I don't have phisical access to the server and it doesn't have telnet access either. What I want to achieve is to make a password protected page inside my site were a button is kept to start a full backup of my MySQL DB and after clicking on it, be able to select the Internet Explorer's option to store the file xxx.sql in my HDD. Is this possible? I use the built'in function of phpbb that does exactly that and it's just beautifull. Thanks again, ___ Cesar L. Aracena Commercial Manager / Developer ICAAM Web Solutions 2K GROUP Neuquen, Argentina Tel: +54.299.4774532 Cel: +54.299.6356688 E-mail: [EMAIL PROTECTED] "Ajai Khattri" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] On Sat, Dec 06, 2003 at 04:39:22PM -0300, Cesar Aracena wrote: I am wondering if someone could point me to the right functions to use to make a script to dump all the tables in a specific MySQL DB. I need this to keep a daily backup from my site as the hackers are screwing up my site very often these days. Much easier to use mysqldump in a shell script to do this. man mysqldump -- Aj. Sys. Admin / Developer Use mysqldump in a system() call, redirect it to a temp file, then read it back and out to the browser. Or, you could use popen to get the output piped back into php. Make sure to check the mysqldump options for things you need (I often use -Q -e --add-drop-table). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache Installation Query
On Sat, 2003-12-06 at 12:01, Shaun wrote: > "Brian V Bonini" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > On Sat, 2003-12-06 at 10:56, Shaun wrote: > > > Hi, > > > > > > I have just installed Apache on my local machine. However, when browsing > a > > > directory I get the listing of it's contents rather than it defaulting > to > > > the index.php file, is there a way to make this happen? > > > > > > Thanks for your help > > > > move to your apache conf dir and grep -n DirectoryIndex * to see which > > config file has this directive, typically httpd.conf but not > > necessarily. > > > > Then: > > > > sed 's/DirectoryIndex index.html/DirectoryIndex index.html index.php/g' > > httpd.conf > httpd.conf.new > > > > or something similar, check results and move the .new file to httpd.conf > > or whatever it is called on your system and restart apache. > > > > Oh, assuming UNIX BTW... > > Sorry no, > > Windows XP Pro... Sorry to hear that.. ;-) I suppose whatever tools Win has to to search and replace will suffice then. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Getting flush() to work with Safari & Internet Explorer in OS X
Hi everyone, I have a script that takes a long time to run and it uses flush(). Upon testing with Safari and Internet Explorer, I found out it doesn't work and other users have problems with this as well: http://forums.devshed.com/t86445/s.html I ran my script with Lynx, Links, and Omniweb, and the script ran fine. I thought changing some settings in php.ini might help like: implicit_flush = On ;Default is Off but realized the On setting is for debugging purposes. My question, what can I do to get Safari or Internet Explorer to handle flushed output? Thanks in advance. -gohaku -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem With Apache / PHP Installation
"Ajai Khattri" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sat, Dec 06, 2003 at 07:46:07PM -, Shaun wrote: > > > I have installed PHP and Apache but when i try to view a PHP file i.e. > > http://127.0.0.1/hello.php i get a dialog box asking me if i want to open or > > save the file? > > > > Any ideas why this is happening? > > Assuming, your Apache is configured to load the php module: > > Your Apache is not configured to handle .php files. You need > to add directives in httpd.conf for PHP files. > > See PHP installation docs. > > -- > Aj. > Sys. Admin / Developer Thanks for your reply, I have added the following lines to the beginning of httpd.conf LoadModule php4_module c:/php/sapi/php4apache.dll AddModule mod_php4.c AddType application/x-httpd-php .php But am still unable to view php files... Any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP eregi filtering problem
Greetings all, I ran into a problem today and was hoping someone could provide an answer. I am fetching a web page, and attempting to parse certain variables from it. I've done this plenty of times in the past with no problem. The only difference this time is the file that I am parsing is much larger. The HTML file is about 42kb in size (usually I only parse ~4kb worth). In the web browser, the script seems to just shut down, but reports no errors, not even to the web server logs. Is there some specific max size that it can accept or a setting in php.ini I need to modify? Thanks __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] memory_get_usage()
On Saturday 06 December 2003 01:41 pm, Gerard Samuel wrote: > According to the manual, my example says the script starts off with 22k > bytes, then end up with 1.3M bytes at the end. (Now thats scalable :P) > But seriously, has anyone seen anything like this? > Tried it on FreeBSD 4.9/php 4.3.4 > Ok, I guess its snow on the brain causing cabin fever today, but I think I understand its output now. The amount of memory a script consumes, is the second value minus the first value. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP & Variables
Greetings All, Have a small problem that I just can't work out. I know it's an easy one but it's got me stumped... I have some code to pull a question out of a database and display it on the screen. I also want to store it in a hidden var for use with the $_POST on the next page. Currently, the display bit works fine. The only problem is the hidden var only has the first word of the question in itand I'm setting it from the same var!!! Eg. If the question is: What is the problem with this stupid thing? The hidden var will contain: "What" What am I missing? Why has the rest of the question packed it's things and moved out??? Code Snippet while ($newarray = mysql_fetch_array($result)) { $qid = $newarray['qid']; $question = $newarray['question_text']; echo "$question"; <--- This works perfectly. echo ""; < This returns first word. Many Thanks In Advance, Lloyd. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP & Variables
Hi Lloyd, use "quote"s around your values echo ""; Regards, Greg -- phpDocumentor http://www.phpdoc.org Lloyd Bayley wrote: Greetings All, Have a small problem that I just can't work out. I know it's an easy one but it's got me stumped... I have some code to pull a question out of a database and display it on the screen. I also want to store it in a hidden var for use with the $_POST on the next page. Currently, the display bit works fine. The only problem is the hidden var only has the first word of the question in itand I'm setting it from the same var!!! Eg. If the question is: What is the problem with this stupid thing? The hidden var will contain: "What" What am I missing? Why has the rest of the question packed it's things and moved out??? Code Snippet while ($newarray = mysql_fetch_array($result)) { $qid = $newarray['qid']; $question = $newarray['question_text']; echo "$question"; <--- This works perfectly. echo ""; < This returns first word. Many Thanks In Advance, Lloyd. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP and IIS
V.B. de Haan wrote: I'm running IIS 5.0 on win 2000 professional. I want to include SSI and PHP code in one single file of HTML. How can I do this? The question is WHY you'd want to do this. Whatever you're doing in your SSI should just be done in PHP. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP & Variables
Lloyd Bayley wrote: echo ""; < This returns first word. Please learn HTML. The "value" should have quotes around it. echo ""; or, even MORE correct: echo ''; -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP & Variables
Greg, Sheesh! I had neglected to do that...I've been working with a few different languages and I'm starting to confuse them I think. Thanks for your non-offensive reply. It's nice to see that you can overlook the little failures we have now and again. Lloyd. :-) At 09:58 AM 7/12/2003, you wrote: Hi Lloyd, use "quote"s around your values echo ""; Regards, Greg -- phpDocumentor http://www.phpdoc.org Lloyd Bayley wrote: Greetings All, Have a small problem that I just can't work out. I know it's an easy one but it's got me stumped... I have some code to pull a question out of a database and display it on the screen. I also want to store it in a hidden var for use with the $_POST on the next page. Currently, the display bit works fine. The only problem is the hidden var only has the first word of the question in itand I'm setting it from the same var!!! Eg. If the question is: What is the problem with this stupid thing? The hidden var will contain: "What" What am I missing? Why has the rest of the question packed it's things and moved out??? Code Snippet while ($newarray = mysql_fetch_array($result)) { $qid = $newarray['qid']; $question = $newarray['question_text']; echo "$question"; <--- This works perfectly. echo ""; < This returns first word. Many Thanks In Advance, Lloyd. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP & Variables
Lloyd Bayley wrote: Thanks for your non-offensive reply. It's nice to see that you can overlook the little failures we have now and again. "Please learn HTML" is offensive? Please... I even gave you the _correct_ answer that involves htmlentities(), otherwise you'll be back here with another question when your "$question" has a double quote within it. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Uploaded Picture Name
I am having a slight problem with a picture upload script. I seems to work just fine except when the picture name has an apostrphe in the name. How do all of you deal with this problem. Do you just rename the file to something else when you upload it. Here is the script that I am using. It is called from a form using multipart/form-data. Thanks for the help. displayHeader("File Uploaded"); printf("Uploaded File Details"); printf("Name: %s ", $_FILES["photo"]["name"]); printf("Temporary Name: %s ", $_FILES["photo"]["tmp_name"]); printf("Size: %s ", $_FILES["photo"]["size"]); printf("Type: %s ", $_FILES["photo"]["type"]); if (copy($_FILES["photo"]["tmp_name"],"{$GLOBALS['IMAGE_DIR']}/{$_FILES['photo' ]['name']}")) {printf("File successfully copied");} else {printf("Error: failed to copy file");} // Put picture path into database and assosiate with a product $query = "insert into picture (product_id, path) values ( {$_POST['product_id']}, '{$GLOBALS['IMAGE_DIR']}/{$_FILES['photo']['name']}' )"; mysql_query($query) or die (mysql_error()); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RedHat Linux - PHP - Interbase
I am looking for someone that is running RH 9 Linux with Php & Interbase... Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP & Variables
John W. Holmes wrote: echo ''; Or even *MORE* correct echo ''; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP & Variables
John W. Holmes wrote: Lloyd Bayley wrote: Thanks for your non-offensive reply. It's nice to see that you can overlook the little failures we have now and again. "Please learn HTML" is offensive? Please... I even gave you the _correct_ answer that involves htmlentities(), otherwise you'll be back here with another question when your "$question" has a double quote within it. You big meanie. -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Check type of uploaded file
Hi there, I want to test an uploaded file to see if it is a text file, but I don't want to rely on the presence of an os command such as 'file.' Is there a straightforward way to do this within PHP? Thanks in advance. -Bob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Random Numbers..
Hey, I've got a script which used to generate a random quote. It worked fine untill this problem occurred.. Say we have 4 quotes with QuoteID's of 1 through to 4 The script would grab a number of rows, and generate a random number between 1 and this value (being 4 in this case) This worked fine untill, one of the quotes was removed and another added, leaving 4 quotes once again, but the last one had an ID of 5. The problem is the Random number generated is between 1 and 4, so the final quote is never shown.. I tried using the RAND() function in the MySQL statement it's self, but it's not random enough... Then I thought of doing this: Select all the Quote ID's from the DB. Store them in an Array. Generate a random number between 1 and the last ID. If the Random Number matches a Quote ID, then display the quote, otherwise Generate another But I couldn't get the code to work. Any suggestions on either how to write the above, or made the MySQL RAND() function, more random? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Random Numbers.. [Solved, Ignore]
Sorry for this e-mail, When I wrote this, my e-mail server was down, and it was archived for sending. By the time the e-mail server was restored, I had solved this problem. - TheHeadSage - Original Message - From: "TheHeadSage" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, December 07, 2003 2:39 PM Subject: [PHP] Random Numbers.. > Hey, > > I've got a script which used to generate a random quote. It worked fine > untill this problem occurred.. > > Say we have 4 quotes with QuoteID's of 1 through to 4 > The script would grab a number of rows, and generate a random number > between 1 and this value (being 4 in this case) This worked fine untill, > one of the quotes was removed and another added, leaving 4 quotes once > again, but the last one had an ID of 5. The problem is the Random number > generated is between 1 and 4, so the final quote is never shown.. > > I tried using the RAND() function in the MySQL statement it's self, but > it's not random enough... > > Then I thought of doing this: > > Select all the Quote ID's from the DB. > Store them in an Array. > Generate a random number between 1 and the last ID. > If the Random Number matches a Quote ID, then display the quote, > otherwise Generate another > > But I couldn't get the code to work. Any suggestions on either how to > write the above, or made the MySQL RAND() function, more random? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Check type of uploaded file
Hello Bob, Sunday, December 7, 2003, 1:00:44 AM, you wrote: BH> I want to test an uploaded file to see if it is a text file, but I don't want BH> to rely on the presence of an os command such as 'file.' Is there a BH> straightforward way to do this within PHP? Thanks in advance. Yes, check the $_FILES['userfile']['type'] after upload. -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Apache 2 + PHP
Thanks to all who replied! I will try to avoid using PHP 4 on Apache 2. Does PHP 5 look like it will suit apache 2 for production? Yves Arsenault Carrefour Infotech 5, Acadian Dr. Charlottetown, PEI C1C 1M2 [EMAIL PROTECTED] (902)368-1895 ext.242 -Original Message- From: Mike Morton [mailto:[EMAIL PROTECTED] Sent: December 6, 2003 9:17 AM To: Yves Arsenault; PHP-General Subject: Re: [PHP] Apache 2 + PHP Yves: I am not sure of the exact technical issues that affect it, but when I was forced to use it in a production environment (does anyone actually admit to CHOOSING to use it? anyway) I received a lot of errors on includes, intermittently. This was most noticable when using phpmyadmin - but it was noticed throughout the application. Errors including a file, then you refresh and there are no errors. In general the webserver was very unstable, prone to hanging processes and needing the webserver stopped and restarted. In the beginning it was no big deal - once twice a week, but in the last 3 weeks it has been 5-6 times a day. We just switched to Apache 1.3.2 (using PHP 4.3.4 on both machines.) and we have had 0 problems across the board in 3 days of operation now. So there you go - if you are OK with instability then go for it - if not, choose Apache 1.3.x PS. Anyone out there know/work with PLESK? 6.0 comes with Apache 2.0 and PHP 4.3.something - I want to 'downgrade' it to apache 1.3 - but *shrug* no idea. If there is anyone out there that has done It successfully, msg me offline to chat. WHY OH WHY do these companies not work WITH the php community? If only they had asked Itools is the same way (server manager for Mac OSX - for the love of GOD DO NOT EVER USE IT! That is what was forced upon us and caused the above problems - you could not use it unless you used Apache 2, and they 'said' that there are no 'instabilities' with PHP - either they lied or just have a terrible QC division!!!) On 12/5/03 1:00 PM, "Yves Arsenault" <[EMAIL PROTECTED]> wrote: > > Would anyone know of the issues that might affect PHP 4.3.4 and Apache > 2.0.48 ? > > Thanks, > > Yves > > -Original Message- > From: Martin Hudec [mailto:[EMAIL PROTECTED] > Sent: 5 décembre 2003 10:52 > To: PHP-General > Subject: Re: [PHP] Apache 2 + PHP > > > Hi there, > > when I had Gentoo Linux, I was using Apache 2.0.48 with PHP 4.3.4 installed > from Gentoo portage. It was running <10 smallscale php/mysql based > virtualhosts without any difficulties. > > On Friday 05 December 2003 15:24, Yves Arsenault wrote: >> Is this warning outdated? >> http://www.php.net/manual/en/install.apache2.php >> "Do not use Apache 2.0 and PHP in a production environment neither on Unix >> nor on Windows." >> I'm running RedHat 9. >> >> I've got Apache 2.0.48 running and was ready to install the latest php >> 4.3.x.. >> Just thought I would check. > -- > : > :. kind regards > :.. Martin Hudec > :.: > :.: =w= http://www.aeternal.net > :.: =m= +421.907.303393 > :.: [EMAIL PROTECTED] [EMAIL PROTECTED] > :.: > :.: "When you want something, all the universe > :.: conspires in helping you to achieve it." > :.: - The Alchemist (Paulo Coelho) > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Cheers Mike Morton * * Tel: 905-465-1263 * Email: [EMAIL PROTECTED] * "Indeed, it would not be an exaggeration to describe the history of the computer industry for the past decade as a massive effort to keep up with Apple." - Byte Magazine Given infinite time, 100 monkeys could type out the complete works of Shakespeare. Win 98 source code? Eight monkeys, five minutes. -- NullGrey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Random Numbers..
Theheadsage wrote: Hey, I've got a script which used to generate a random quote. It worked fine untill this problem occurred.. Say we have 4 quotes with QuoteID's of 1 through to 4 The script would grab a number of rows, and generate a random number between 1 and this value (being 4 in this case) This worked fine untill, one of the quotes was removed and another added, leaving 4 quotes once again, but the last one had an ID of 5. The problem is the Random number generated is between 1 and 4, so the final quote is never shown.. I tried using the RAND() function in the MySQL statement it's self, but it's not random enough... Then I thought of doing this: Select all the Quote ID's from the DB. Store them in an Array. Generate a random number between 1 and the last ID. If the Random Number matches a Quote ID, then display the quote, otherwise Generate another But I couldn't get the code to work. Any suggestions on either how to write the above, or made the MySQL RAND() function, more random? how about if ($randnumber == 4) $randnumber++; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Random Numbers..
No, I wouldn't do that. What if another quote gets deleted. The new assigned QuoteID would be 6 and your solution wouldn't work. This would: /* selecting a random record, where n = 1. Works fine on small tables */ mysql> SELECT value FROM table ORDER BY RAND() LIMIT n; /* selecting a random record. This is good on large tables if numbering sequence is used */ mysql> SET @val = FLOOR(RAND() * n) + 1; mysql> SELECT value FROM table WHERE ID = @val; -Original Message- From: Alex [mailto:[EMAIL PROTECTED] Sent: Sunday, December 07, 2003 12:00 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: Random Numbers.. Theheadsage wrote: > Hey, > > I've got a script which used to generate a random quote. It worked fine > untill this problem occurred.. > > Say we have 4 quotes with QuoteID's of 1 through to 4 > The script would grab a number of rows, and generate a random number > between 1 and this value (being 4 in this case) This worked fine untill, > one of the quotes was removed and another added, leaving 4 quotes once > again, but the last one had an ID of 5. The problem is the Random number > generated is between 1 and 4, so the final quote is never shown.. > > I tried using the RAND() function in the MySQL statement it's self, but > it's not random enough... > > Then I thought of doing this: > > Select all the Quote ID's from the DB. > Store them in an Array. > Generate a random number between 1 and the last ID. > If the Random Number matches a Quote ID, then display the quote, > otherwise Generate another > > But I couldn't get the code to work. Any suggestions on either how to > write the above, or made the MySQL RAND() function, more random? how about if ($randnumber == 4) $randnumber++; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help!session problem!
Hello: I want your help! And i am pool in english! The session sometime works well,sometime works badly! It creates new empty file in /tmp.I also find this problem with apache1.3.12&php4.1.1&sybase11.9.2&linux My php.ini is fault my server config: php4.3.3 httpd2.0.44 linux 9 sybase-11.9.2 tar-vzxf php-4.3.3.tar.gz ../configure ?with-apxs2=/home/apache/bin/apxs ?with-sybase-ct=/opt/Sybase-11.9.2 ?enable-ftp ?enable-track-vars ?disable-cli make make install cp php.ini-dist /usr/local/lib/php.ini Thanks a lot Reproduce code: --- login.php: $user_array=sybase_fetch_row($result); session_start(); session_register("user_array"); ... index.php: session_start(); $user_name=$user_array[1]; __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
[PHP] Persistence of session files
Hi all. I'm wondering if anyone can tell me how long temporary session files stay on the server after the session has ended if session_destroy() is not called. I'm curious as part of the CMS I've been writing for the past year is a class which dynamically generates and validates all forms in the CMS. This class relies heavily on sessions so I've implemented a method which is called upon the execution of every page within the CMS, and which checks for expired forms and deletes them from the session. This is proving to be very effective in minimizing the overall size of the session while still having the user work with very large amounts of session data. However if the user just closes the browser instead of logging out the final cleanup isn't called and there can be some large session files left on the server. What I'm curious about is how long these last before they are somehow deleted? Is there some way I can control this? Cheers and TIA, Pablo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help!session problem!
--- ÎÚÓÐ ÎÞ <[EMAIL PROTECTED]> wrote: > Reproduce code: > --- > login.php: > $user_array=sybase_fetch_row($result); > session_start(); > session_register("user_array"); > ... > index.php: > session_start(); > $user_name=$user_array[1]; Try this instead: login.php: session_start(); $_SESSION['user_array'] = sybase_fetch_row($result); ... index.php: session_start(); $user_name = $_SESSION['user_array']['1']; ... Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Persistence of session files
--- Pablo Gosse <[EMAIL PROTECTED]> wrote: > Hi all. I'm wondering if anyone can tell me how long temporary > session files stay on the server after the session has ended if > session_destroy() is not called. This is defined in php.ini (session.gc_maxlifetime), and you can write your own garbage collection function (if you want) as part of session_set_save_handler. Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Check type of uploaded file
On Saturday 06 December 2003 11:01 pm, Richard Davey wrote: > Yes, check the $_FILES['userfile']['type'] after upload. > That can be spoofed. There isn't really a way to determine file types... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php