RE: [PHP] Mysql not functioning after upgrade to 4.2.3
I am just recompiling against your config for you to see for myself... sometimes I find it helps to compile the cgi or cli version ..eg remove the apxs config then do a listing of modules compiled in from the shell... Won't be long... Timothy Hitchens (HITCHO) [EMAIL PROTECTED] HITCHO has Spoken! -Original Message- From: Jeff Schwartz [mailto:[EMAIL PROTECTED]] Sent: Saturday, 12 October 2002 9:40 AM To: PHP List Subject: [PHP] Mysql not functioning after upgrade to 4.2.3 I just upgraded from 4.1.2 to 4.2.3 and now receive an "undefined function" error when running mysql_pconnect() or mysql_connect(). I used the same configure script as before and the Configure Command from phpinfo (below) includes Mysql. However, there's no longer a Configuration area showing for Mysql. Has anyone else run into this problem? Thanks, Jeff './configure' 'i386-redhat-linux' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--prefix=/usr' '--with-config-file-path=/etc' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db3' '--with-exec-dir=/usr/bin' '--with-gd' '--with-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-mm' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-debugger' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-imap=shared' '--with-kerberos=/usr/kerberos' '--with-ldap=shared,/usr' '--with-mysql=shared,/usr' '--with-curl=/usr/lib/' '--with-apxs=/usr/sbin/apxs' - Do you Yahoo!? Faith Hill - Exclusive Performances, Videos, & more faith.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mysql not functioning after upgrade to 4.2.3
What Unix? and Version? Timothy Hitchens (HITCHO) [EMAIL PROTECTED] HITCHO has Spoken! -Original Message- From: Jeff Schwartz [mailto:[EMAIL PROTECTED]] Sent: Saturday, 12 October 2002 9:40 AM To: PHP List Subject: [PHP] Mysql not functioning after upgrade to 4.2.3 I just upgraded from 4.1.2 to 4.2.3 and now receive an "undefined function" error when running mysql_pconnect() or mysql_connect(). I used the same configure script as before and the Configure Command from phpinfo (below) includes Mysql. However, there's no longer a Configuration area showing for Mysql. Has anyone else run into this problem? Thanks, Jeff './configure' 'i386-redhat-linux' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--prefix=/usr' '--with-config-file-path=/etc' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db3' '--with-exec-dir=/usr/bin' '--with-gd' '--with-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-mm' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-debugger' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-imap=shared' '--with-kerberos=/usr/kerberos' '--with-ldap=shared,/usr' '--with-mysql=shared,/usr' '--with-curl=/usr/lib/' '--with-apxs=/usr/sbin/apxs' - Do you Yahoo!? Faith Hill - Exclusive Performances, Videos, & more faith.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Register Globals
What is the name of the file that is registered in your phpinfo().. eg is that the path and name of the config?? Also have you restarted your webserver?? Phil Ewington wrote: > Hi, > > I have just upgraded PHP to 4.2.3 and have found that register_globals > defaults to 'off'. I have changed this setting in the php.ini file, yet > phpinfo() still shows register_globals = 'off' and my scripts that rely on > this setting are failing. The file I edited was /etc/httpd/php.ini, so why > is register_globals still set to 'off'? > > TIA > > Phil > > > Phil Ewington > Technical Director > > 43 PLC > 35 Broad Street, Wokingham > Berkshire RG40 1AU > Tel: +44 (0)118 978 9500 > Fax: +44 (0)118 978 4994 > > http://www.43plc.com > > > -- Timothy Hitchens Technologist / Entrepreneur e-mail: [EMAIL PROTECTED] mobile: 0419 521 440 - HiTCHO Group - ABN: 85 816 540 110 Web Site: http://www.hitcho.com.au/ Snail Mail: PO Box 101 Arana Hills QLD 4054 Telephone: 07 3351 0951 - Facsimile: 07 3351 0952 IMPORTANT: This email may be the view of the individual and not that of the organisation. The contents of this electronic mail (including attachments) may be privileged and commercially confidential. Any unauthorised use of the contents is expressly prohibited. If you have received this document in error, please advise us by telephone immediately and then delete the document. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simple question
http://www.boutell.com/gd/http/ is a good start!! Jean-François Marseaut wrote: > Where can I found last version of the GD library ? > -- Timothy Hitchens Technologist / Entrepreneur e-mail: [EMAIL PROTECTED] mobile: 0419 521 440 - HiTCHO Group - ABN: 85 816 540 110 Web Site: http://www.hitcho.com.au/ Snail Mail: PO Box 101 Arana Hills QLD 4054 Telephone: 07 3351 0951 - Facsimile: 07 3351 0952 IMPORTANT: This email may be the view of the individual and not that of the organisation. The contents of this electronic mail (including attachments) may be privileged and commercially confidential. Any unauthorised use of the contents is expressly prohibited. If you have received this document in error, please advise us by telephone immediately and then delete the document. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Inserting a variable into a mysql_query() statement
Single around the variable mysql_query("DELETE FROM product WHERE manufacturer='$hidden_manuf_id'",$bb) Timothy Hitchens [EMAIL PROTECTED] Phil Clark wrote: > I'm trying to insert the variable $hidden_manuf_id into a mysql_query() > statement. > > If i do this: > mysql_query("DELETE FROM product WHERE manufacturer=$hidden_manuf_id",$bb) > or die(mysql_error()); > PHP server doesn't see the variable because it is inside the string > quotes"". > > If I do this: > mysql_query("DELETE FROM product WHERE manufacturer="$hidden_manuf_id,$bb) > or die(mysql_error()); > PHP server reports a parsing error. > > What is the correct syntax? ($bb is correctly defined.) > > > > -- Timothy Hitchens Technologist / Entrepreneur e-mail: [EMAIL PROTECTED] mobile: 0419 521 440 - HiTCHO Group - ABN: 85 816 540 110 Web Site: http://www.hitcho.com.au/ Snail Mail: PO Box 101 Arana Hills QLD 4054 Telephone: 07 3351 0951 - Facsimile: 07 3351 0952 IMPORTANT: This email may be the view of the individual and not that of the organisation. The contents of this electronic mail (including attachments) may be privileged and commercially confidential. Any unauthorised use of the contents is expressly prohibited. If you have received this document in error, please advise us by telephone immediately and then delete the document. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Script optimisation
This an issue that many people in the PHP community face each day. I would suggest these first very basic ones: If you have strings that are echo/parsed that you use double quotes but when the string contains no variable replacement use singles. If you are writing files of considerable size look at the memory limit setting in php.ini and up it for each script. Look at loops and see if something is being counted or calculated each time around if so have it set prior to entry to the loop. Without seeing your scripts I can't suggest anything wonderfull. Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] Tony Crockford wrote: > Hi, > > I'm sure this is an RTFM, but I'm not sure where I should be looking. > > is it quicker for PHP to execute in blocks of html or to > echo all of the html and only have one > > I'm using a PHP script to write a lot of html files to hard disk and the > script execution time is climbing beyond the maximum set in PHP.ini > (I've changed the setting, but...) > > I'm looking to shave milliseconds of each execution, any ideas, pointers > or tutorials you could point me to. > > Thanks > > > Tony > > -- Timothy Hitchens (HiTCHO) Web Application Analyst and Developer e-mail: [EMAIL PROTECTED] mobile: 0419 521 440 - HiTCHO Group - ABN: 85 816 540 110 Web Site: http://www.hitcho.com.au/ Snail Mail: PO Box 101 Arana Hills QLD 4054 Telephone: 07 3351 0951 - Facsimile: 07 3351 0952 IMPORTANT: This email may be the view of the individual and not that of the organisation. The contents of this electronic mail (including attachments) may be privileged and commercially confidential. Any unauthorised use of the contents is expressly prohibited. If you have received this document in error, please advise us by telephone immediately and then delete the document. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP from behind a proxy-server ??
Make a direct call using sockets... eg simulate being a web browser and use the proxy.. Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] Rob wrote: > hi, > > i'm trying to get phpMySetiStats (phpmysetistats.sourceforge.net) > running on my NT4 box (Apache 2.0.39, PHP 4.2.3 and MySQL 3.23.52). > problem is that i am behind a proxy server and can not get the 'file' > function to work to retrieve my stats from the Berkeley server ... > i've searched the net & groups and noticed that i'm not the first one > to run into this problem ; but could not find any answers ... > > anybody here knows how to use 'file' thru a proxy ? > > Rob > -- Timothy Hitchens (HiTCHO) Web Application Analyst and Developer e-mail: [EMAIL PROTECTED] mobile: 0419 521 440 - HiTCHO Group - ABN: 85 816 540 110 Web Site: http://www.hitcho.com.au/ Snail Mail: PO Box 101 Arana Hills QLD 4054 Telephone: 07 3351 0951 - Facsimile: 07 3351 0952 IMPORTANT: This email may be the view of the individual and not that of the organisation. The contents of this electronic mail (including attachments) may be privileged and commercially confidential. Any unauthorised use of the contents is expressly prohibited. If you have received this document in error, please advise us by telephone immediately and then delete the document. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_FILES posting limited to 5?
IE can only have two concurrent connections open... eg if you have a http 1.1 connection open for say a ongoing cgi/php call (ping or traceroute) then you make another call for the same script and then a further call to the server the last call will just sit there spinning it's wheeels until on of the others in finished... the same is for downloads using IE ..you can fix this with a reg hack. Timothy Hitchens (HiTCHO) Web Application Analyst and Developer e-mail: [EMAIL PROTECTED] mobile: 0419 521 440 Juhan Kundla wrote: > Ühel ilusal päeval [16-10-2002 16:48] kirjutas Jason Young: > >>I'm going to approach this question in a different way, in case some >>people were put off by the complexity of it yesterday. >> >>For all those who don't know my question from yesterday, I have a form >>where I can upload up to 9 files at a time. Unfortunately, only the >>first 5 of those files are being uploaded at any given time. >> >>As a test, I just created a simple form with only input type 'file's, >>and attempted to find out how many its attempting to parse. It is still >>only 5. > > > [cut] > > Doesn't this have something to do with browser being able only to make > maximum 5 tcp connections at a time? Perhaps, a stupid idea, though... > > Juhan > -- Timothy Hitchens (HiTCHO) Web Application Analyst and Developer e-mail: [EMAIL PROTECTED] mobile: 0419 521 440 - HiTCHO Group - ABN: 85 816 540 110 Web Site: http://www.hitcho.com.au/ Snail Mail: PO Box 101 Arana Hills QLD 4054 Telephone: 07 3351 0951 - Facsimile: 07 3351 0952 IMPORTANT: This email may be the view of the individual and not that of the organisation. The contents of this electronic mail (including attachments) may be privileged and commercially confidential. Any unauthorised use of the contents is expressly prohibited. If you have received this document in error, please advise us by telephone immediately and then delete the document. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PhpMyAdmin Help Needed
Try something for me change the localhost to 127.0.0.1 Also look at the public_html settings for each user... Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] Pushpinder Singh Garcha wrote: > Hi > > I am wanting to use PhpMyAdmin for my project . I am developing using > PHP and MySQl and the OS is Jaguar > I have downloaded the latest version of phpmyadmin and have made > necessary changes in the 'config.inc.php' file > When I try to access PhpMyAdmin using " > http://localhost/~pgarcha/phpmyadmin/index.php"; I get the folowing error > > Not Found > The requested URL /~pgarcha/phpmyadmin/index.php was not found on this > server. > > > Apache/1.3.26 Server at pushpinder-garchas-computer.local Port 80 > > This is the list of things that I have changed: > 1). $cfg['PmaAbsoluteUri'] = 'http://localhost/~pgarcha/phpmyadmin/'; > 2). $cfg['Servers'][$i]['auth_type'] = 'http'; // > Authentication method (config, http or cookie based)? > 3). $cfg['Servers'][$i]['user'] = 'root'; // > MySQL user > 4). $cfg['Servers'][$i]['password'] = 'sunny'; // MySQL > password (only needed > > // with 'config' auth_type) > > I am not sure about the "user" attribute that I have put above > actually "pgarcha' is the admin of the system. > Please help me out. > > Thanks in advance > Pushpinder > > > Pushpinder Singh Garcha > _ > Web Developer > T. Falcon Napier and Associates, Inc. > Off : 704 987 6500 > Cell : 704 236 2939 > Fax : 704 987 5002 > _ -- Timothy Hitchens (HiTCHO) Web Application Analyst and Developer e-mail: [EMAIL PROTECTED] mobile: 0419 521 440 - HiTCHO Group - ABN: 85 816 540 110 Web Site: http://www.hitcho.com.au/ Snail Mail: PO Box 101 Arana Hills QLD 4054 Telephone: 07 3351 0951 - Facsimile: 07 3351 0952 IMPORTANT: This email may be the view of the individual and not that of the organisation. The contents of this electronic mail (including attachments) may be privileged and commercially confidential. Any unauthorised use of the contents is expressly prohibited. If you have received this document in error, please advise us by telephone immediately and then delete the document. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with setcookie and IE6.0.2800.1106
Arr.. Microsoft and their attempt to get security and privacy to their clients.. have a look in the ->view -> privacy report... this will give you a starting point... John Nichel wrote: > Hi guys and gals. I'm having a problem with setting a cookie on IE 6. > I'm running RedHat 7, Apache 1.3.26 and php 4.2.3. The cookie sets fine > in all other browsers (IE5, Netscape 4 and up, Opera, Mozilla, etc.) but > on IE 6, not even my session cookie sets. I've tried all of these > > setcookie ( "$name", "$cookie_data", $date, "/", "by-tor_v70", 0 ); > setcookie ( "$name", "$cookie_data", $date, "/", "by-tor_v70" ); > setcookie ( "$name", "$cookie_data", $date, "/" ); > setcookie ( "$name", "$cookie_data", $date ); > setcookie ( "$name", "$cookie_data" ); > > I've also replaced $date with time() and time()+3600. > $date is set to the standard set forth on Netscape's site. > > Any ideas? > > thanks, > John Nichel > > -- Timothy Hitchens (HiTCHO) Web Application Analyst and Developer e-mail: [EMAIL PROTECTED] mobile: 0419 521 440 - HiTCHO Group - ABN: 85 816 540 110 Web Site: http://www.hitcho.com.au/ Snail Mail: PO Box 101 Arana Hills QLD 4054 Telephone: 07 3351 0951 - Facsimile: 07 3351 0952 IMPORTANT: This email may be the view of the individual and not that of the organisation. The contents of this electronic mail (including attachments) may be privileged and commercially confidential. Any unauthorised use of the contents is expressly prohibited. If you have received this document in error, please advise us by telephone immediately and then delete the document. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with setcookie and IE6.0.2800.1106
As per my earlier commments about seeing the privacy report this will answer all your questions regarding cookies.. also you can allways telnet to the host eg.. telnet {host} 80 get /{page.html} http/1.0 host: {yourdomain.com.au} {enter} {ctrl d} You should then see the header information as well that should include your cookie informaiton if not you have even a bigger problem. Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] Chris Shiflett wrote: > John, > > Can you see if this works: > > header("Set-Cookie: foo=bar"); > > If not, then check the configuration for IE6. I seem to recall hearing > that cookies are disabled by default for sites that are not P3P > compliant? Or, perhaps that was for third-party cookies only. At any > rate, I seem to recall some significant change with IE6 in regards to > cookies, so maybe you're experiencing that. My example above will give > you the simplest test case for setting a cookie. > > Good luck, and happy hacking. > > Chris > > John Nichel wrote: > >> Hi guys and gals. I'm having a problem with setting a cookie on IE 6. >> I'm running RedHat 7, Apache 1.3.26 and php 4.2.3. The cookie sets >> fine in all other browsers (IE5, Netscape 4 and up, Opera, Mozilla, >> etc.) but on IE 6, not even my session cookie sets. I've tried all of >> these >> >> setcookie ( "$name", "$cookie_data", $date, "/", "by-tor_v70", 0 ); >> setcookie ( "$name", "$cookie_data", $date, "/", "by-tor_v70" ); >> setcookie ( "$name", "$cookie_data", $date, "/" ); >> setcookie ( "$name", "$cookie_data", $date ); >> setcookie ( "$name", "$cookie_data" ); >> >> I've also replaced $date with time() and time()+3600. >> $date is set to the standard set forth on Netscape's site. > > > > -- Timothy Hitchens (HiTCHO) Web Application Analyst and Developer e-mail: [EMAIL PROTECTED] mobile: 0419 521 440 - HiTCHO Group - ABN: 85 816 540 110 Web Site: http://www.hitcho.com.au/ Snail Mail: PO Box 101 Arana Hills QLD 4054 Telephone: 07 3351 0951 - Facsimile: 07 3351 0952 IMPORTANT: This email may be the view of the individual and not that of the organisation. The contents of this electronic mail (including attachments) may be privileged and commercially confidential. Any unauthorised use of the contents is expressly prohibited. If you have received this document in error, please advise us by telephone immediately and then delete the document. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Server Slow After PHP Error
I would suggest that your Apache process has not finished with PHP processing eg. loop etc etc Remember that HTTP/1.0 allows (4) four connections and HTTP/1.1 allows (2) two connections so if you have a long process eg a HTTP/1.1 stream coming from the server or the server believes that the connection has yet to finish then it would appear to you as the server is slow ... when this happens next try from another box and you should see no problems. Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] Weston said: > Whenever I access a PHP script from the web that contains an error (such > as > a parsing error, etc...) The server will not respond to any request (php > or > not) for about 2-3 minutes. This only happens over the web though, if i > try > to run a php file using command line, the error loads immedaitely. Any > help? > My system information is listed below. > > RedHat Linux 7.3 > Apache 1.3.27 > PHP 4.1.2 > > Thanx > Weston > > -- > 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] Variables and http
Are you saying this is coming from a form entry? If so and you have PHP > 4.1 then use: $_GET['chp1'] OR $_POST['chp1'] Depends if it is get or post data!! If you have pre 4.1 use the var name eg. $chp1 etc etc Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] If you need PHP hosting with an experienced support team 24/7 then email me today. On Thu, 5 Dec 2002, hacook wrote: > Hi all, > I have a page (to create a database) with X text fields called chpX (chp0, > chp1, chp2..Etc) that posts these variables to a php file. > I would like to know how can i get these values ? (I have also the $i > variable that tells me what is the max X) > > Thanks, > Hacook > > > > -- > 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] Sendmail Security
Regardless if mail() takes precautions you should also check input prior to trusting it. Note: If mail does or doesn't if it changes in the future you are covered if you always check. I would suggest a simple addslashes and the (shell/sendmail) will be fine OR better still do an array with a callback either removal or addslashes equiv. Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] If you need PHP hosting with an experienced support team 24/7 then email me today. On Sat, 28 Dec 2002, Beth Gore wrote: > Hi, > > If I'm taking an URL as user input from in a form, and then emailing > that URL back to them as part of a larger message, how do I ensure that > no-one sends anything strange to run shell commands through sendmail? > > Could anyone confirm that mail() or even sendmail does take precautions > against shell commands being executed in the message body of the email? > > If not, is there an easy way to remove everything except > ":","/",".","a-Z","0-9"? I've written very complicated things in the > past and I'm sure there must be an easier way!!! > > I've already made sure it's not possible to abuse sendmail with the > user's email address, but I'm still nervous. > > Thanks! > > -- > Beth Gore > http://www.habitformer.co.uk > > > -- > 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] Form duplicate post problem
There is a very simple solution to this on the page that does the entries into the database simply to a header redirect to a new page that displays the success notices etc and if they do a back or a refresh nothing will happen as the POST data is on the previous now "removed" from history page. header('Location: http://www.yourdomain.com/success.html'); * you will need to put some GET data in the URL to show the correct page. That will do it for you. Remember that you can't send output on the database entry page simple to the database calls and they do the header call as above. Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] If you need PHP hosting with an experienced support team 24/7 then email me today. On Sun, 29 Dec 2002, Pag wrote: > > Hi, > > I am having some problems with duplicate form input. > I have a form that adds comments to an article, works fine, but if the > user clicks on "refresh", having added a comment previously, the same > comment is added again. I tried clearing the variables after the database > write, but the refresh somehow resends the previous values. > Roughly, heres how my script works: (not using actual code syntax here) > > -- > if {$flag=1 AND $name!='' AND $commentbody!=''){ > > inserts the comment into the database > $flag = 0 > $name = '' > $comment = '' > } > -- > routine to display the article and the existing comments here > -- > form here > if user clicks send, puts $flag=1 and calls same page > -- > > > How can i prevent these double entries? Some command to definitely clear > the variables? > Thanks. > > Pag > > > > -- > 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] Form duplicate post problem
The redirect using the header method is instant and if the middle page just does the inserts and you redirect right away using PHP it is not noticable at all. Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] If you need PHP hosting with an experienced support team 24/7 then email me today. On Sun, 29 Dec 2002, Pag wrote: > > > > >to a new page that displays the success notices etc and if they > >do a back or a refresh nothing will happen as the POST data > >is on the previous now "removed" from history page. > > I understand, but the reason i am trying to stick with just one > page is that i want it to be practical. I mean, the moment the user clicks > "submit" the page reloads and shows his comment immediately, and give him > the functionality of pressing refresh to see if anyone else commented in > the meantime. > Also, by using a different page, even with a redirect back to the > original, might take a little while, since the original is a bit heavy on > the download side. ;-) > > Pag > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fwrite() debugging
The $fd is the file handler now not the $filename. Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] HiTCHO | Open Platform Web Development Consutling - Outsourcing - Training - Support - Original Message - From: "Alberto Brea" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 01, 2003 6:27 AM Subject: [PHP] fwrite() debugging Could somebody please tell me what I'm doing wrong here? The code is: And I get the following error message: "Warning: fwrite(): supplied argument is not a valid File-Handle resource in c:\archivos de programa\apache group\apache\htdocs\visitrep\report_options.inc on line 111" Thanks a lot in advance and happy new year! Alberto Brea http://estudiobrea.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] receiving XML stream as server via PHP
The variables will created (as of 4.x) in the $_POST and $_GET global arrays and you can then access them using what ever functions you need to use. As for XML if it is posted as raw you will get an error from Apache saying Bad Request. I have just setup an example to see what is possible to get around this... keep you posted. Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] HiTCHO | Open Platform Web Development Consutling - Outsourcing - Training - Support - Original Message - From: "Kristopher Yates" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 01, 2003 7:20 AM Subject: [PHP] receiving XML stream as server via PHP > Hi, > > Using PHP with cURL, I am currently able to dynamically create XML > documents and HTTP POST to a remote server, receive an XML response, and > parse XML as needed. > > What I am having trouble finding information on is doing the reverse. > Basically, I am trying to create a PHP script that acts as a server, so > that a remote computer can HTTP POST XML to said script and then I parse > and respond in XML. Again, I already have the reverse working using > CURL - so basically I have created a client and now I need to create the > server. > > The only part I need help understanding is how do I get the XML into an > array/variable when my script is hit with someone using HTTP POST to > pass XML to it. I have an idea below (vague).. > > I had the server guy HTTP POST some XML to a script which just had > > > I see in the HTTP Request Headers of the phpinfo() output that it > received content type text/xml but nowhere do I see what was actually > received (the actual xml that was sent). I thought maybe PHP would take > the stuff after the header and push it into an array/variable but no > such luck (argv?). > > I am wondering if anyone has any helpful information. I imagine > something like the following psuedo code: > > if($HTTP_CONTENT_TYPE=="text/xml"){ > //use some php function(s) to pass incoming xml stream to an array > that I can then pass to my > //xml parser > } > > I hope this gives you enough information to figure out my dilema. If > someone can shed a little light on this subject it would be GREATLY > appreciated. > > Thanks, > > Kris > [EMAIL PROTECTED] > > > -- > 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] receiving XML stream as server via PHP
You can post to your server with a mimetype of "text/xml" and in your script pickup the raw post as: $HTTP_RAW_POST_DATA Then just process this string as XML and return to buffer or not. Have fun. Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] HiTCHO | Open Platform Web Development Consutling - Outsourcing - Training - Support - Original Message - From: "Kristopher Yates" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 01, 2003 7:20 AM Subject: [PHP] receiving XML stream as server via PHP > Hi, > > Using PHP with cURL, I am currently able to dynamically create XML > documents and HTTP POST to a remote server, receive an XML response, and > parse XML as needed. > > What I am having trouble finding information on is doing the reverse. > Basically, I am trying to create a PHP script that acts as a server, so > that a remote computer can HTTP POST XML to said script and then I parse > and respond in XML. Again, I already have the reverse working using > CURL - so basically I have created a client and now I need to create the > server. > > The only part I need help understanding is how do I get the XML into an > array/variable when my script is hit with someone using HTTP POST to > pass XML to it. I have an idea below (vague).. > > I had the server guy HTTP POST some XML to a script which just had > > > I see in the HTTP Request Headers of the phpinfo() output that it > received content type text/xml but nowhere do I see what was actually > received (the actual xml that was sent). I thought maybe PHP would take > the stuff after the header and push it into an array/variable but no > such luck (argv?). > > I am wondering if anyone has any helpful information. I imagine > something like the following psuedo code: > > if($HTTP_CONTENT_TYPE=="text/xml"){ > //use some php function(s) to pass incoming xml stream to an array > that I can then pass to my > //xml parser > } > > I hope this gives you enough information to figure out my dilema. If > someone can shed a little light on this subject it would be GREATLY > appreciated. > > Thanks, > > Kris > [EMAIL PROTECTED] > > > -- > 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] makeing an array
Example of an Array: $my_first_array = array(1 => 'first', 2 => 'second', 3 => 'third'); You can now access these like so: echo $my_first_array[1]; etc etc of if you had this: $my_first_array = array('first_name' => 'Philip', 'last_name' => 'Newman'); You could do this: echo $my_first_array['first_name']; The thing to remember is that array's start at 0 "see below!!" (I started at 1 at the top to make it easier). You can also make an array like so: $first[] = 'Philip'; $first[] = 'John'; $first[] = 'Paul'; Now you can simply do: echo $first[0]; // this could output 'Philip'; You can then look at multi dimensional etc... I trust this get's you on your way. Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] HiTCHO | Open Platform Web Development Consulting - Outsourcing - Training - Support - Original Message - From: "Philip J. Newman" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 01, 2003 2:57 PM Subject: [PHP] makeing an array > Can someone help me make an array ... > > I have $foo amount of loops to preform (1-20), and would like to make the > veriable work for me like $comment_1, $comment_2 etc etc. > > http://nz.php.net/manual/en/function.array.php makes no sence to me after i > read it and read it ... > > help me please > > --- > Philip J. Newman. > Head Developer. > PhilipNZ.com New Zealand Ltd. > http://www.philipnz.com/ > [EMAIL PROTECTED] > > Mob: +64 (25) 6144012. > Tele: +64 (9) 5769491. > > VitalKiwi Site: > Philip J. Newman > Internet Developer > http://www.newman.net.nz/ > [EMAIL PROTECTED] > > * > Friends are like Stars, > You can't always see them, > But you know they are there. > > * > > ICQ#: 20482482 > MSN ID: [EMAIL PROTECTED] > Yahoo: [EMAIL PROTECTED] > AIM: newmanpjkiwi > > > -- > 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] makeing an array
Use the count like following inside to ensure that you don't call on a non existent index. for ($i = 0, $x = count($comment); $i < $x; $i++) { echo $comment[$i].''; } Why do you want to echo out $comment_1 ??? Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] HiTCHO | Open Platform Web Development Consulting - Outsourcing - Training - Support - Original Message - From: "Philip J. Newman" <[EMAIL PROTECTED]> To: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, January 01, 2003 3:29 PM Subject: Re: [PHP] makeing an array > So in saything that I could do this ... > > $s = 10 > > $comment[1] = '$comment_1'; > $comment[2] = '$comment_2'; > $comment[3] = '$comment_2'; > > for($i = 0; $i <= $s; $i++) { > > echo $comment[$i].""; > > } > > > > - Original Message - > From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]> > To: "Philip J. Newman" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Wednesday, January 01, 2003 6:12 PM > Subject: Re: [PHP] makeing an array > > > > Example of an Array: > > > > $my_first_array = array(1 => 'first', 2 => 'second', 3 => 'third'); > > > > You can now access these like so: > > > > echo $my_first_array[1]; etc etc > > > > of if you had this: $my_first_array = array('first_name' => 'Philip', > > 'last_name' => 'Newman'); > > > > You could do this: > > > > echo $my_first_array['first_name']; > > > > The thing to remember is that array's start at 0 "see below!!" (I started > at > > 1 at the top to make it easier). > > > > You can also make an array like so: > > > > $first[] = 'Philip'; > > $first[] = 'John'; > > $first[] = 'Paul'; > > > > Now you can simply do: > > > > echo $first[0]; // this could output 'Philip'; > > > > You can then look at multi dimensional etc... > > > > I trust this get's you on your way. > > > > > > Timothy Hitchens (HiTCHO) > > [EMAIL PROTECTED] > > > > > > HiTCHO | Open Platform Web Development > > Consulting - Outsourcing - Training - Support > > > > > > - Original Message - > > From: "Philip J. Newman" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Wednesday, January 01, 2003 2:57 PM > > Subject: [PHP] makeing an array > > > > > > > Can someone help me make an array ... > > > > > > I have $foo amount of loops to preform (1-20), and would like to make > the > > > veriable work for me like $comment_1, $comment_2 etc etc. > > > > > > http://nz.php.net/manual/en/function.array.php makes no sence to me > after > > i > > > read it and read it ... > > > > > > help me please > > > > > > --- > > > Philip J. Newman. > > > Head Developer. > > > PhilipNZ.com New Zealand Ltd. > > > http://www.philipnz.com/ > > > [EMAIL PROTECTED] > > > > > > Mob: +64 (25) 6144012. > > > Tele: +64 (9) 5769491. > > > > > > VitalKiwi Site: > > > Philip J. Newman > > > Internet Developer > > > http://www.newman.net.nz/ > > > [EMAIL PROTECTED] > > > > > > * > > > Friends are like Stars, > > > You can't always see them, > > > But you know they are there. > > > > > > * > > > > > > ICQ#: 20482482 > > > MSN ID: [EMAIL PROTECTED] > > > Yahoo: [EMAIL PROTECTED] > > > AIM: newmanpjkiwi > > > > > > > > > -- > > > 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 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] Alternatives for Meta Refresh
Let me give you a direction with this one. You can use a http/1.1 stream and keep flushing the buffer with an script timeout set to 0. Simply open the page then just add something to the buffer and flush and then wait a little while then flush... just like a database would do. I do have a working application somewhere. No clicking... but remember that IE has a 2 connection limit per domain. (without registry changes) Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] HiTCHO | Open Platform Web Development Consulting - Outsourcing - Training - Support - Original Message - From: "Justin French" <[EMAIL PROTECTED]> To: "Stephen" <[EMAIL PROTECTED]>; "PHP List" <[EMAIL PROTECTED]> Sent: Wednesday, January 01, 2003 5:42 PM Subject: Re: [PHP] Alternatives for Meta Refresh > on 31/12/02 2:48 AM, Stephen ([EMAIL PROTECTED]) wrote: > > > I'm writing a PHP chat script and I'm rather stumped on this. I either want > > the chat window to refresh when there's a new message or refresh every few > > seconds but not with meta refresh, rather something with less noise (the > > infamous IE clicking sound) and/or something faster. The only thing I can > > think of is the header function. Any ideas? > > The header() function (like everything in PHP) happens SERVER SIDE before > the page hits the browser, so this won't help. > > META refresh is the only standard, HTML way to do it, AFAIK -- and even > then, i'm not 100% sure that all browsers and user agents support it. > > Another option would be for javascript to refresh the page, but again, this > will probably invoke the IE clicking sound. > > > Most chat programs do use either meta refresh, or some sort of Java applet > instead of refreshing. > > > I think there are also some Flash chat things out there too. > > > Cheers, > > Justin > > > -- > 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] makeing an array
Your example of: for ($i = 0; $i < count($comment); $i++) Is very bad as the count will be parsed each loop. The count as I had it gets parsed only once. Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] HiTCHO | Open Platform Web Development Consulting - Outsourcing - Training - Support - Original Message - From: "Sean Malloy" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 01, 2003 9:40 PM Subject: RE: [PHP] makeing an array > why the $x variable aswell?! > > for ($i = 0; $i < count($comment); $i++) > { > echo $comment[$i].''; > } > > or even faster: > > $i = count($comment); > while ($i--) > { > echo $comment[$i].''; > } > > > -Original Message- > > From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, 1 January 2003 4:41 PM > > To: Philip J. Newman; [EMAIL PROTECTED] > > Subject: Re: [PHP] makeing an array > > > > > > Use the count like following inside to ensure that you don't > > call on a non existent index. > > > > for ($i = 0, $x = count($comment); $i < $x; $i++) > > { > > echo $comment[$i].''; > > } > > > > Why do you want to echo out $comment_1 ??? > > > > > > > > Timothy Hitchens (HiTCHO) > > [EMAIL PROTECTED] > > > > > > HiTCHO | Open Platform Web Development > > Consulting - Outsourcing - Training - Support > > > > > > - Original Message - > > From: "Philip J. Newman" <[EMAIL PROTECTED]> > > To: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]>; > > <[EMAIL PROTECTED]> > > Sent: Wednesday, January 01, 2003 3:29 PM > > Subject: Re: [PHP] makeing an array > > > > > > > So in saything that I could do this ... > > > > > > $s = 10 > > > > > > $comment[1] = '$comment_1'; > > > $comment[2] = '$comment_2'; > > > $comment[3] = '$comment_2'; > > > > > > for($i = 0; $i <= $s; $i++) { > > > > > > echo $comment[$i].""; > > > > > > } > > > > > > > > > > > > - Original Message - > > > From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]> > > > To: "Philip J. Newman" <[EMAIL PROTECTED]>; > > <[EMAIL PROTECTED]> > > > Sent: Wednesday, January 01, 2003 6:12 PM > > > Subject: Re: [PHP] makeing an array > > > > > > > > > > Example of an Array: > > > > > > > > $my_first_array = array(1 => 'first', 2 => 'second', 3 => 'third'); > > > > > > > > You can now access these like so: > > > > > > > > echo $my_first_array[1]; etc etc > > > > > > > > of if you had this: $my_first_array = array('first_name' => 'Philip', > > > > 'last_name' => 'Newman'); > > > > > > > > You could do this: > > > > > > > > echo $my_first_array['first_name']; > > > > > > > > The thing to remember is that array's start at 0 "see below!!" (I > > started > > > at > > > > 1 at the top to make it easier). > > > > > > > > You can also make an array like so: > > > > > > > > $first[] = 'Philip'; > > > > $first[] = 'John'; > > > > $first[] = 'Paul'; > > > > > > > > Now you can simply do: > > > > > > > > echo $first[0]; // this could output 'Philip'; > > > > > > > > You can then look at multi dimensional etc... > > > > > > > > I trust this get's you on your way. > > > > > > > > > > > > Timothy Hitchens (HiTCHO) > > > > [EMAIL PROTECTED] > > > > > > > > > > > > HiTCHO | Open Platform Web Development > > > > Consulting - Outsourcing - Training - Support > > > > > > > > > > > > - Original Message - > > > > From: "Philip J. Newman" <[EMAIL PROTECTED]> > > > > To: <[EMAIL PROTECTED]> > > > > Sent: Wednesday, January 01, 2003 2:57 PM > > > > Subject: [PHP] makeing an array > > > > > > > > > > > > > Can someone help me
Re: [PHP] accelerator and Apache 2
Acceleration in what sense .. caching or memory kept precompiled code?? Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] HiTCHO | Open Platform Web Development Consulting - Outsourcing - Training - Support - Original Message - From: "Jochen Kaechelin" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 02, 2003 7:26 AM Subject: [PHP] accelerator and Apache 2 > Is there a free php accelerator out there which runs under Apache 2? > > -- > Jochen Kaechelin > [EMAIL PROTECTED] > > > -- > 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] web visitor viewing a script?
Only if your webserver has a handler issue will this occur or if you have a .htaccess to override the server from passing onto PHP. This will happen with .php3 files if you don't have them set to be processed by php or any other extension that is not included in your web server configuration file / htaccess. And you are correct unless you have FTP/File Sharing etc you can't view the source of a handler/parsed file. HiTCHO has Spoken! Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED]] Sent: Sunday, 5 January 2003 10:18 AM To: PHP List Subject: [PHP] web visitor viewing a script? This came up in another group and I just wanted to know from the experts whether this is possible. Being someone well versed in PHP can you visit a web site, hit a script in PHP and be able to view the script on the page rather than just the html it generates. Is it true that the only way to view the script itself is to have some problem with the web server or have a local login for the server? Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- 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] Zend IDE vs. PhpEd
__NO I DON'T WORK FOR ZEND__ Well I use Zend Studio and have done for sometime. Check out there offer for Small Business: http://www.zend.com/store/products/zend-smallbiz.php Includes the Encoder and the IDE ++ You won't regret a Zend Studio buy and with the upgrade option you get all upgrades (including all version comp eg 4.x.x comp) included. HiTCHO has Spoken! Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] > -Original Message- > From: Mirek Novak [mailto:[EMAIL PROTECTED]] > Sent: Monday, 6 January 2003 5:08 PM > To: John Wells; [EMAIL PROTECTED] > Subject: Re: [PHP] Zend IDE vs. PhpEd > > > John Wells wrote: > > Can anyone who's familiar with both give an honest, open > evaluation? > > I'm in a rush project and need something quickly (have to purchase > > tomorrow), but I'm on the fence when it comes to these two products. > > > > Zend costs $100 less than Phped, so I'm leaning that way. But if > > there's anything you know that could make my decision > easier, please > > forward it on. They seem pretty comparable, with the exception of > > PhpEd's db browser. > > ... have u seen phpEdit? It's for free, has perfect autocompletion, > project manager, editable templates and many other features. AFAIK it > has no db browser, but has good developer community around > ... http://www.phpedit.net > > > -- > Mirek Novak > jabber:[EMAIL PROTECTED] > ICQ:119499448 > > AUTO.CZ > http://www.auto.cz > > NEWS.AUTO.CZ > http://news.auto.cz > > FORMULE1.CZ > http://www.formule1.cz > > > -- > 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] Dreaded Return-Path and mail()
Hmm... I would expect that your sendmail.cf (if you are using sendmail) hasn't got your webserver (running as eg www or apache etc) in it's trusted users file / listing. HiTCHO has Spoken! Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] > -Original Message- > From: David T-G [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, 7 January 2003 10:34 AM > To: PHP General list > Cc: Monty > Subject: Re: [PHP] Dreaded Return-Path and mail() > > > Monty -- > > ...and then Monty said... > % > % Okay, I've read just about everything on the Internet about > how the change % the Return-Path header in an e-mail sent > using mail(), but, I STILL can't % get it to work. All e-mail > sent via PHP says Return-Path: [EMAIL PROTECTED] % and > Received: (from nobody@localhost). > > How interesting. > > What do you get if you put > > $to = "[EMAIL PROTECTED]" ; > $subj = "here is a subject" ; > $body = "this is the message body" ; > $hdrs = "From: [EMAIL PROTECTED]\r\nReturn-Path: > [EMAIL PROTECTED]" ; > > mail($to,$subj,$body,$hdrs) ; > > in a php script and execute it? If it doesn't work, what do > the mail server lots on your web server say? I just tested > this code on my box and it worked, so if you have problems > then you can figure it's your mail setup and not your code. > If it works, expand from there in small steps :-) > > > HTH & HAND > > :-D > -- > David T-G * There is too much animal courage in > (play) [EMAIL PROTECTED] * society and not sufficient > moral courage. > (work) [EMAIL PROTECTED] -- Mary Baker Eddy, > "Science and Health" > http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf > Qrprapl Npg! > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] InStallation Error Of ZendStudio on win98
Have you tried it in Safe Mode as you may have a Java Runtime issue. HiTCHO has Spoken! Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] > -Original Message- > From: Steven Seijmonsbergen [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, 7 January 2003 7:09 PM > To: [EMAIL PROTECTED] > Subject: [PHP] InStallation Error Of ZendStudio on win98 > > > I have a Problem With the install of ZendStudio-2_5_0b. > I'm Using Windows 98 and I will get the error: > > This program has performed an illegal! > > What can I do to install ZendStudio??? > > > > -- > 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] Dreaded Return-Path and mail()
As I have said before that if you set the webserver user in as a trusted user in the sendmail.cf file all is fixed. You can then set a return-path etc without warnings as well. HiTCHO has Spoken! Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] > -Original Message- > From: Petre Agenbag [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, 7 January 2003 7:43 PM > To: Timothy Hitchens (HiTCHO) > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] Dreaded Return-Path and mail() > > > Almost exactly the same question as the message with subject: > Sendmail configuration > > The problem you are having took me a while to grasp. > Basically, what happens is that sendmail sends the mail as > the user php/apache was installed as (usually nobody@ or > apache@ yourdomain.com). Setting the Return-Path does not > work, as you cannot override the Return-Path set by the > server in this way, that's why messages bounce to your root > account when sent with a php mail() function. If you only > host one domain on a server, you can fix this by editing the > sendmail.cf file and setting the Return-Path: to something > more meaningful: However, most people don't have the luxury > of having a "one domain" hosting solution. > > Your only other option is to invoke sendmail with the -f > switch: sendmail -f sender@address recipient@address > > This "forces" a from: address, but it also produces a warning > to the recipient that the message headers might be forged, > but return mails and replies are directed to the address specified. > > Only problem with all this is that you need to do one of 2 things: > a) use of PHP's system commands eg. > $mail = `echo -e "Subject: Subject here\n\n Message here" | > /usr/sbin/sendmail -f $your_address $recipient_address`; > > OR > > b) use a PERL script to do it. > > I am currently looking at both, and it seems at this stage > that the PERL script will be the better option, specially if > you need to mail to alot of people. You need to issue the > sendmail in a loop, and for load balancing, it's best to put > a sleep() inside the loop; even if you only make this a > sleep(1) (sleep for 1 sec), PHP will timeout after only 30 > recipients unless you override the default timeout setting > for php scripts. > > On Tue, 2003-01-07 at 02:37, Timothy Hitchens (HiTCHO) wrote: > > Hmm... I would expect that your sendmail.cf (if you are using > > sendmail) hasn't got your webserver (running as eg www or > apache etc) > > in it's trusted users file / listing. > > > > > > > > HiTCHO has Spoken! > > Timothy Hitchens (HiTCHO) > > [EMAIL PROTECTED] > > > > > -Original Message- > > > From: David T-G [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, 7 January 2003 10:34 AM > > > To: PHP General list > > > Cc: Monty > > > Subject: Re: [PHP] Dreaded Return-Path and mail() > > > > > > > > > Monty -- > > > > > > ...and then Monty said... > > > % > > > % Okay, I've read just about everything on the Internet about > > > how the change % the Return-Path header in an e-mail sent > > > using mail(), but, I STILL can't % get it to work. All e-mail > > > sent via PHP says Return-Path: [EMAIL PROTECTED] % and > > > Received: (from nobody@localhost). > > > > > > How interesting. > > > > > > What do you get if you put > > > > > > $to = "[EMAIL PROTECTED]" ; > > > $subj = "here is a subject" ; > > > $body = "this is the message body" ; > > > $hdrs = "From: [EMAIL PROTECTED]\r\nReturn-Path: > > > [EMAIL PROTECTED]" ; > > > > > > mail($to,$subj,$body,$hdrs) ; > > > > > > in a php script and execute it? If it doesn't work, what do > > > the mail server lots on your web server say? I just tested > > > this code on my box and it worked, so if you have problems > > > then you can figure it's your mail setup and not your code. > > > If it works, expand from there in small steps :-) > > > > > > > > > HTH & HAND > > > > > > :-D > > > -- > > > David T-G * There is too much animal > courage in > > > (play) [EMAIL PROTECTED] * society and not sufficient > > > moral courage. > > > (work) [EMAIL PROTECTED] -- Mary Baker Eddy, > > > "Science and Health" > > > http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf > > > Qrprapl Npg! > > > > > > > > > > > > -- > > 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] anyway to do a 'whos online' from session variable?
Simple create a database table for logins and have a status that you set to online / offline and last seen could also be added. Then it is just a simple SELECT statement. If you don't want to use a database you could flock (not perfect) a file then read in a serialised array and update then write out and unlock. HiTCHO has Spoken! Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] > -Original Message- > From: Jeff Bluemel [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 9:08 AM > To: [EMAIL PROTECTED] > Subject: [PHP] anyway to do a 'whos online' from session variable? > > > when a user logs into my system I set a variable > $_SESSION['username']. now, every page somebody pulls up it > revalidates their login so somebody cannot get into the > backend of the system. > > now - is there a way I can make a utility that will show me > the session username's that are in use? it would be useful > to be able to know who's currently online. this is a website > that will not be published, and is used for a VERY limited > number of people. > > Jeff > > > > -- > 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] restrictions
This is outgoing traffic the same as if you where surfing the Internet and as the connection is an established one your machine will allow it. I would suggest looking at the (server) as it may not allow relaying etc!! HiTCHO has Spoken! Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] > -Original Message- > From: Bruce Levick [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 9:19 AM > To: [EMAIL PROTECTED] > Subject: [PHP] restrictions > > > I find that my the company that I work for is a little over > protective. My machine is quite restricted (as in firewall > and accessability) when it comes to ftp and telnet. Well > basically my hands are tied in that sense. > > I am testing my database build on my local machine which runs > fine and all. I am curious though as to how these > restrictions may affect my attempts to send "mail()" I have > tried various external SMTP srervers (i am running off winxp > pro) in my php.ini file and I get nothing. Just the error > code I have placed in (below). > > > if (mail("[EMAIL PROTECTED]", "this title", "testing")) > echo "Mail Sent!"; > else > echo "Mail could not be sent..."; > > > ?> > > Warning: Failed to connect to mailserver, verify your "SMTP" > setting in php.ini in c:\inetpub\wwwroot\_tasks\email.php on > line 21 Mail could not be sent... > > > Would my local machines restrictions be stopping the mail > function from communicating with the SMTP server?? > > Cheers > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] restrictions
In windowsxp do the following: Start -> Run Open: cmd At the shell type: telnet x.x.x.x 25< x.x.x.x being the smtp server If you get a prompt then you have other issues such as relay etc etc HiTCHO has Spoken! Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] > -Original Message- > From: Bruce Levick [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 9:25 AM > To: Marco Tabini > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] restrictions > > > Well I can't be totally sure but I think all outgoing mail > points to an external SMTP server. > > -Original Message- > From: Marco Tabini [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 08, 2003 9:11 AM > To: Bruce Levick > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] restrictions > > > Hello Bruce-- > > That depends on what restrictions are imposed on your box, of > course. Does your company use an SMTP-compatible mail server > for your internal mail? If so, you could use the server your > mail client points to to perform your tests. > > Cheers, > > > Marco > -- > > php|architect - The Monthly Magazine for PHP Professionals > Come check us out on the web at http://www.phparch.com! > GET YOUR FREE COPY TODAY! Simply register & download! > > -- > 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] restrictions
You need to follow my instructions and do "telnet x.x.x.x 25" notice the 25 after the IP ?? HiTCHO has Spoken! Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] > -Original Message- > From: Bruce Levick [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 9:35 AM > To: Timothy Hitchens (HiTCHO) > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] restrictions > > > Thanks, > Tried this and I get. > > "Cannot opeen connection to host on port 23" > > > > -Original Message- > From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 08, 2003 9:32 AM > To: Bruce Levick; 'Marco Tabini' > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] restrictions > > > In windowsxp do the following: > > Start -> Run > > Open: cmd > > At the shell type: > > telnet x.x.x.x 25< x.x.x.x being the smtp server > > If you get a prompt then you have other issues such as relay etc etc > > > > HiTCHO has Spoken! > Timothy Hitchens (HiTCHO) > [EMAIL PROTECTED] > > > -Original Message- > > From: Bruce Levick [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, 8 January 2003 9:25 AM > > To: Marco Tabini > > Cc: [EMAIL PROTECTED] > > Subject: RE: [PHP] restrictions > > > > > > Well I can't be totally sure but I think all outgoing mail > points to > > an external SMTP server. > > > > -Original Message- > > From: Marco Tabini [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, January 08, 2003 9:11 AM > > To: Bruce Levick > > Cc: [EMAIL PROTECTED] > > Subject: Re: [PHP] restrictions > > > > > > Hello Bruce-- > > > > That depends on what restrictions are imposed on your box, > of course. > > Does your company use an SMTP-compatible mail server for > your internal > > mail? If so, you could use the server your mail client points to to > > perform your tests. > > > > Cheers, > > > > > > Marco > > -- > > > > php|architect - The Monthly Magazine for PHP Professionals > > Come check us out on the web at http://www.phparch.com! > > GET YOUR FREE COPY TODAY! Simply register & download! > > > > -- > > 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] restrictions
Are you surfing and emailing from this box right now?? (strange if you are) HiTCHO has Spoken! Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] > -Original Message- > From: Bruce Levick [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 9:47 AM > To: Timothy Hitchens (HiTCHO) > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] restrictions > > > Sorry, I tried this as well and it failed to connect on port 25. > > -----Original Message- > From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 08, 2003 9:39 AM > To: Bruce Levick > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] restrictions > > > You need to follow my instructions and do "telnet x.x.x.x 25" > notice the 25 after the IP ?? > > > HiTCHO has Spoken! > Timothy Hitchens (HiTCHO) > [EMAIL PROTECTED] > > > -Original Message- > > From: Bruce Levick [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, 8 January 2003 9:35 AM > > To: Timothy Hitchens (HiTCHO) > > Cc: [EMAIL PROTECTED] > > Subject: RE: [PHP] restrictions > > > > > > Thanks, > > Tried this and I get. > > > > "Cannot opeen connection to host on port 23" > > > > > > > > -Original Message- > > From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, January 08, 2003 9:32 AM > > To: Bruce Levick; 'Marco Tabini' > > Cc: [EMAIL PROTECTED] > > Subject: RE: [PHP] restrictions > > > > > > In windowsxp do the following: > > > > Start -> Run > > > > Open: cmd > > > > At the shell type: > > > > telnet x.x.x.x 25< x.x.x.x being the smtp server > > > > If you get a prompt then you have other issues such as relay etc etc > > > > > > > > HiTCHO has Spoken! > > Timothy Hitchens (HiTCHO) > > [EMAIL PROTECTED] > > > > > -Original Message- > > > From: Bruce Levick [mailto:[EMAIL PROTECTED]] > > > Sent: Wednesday, 8 January 2003 9:25 AM > > > To: Marco Tabini > > > Cc: [EMAIL PROTECTED] > > > Subject: RE: [PHP] restrictions > > > > > > > > > Well I can't be totally sure but I think all outgoing mail > > points to > > > an external SMTP server. > > > > > > -Original Message- > > > From: Marco Tabini [mailto:[EMAIL PROTECTED]] > > > Sent: Wednesday, January 08, 2003 9:11 AM > > > To: Bruce Levick > > > Cc: [EMAIL PROTECTED] > > > Subject: Re: [PHP] restrictions > > > > > > > > > Hello Bruce-- > > > > > > That depends on what restrictions are imposed on your box, > > of course. > > > Does your company use an SMTP-compatible mail server for > > your internal > > > mail? If so, you could use the server your mail client > points to to > > > perform your tests. > > > > > > Cheers, > > > > > > > > > Marco > > > -- > > > > > > php|architect - The Monthly Magazine for PHP Professionals > > > Come check us out on the web at http://www.phparch.com! > > > GET YOUR FREE COPY TODAY! Simply register & download! > > > > > > -- > > > 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] restrictions
This is now getting to off list issues I would suggest!! HiTCHO has Spoken! Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] > -Original Message- > From: Bruce Levick [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 9:55 AM > To: Timothy Hitchens (HiTCHO) > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] restrictions > > > Yes I am and its very strange. I can't even ftp to my own website to > test it from there. > > -----Original Message- > From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 08, 2003 9:48 AM > To: Bruce Levick > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] restrictions > > > Are you surfing and emailing from this box right now?? (strange if you > are) > > HiTCHO has Spoken! > Timothy Hitchens (HiTCHO) > [EMAIL PROTECTED] > > > -Original Message- > > From: Bruce Levick [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, 8 January 2003 9:47 AM > > To: Timothy Hitchens (HiTCHO) > > Cc: [EMAIL PROTECTED] > > Subject: RE: [PHP] restrictions > > > > > > Sorry, I tried this as well and it failed to connect on port 25. > > > > -Original Message- > > From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, January 08, 2003 9:39 AM > > To: Bruce Levick > > Cc: [EMAIL PROTECTED] > > Subject: RE: [PHP] restrictions > > > > > > You need to follow my instructions and do "telnet x.x.x.x > 25" notice > > the 25 after the IP ?? > > > > > > HiTCHO has Spoken! > > Timothy Hitchens (HiTCHO) > > [EMAIL PROTECTED] > > > > > -Original Message- > > > From: Bruce Levick [mailto:[EMAIL PROTECTED]] > > > Sent: Wednesday, 8 January 2003 9:35 AM > > > To: Timothy Hitchens (HiTCHO) > > > Cc: [EMAIL PROTECTED] > > > Subject: RE: [PHP] restrictions > > > > > > > > > Thanks, > > > Tried this and I get. > > > > > > "Cannot opeen connection to host on port 23" > > > > > > > > > > > > -Original Message- > > > From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] > > > Sent: Wednesday, January 08, 2003 9:32 AM > > > To: Bruce Levick; 'Marco Tabini' > > > Cc: [EMAIL PROTECTED] > > > Subject: RE: [PHP] restrictions > > > > > > > > > In windowsxp do the following: > > > > > > Start -> Run > > > > > > Open: cmd > > > > > > At the shell type: > > > > > > telnet x.x.x.x 25< x.x.x.x being the smtp server > > > > > > If you get a prompt then you have other issues such as > relay etc etc > > > > > > > > > > > > HiTCHO has Spoken! > > > Timothy Hitchens (HiTCHO) > > > [EMAIL PROTECTED] > > > > > > > -Original Message- > > > > From: Bruce Levick [mailto:[EMAIL PROTECTED]] > > > > Sent: Wednesday, 8 January 2003 9:25 AM > > > > To: Marco Tabini > > > > Cc: [EMAIL PROTECTED] > > > > Subject: RE: [PHP] restrictions > > > > > > > > > > > > Well I can't be totally sure but I think all outgoing mail > > > points to > > > > an external SMTP server. > > > > > > > > -Original Message- > > > > From: Marco Tabini [mailto:[EMAIL PROTECTED]] > > > > Sent: Wednesday, January 08, 2003 9:11 AM > > > > To: Bruce Levick > > > > Cc: [EMAIL PROTECTED] > > > > Subject: Re: [PHP] restrictions > > > > > > > > > > > > Hello Bruce-- > > > > > > > > That depends on what restrictions are imposed on your box, > > > of course. > > > > Does your company use an SMTP-compatible mail server for > > > your internal > > > > mail? If so, you could use the server your mail client > > points to to > > > > perform your tests. > > > > > > > > Cheers, > > > > > > > > > > > > Marco > > > > -- > > > > > > > > php|architect - The Monthly Magazine for PHP Professionals > > > > Come check us out on the web at http://www.phparch.com! GET YOUR > > > > FREE COPY TODAY! Simply register & download! > > > > > > > > -- > > > > 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 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] anyway to do a 'whos online' from session variable?
Hmm... yes you could create an array of the files then check the last mod stamp using stat (remember to reset stat). Sessions are also cleaned up via the garbage collection system controlled via php.ini HiTCHO has Spoken! Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] > -Original Message- > From: Jeff Bluemel [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 10:04 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] anyway to do a 'whos online' from session variable? > > > yea, that will work. however, I was thinking of something a > little more dramatic like parsing the /tmp directly, > associating ID's, and killing dead sessions etc. > > "Timothy Hitchens )" <[EMAIL PROTECTED]> wrote in > message 004701c2b6a2$2dfeb6a0$0500a8c0@bambino">news:004701c2b6a2$2dfeb6a0$0500a8c0@bambino... > > Simple create a database table for logins and have a status > that you > > set to online / offline and last seen could also be added. > > > > Then it is just a simple SELECT statement. > > > > If you don't want to use a database you could flock (not perfect) a > > file then read in a serialised array and update then write out and > > unlock. > > > > > > > > HiTCHO has Spoken! > > Timothy Hitchens (HiTCHO) > > [EMAIL PROTECTED] > > > > > -Original Message- > > > From: Jeff Bluemel [mailto:[EMAIL PROTECTED]] > > > Sent: Wednesday, 8 January 2003 9:08 AM > > > To: [EMAIL PROTECTED] > > > Subject: [PHP] anyway to do a 'whos online' from session variable? > > > > > > > > > when a user logs into my system I set a variable > > > $_SESSION['username']. now, every page somebody pulls up it > > > revalidates their login so somebody cannot get into the > backend of > > > the system. > > > > > > now - is there a way I can make a utility that will show me the > > > session username's that are in use? it would be useful > to be able > > > to know who's currently online. this is a website that > will not be > > > published, and is used for a VERY limited number of people. > > > > > > Jeff > > > > > > > > > > > > -- > > > 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Editors
That is the advantage of Zend Studio is that it is Java and will run on Win, Mac OSX and Linux. That is one of the reasons we use Zend Studio is that we can get our designers on OSX, geeks on linux/unix and executive types mostly Windows all using the same application for code writing, maintenance and soon management with the introduction of CVS integration (2.6) just announced on zend.com Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Pierre-Luc Soucy [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 12:07 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] PHP Editors > > > Do you know any good equivalent with similar features for Linux? > > Thanks, > > Pierre-Luc Soucy > > > PHPEdit i use it personally www.phpedit.net > > > > -- > 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] anyway to do a 'whos online' from session variable?
Arr the garbage collection is based on a probability (session.gc_probability) and therefore it will clean up if you get enough hits to the server. Check the documentation for config of sessions. I use db for sessions with a check to ensure db is available. (you can then cleanup whatever you want) Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 1:11 PM > To: Timothy Hitchens (HiTCHO) > Cc: 'Jeff Bluemel'; [EMAIL PROTECTED] > Subject: RE: [PHP] anyway to do a 'whos online' from session variable? > > > > > On Wed, 8 Jan 2003, Timothy Hitchens (HiTCHO) wrote: > > > Hmm... yes you could create an array of the files then > check the last > > mod stamp using stat (remember to reset stat). > > > > Sessions are also cleaned up via the garbage collection system > > controlled via php.ini > > How do you force garbage collection? I've written an > application using sessions for storage and there's been a > session sitting in my /tmp directory for 2 days now, well > over the 1440 seconds expiration. > > Ed > > > > -- > 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] How to detect a PHP script time-out?
This is a fairly simple one if both the server and browser obey the specs: Set up output buffering on your page then if the page times out the buffer should be sent to the browser and that is loaded with your message. PSEUDO CODE: start output buffering put into buffer the required message start building actual page in a string behind the scenes fork--> page times out the buffer is sent out --> page ends properly ... clear the buffer and output the string you built Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Jean-Christian Imbeault [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 1:25 PM > To: [EMAIL PROTECTED] > Subject: [PHP] How to detect a PHP script time-out? > > > How can I detect if my PHP script is about to time-out? > > I would like to be able to detect a time-out and display a > page with an > appropriate error message "i.e. the server is busy now, > please try again > later". > > Jc > > > -- > 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] How to detect a PHP script time-out?
You want a call back method for timeout none avail. - auto append won't work - register shutdown won't work I don't know of another solution right now. Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Jean-Christian Imbeault [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 1:43 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] How to detect a PHP script time-out? > > > Timothy Hitchens ) wrote: > > > > Set up output buffering on your page then if the page times out the > > buffer should be sent to the browser and that is loaded with your > > message. > > Ok. Is there another solution? > > The reason I ask is that in order to use your solution I > would need to > redesign my pages (quite a few of them). > > I was hoping to be able to do something like this: > > if (timeout()) include("try_again.html"); > > Thanks, > > Jc > > > -- > 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] Re: Double entry into MySQL..
When they first click on the file their browser will make a request for type, size etc then when it display's the dialog box on the screen of the client it will make another request to start the download. I get around this by putting the session id into the database and if it is double requested within 5 seconds to discard. So you will need to do a select, num_rows then if below 1 insert. Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Altug Sahin [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 2:07 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Re: Double entry into MySQL.. > > > Another strange behaviour... When I send the name of the file > to be downloaded to this script, it works (still makes a > double entry into MySQL > though) with GET method but it doesn't work if the file's > name is sent with the POST method. > > Why? I am pulling my hair out here!!! > > Please help... > > Thanks again > > "Altug Sahin" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Hi here, > > > > > I am sending a file to user's browser and logging the downloaded file > > into MySQL but everytime this script works, I see double > entry in the > > MySQL table... Why is this happening? > > > > Any ideas? > > > > Thanks > > > > > $today = date("Y-m-d"); > > > > $conn = db_connect(); > > > > if(!$conn) > > echo "Can't connect to database..."; > > > > $query = "INSERT INTO track_dl (dldate, email, file) > > VALUES ('$today', '[EMAIL PROTECTED]', 'file.ext')"; > > > > $result = mysql_query($query); > > > > if(!$result) > > echo "Can't execute query: " . mysql_error(); > > > > header("Content-type: application/pdf"); readfile("file.pdf"); > > exit(); > > ?> > > > > > > > > -- > 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] Re: htmlspecialchars() or htmlentities without destroying tags?
Is that going to take care of Nested Tags?? Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Greg Beaver [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 3:06 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Re: htmlspecialchars() or htmlentities without > destroying tags? > > > Hi Justin, > > You have to specify the list of tags you want preserved in an > array, but this function from phpDocumentor will do it: > > /** > * smart htmlentities, doesn't entity the allowed tags list > * Since version 1.1, this function uses htmlspecialchars > instead of htmlentities, for international support > * @param string $s > * @return string browser-displayable page > */ > function adv_htmlentities($s,$html_allowed) > { > $___htmltemp = array_flip($html_allowed); > $___html1 = array(); > foreach($___htmltemp as $tag => $trans) > { > $___html1['<'.$tag.'>'] = htmlentities('<'.$tag.'>'); > $___html1[''] = htmlentities(''); > } > $_html = array_flip($___html1); > } > $result = htmlspecialchars($s); > $entities = > array_flip(get_html_translation_table(HTML_SPECIALCHARS)); > $result = strtr($result,$_html); > $matches = array(); > preg_match_all('/(<img.*>)/U',$result,$matches); > for($i=0;$i { > $result = > str_replace($matches[1][$i],strtr($matches[1][$i],array_flip(g > et_html_transl > ation_table(HTML_SPECIALCHARS))),$result); > } > preg_match_all('/(<font.*>)/U',$result,$matches); > for($i=0;$i { > $result = > str_replace($matches[1][$i],strtr($matches[1][$i],array_flip(g > et_html_transl > ation_table(HTML_SPECIALCHARS))),$result); > } > preg_match_all('/(<ol.*>)/U',$result,$matches); > for($i=0;$i { > $result = > str_replace($matches[1][$i],strtr($matches[1][$i],array_flip(g > et_html_transl > ation_table(HTML_SPECIALCHARS))),$result); > } > preg_match_all('/(<ul.*>)/U',$result,$matches); > for($i=0;$i { > $result = > str_replace($matches[1][$i],strtr($matches[1][$i],array_flip(g > et_html_transl > ation_table(HTML_SPECIALCHARS))),$result); > } > preg_match_all('/(<li.*>)/U',$result,$matches); > for($i=0;$i { > $result = > str_replace($matches[1][$i],strtr($matches[1][$i],array_flip(g > et_html_transl > ation_table(HTML_SPECIALCHARS))),$result); > } > preg_match_all('/(<a .*>)/U',$result,$matches); > for($i=0;$i { > $result = > str_replace($matches[1][$i],strtr($matches[1][$i],array_flip(g > et_html_transl > ation_table(HTML_SPECIALCHARS))),$result); > } > return $result; > } > > Regards, > Greg > -- > phpDocumentor > http://www.phpdoc.org > "Justin French" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi all, > > Has anyone got a function or regexp floating around that will convert behave > like htmlspecialchars() or htmlentities() (eg converting & to &, " > to "e;, etc etc) BUT NOT DESTROY HTML TAGS? > > Eg: > > "hello" said Fred & Judy > > should become: > > "hello" said Fred & Judy > > NOT: > "hello" said <a href="fred.php">Fred & > Judy > > > > I guess it's stripped down or limited version of htmlspecialchars() or > htmlentities(). > > > Justin > -- 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] How to detect a PHP script time-out?
Issue... as I said before the register shutdown won't work because: - output from the shutdown is not visible nor do you have access to some variables Result: no message as you wanted to show to the client. Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Jean-Christian Imbeault [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 3:29 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] How to detect a PHP script time-out? > > > Greg Beaver wrote: > > > > http://www.php.net/manual/en/features.connection-handling.php > > Nice! > > So if I understand correctly I need to: > > 1- register a shutdown function > 2- have this function check if it was called b/c of a > conection_timeout() > 3- And if so have the function print out my timeout error message > > So in my script I could put something like this: > > function timeout_message() { >if ( connection_timeout() ) { > echo "server busy, try again later"; >} > } > > register_shutdown_function('timeout_message'); > > [rest of my script goes here ...] > > ?> > > If the script timesout then my error function is called. Is > that about > right? > > Jc > > > -- > 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] How to detect a PHP script time-out?
There is one last option ... register an output buffer as I suggested before suggested but this time do the reverse and you don't have to rewrite your scripts: Please be aware that this will add _some_ load but will solve your issues. You can then add in things like error checking etc etc Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Jean-Christian Imbeault [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 3:43 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] How to detect a PHP script time-out? > > > Timothy Hitchens ) wrote: > > Issue... as I said before the register shutdown won't work because: > > > > - output from the shutdown is not visible nor do you have access to > > some variables > > You are right. From the manual: > http://www.php.net/manual/en/function.register-shutdown-function.php " The registered shutdown functions are called after the request has been completed (including sending any output buffers), so it is not possible to send output to the browser using echo() or print(), or retrieve the contents of any output buffers using ob_get_contents()." That's no good ... There definitely should be a function that gets called (or can be registered) when a script times out ... A time-out indicates an error on my end (the server) and I would like to be able to detect it and take action ... If the is no way to do this then PHP is lacking. I'd definitely ask for this to be implemented ;) Jc -- 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] How to detect a PHP script time-out?
No you can't.. the issue with this is that you need to have error reporting turned on.. so you will need to have more error collecting or removing. The error is something like: "Fatal error: Maximum execution.." so we are checking for just this in the regex. This isn't the best for a production env but this is the best I can see considering you don't want to rewrite!! Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Jean-Christian Imbeault [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 5:17 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] How to detect a PHP script time-out? > > > Timothy Hitchens ) wrote: > > There is one last option ... register an output buffer as I > suggested > > before suggested but this time do the reverse and you don't have to > > rewrite your scripts: > > Ok I think I understand what you are proposing. I just have > one question > about your example code. > > Where does the string "Maximum execution" come from? Is this output > automatically by PHP when a script times out? > > Would it be possible to use: > > if (connection_status == 2) {} > > Jc > > > > > > ob_start('scriptTimeout'); > > > > // set to 1 this should show the error below set to 2 and above you > > should get the normal output!! set_time_limit(1); > > > > function scriptTimeout($buffer) > > { > > if (eregi('Maximum execution', $buffer)) > > { > > $buffer = 'Server Overloaded!!'; > > } > > > > return $buffer; > > } > > > > // > > // content area > > // > > > > for ($i = 0; $i < 100; $i++) > > { > > $output = $i; > > } > > > > echo 'We are upto a final count of: '.$output; > > > > ?> > > > > > -- > 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] Re: Double entry into MySQL..
I wish it was as simple as that but in the past it just hasn't always worked!! Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Marek Kilimajer [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 7:29 PM > To: Timothy Hitchens (HiTCHO) > Cc: 'Altug Sahin'; [EMAIL PROTECTED] > Subject: Re: [PHP] Re: Double entry into MySQL.. > > > You should be able to get around it also by checking > if $_SERVER[REQUEST_METHOD]=='HEAD' > > Timothy Hitchens (HiTCHO) wrote: > > >When they first click on the file their browser will make a > request for > >type, size etc then when it display's the dialog box on the > screen of > >the client it will make another > >request to start the download. > > > >I get around this by putting the session id into the > database and if it > >is double requested within 5 seconds to discard. So you will > need to do > >a select, num_rows then if below 1 insert. > > > > > >Timothy Hitchens (HiTCHO) > >Open Platform Consulting > >e-mail: [EMAIL PROTECTED] > > > > > > > >>-Original Message- > >>From: Altug Sahin [mailto:[EMAIL PROTECTED]] > >>Sent: Wednesday, 8 January 2003 2:07 PM > >>To: [EMAIL PROTECTED] > >>Subject: [PHP] Re: Double entry into MySQL.. > >> > >> > >>Another strange behaviour... When I send the name of the file > >>to be downloaded to this script, it works (still makes a > >>double entry into MySQL > >>though) with GET method but it doesn't work if the file's > >>name is sent with the POST method. > >> > >>Why? I am pulling my hair out here!!! > >> > >>Please help... > >> > >>Thanks again > >> > >>"Altug Sahin" <[EMAIL PROTECTED]> wrote in message > >>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > >> > >> > >>>Hi here, > >>> > >>> > >>> > >>> > >>I am sending a file to user's browser and logging the > downloaded file > >> > >> > >>>into MySQL but everytime this script works, I see double > >>> > >>> > >>entry in the > >> > >> > >>>MySQL table... Why is this happening? > >>> > >>>Any ideas? > >>> > >>>Thanks > >>> > >>> >>> $today = date("Y-m-d"); > >>> > >>> $conn = db_connect(); > >>> > >>> if(!$conn) > >>> echo "Can't connect to database..."; > >>> > >>> $query = "INSERT INTO track_dl (dldate, email, file) > >>>VALUES ('$today', '[EMAIL PROTECTED]', 'file.ext')"; > >>> > >>> $result = mysql_query($query); > >>> > >>> if(!$result) > >>> echo "Can't execute query: " . mysql_error(); > >>> > >>>header("Content-type: application/pdf"); readfile("file.pdf"); > >>>exit(); ?> > >>> > >>> > >>> > >>> > >> > >>-- > >>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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] uid checked by file_exists()
Have you checked your php.ini for a safe mode setting to true/on ?? Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Emmanuel.Leguy [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 7:49 PM > To: [EMAIL PROTECTED] > Subject: [PHP] uid checked by file_exists() > > > Hello, > > I've just installed PHP 4.3.0. The 4.0.6 was installed > before. With the > new version, in safe mode, the 'file_exists' function produce > this warning: > > Warning: file_exists() [function.file-exists]: SAFE MODE > Restriction in > effect. The script whose uid is 302 is not allowed to access > /full/path/to/file.gif owned by uid 301 in > /full/path/to/script.php on > line 12 > > I did not have this problem with version 4.0.6. > > Please help me! > > Thank you, > > > Emmanuel. > > > -- > 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] Re: EOF: how to generate one in a string
I would suggest you have a look at: http://expect.nist.gov/ Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Jean-Christian Imbeault [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 8:24 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Re: EOF: how to generate one in a string > > > I'm at wits end ... I've tried everything from system(), > shell_exec(), > bacticks, popen() and still no go ... > > I even tried writing the data to file first and then doing a > system("./prog 2>&1 < ./datafile") and that didn't work either. > > I know that it shoudl work b/c if from the command line I > issue the same > command (using the file created by PHP) it works fine. > > Can anyone offer advice on why I can't get PHP to execute > this external > program? > > Thanks! > > Jc > > > -- > 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] Warning: Unlink failed (Permission denied) in
You are trying to delete/unlink a file with a php script. Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Kevin Meredith [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 8 January 2003 9:54 PM > To: PHP > Subject: [PHP] Warning: Unlink failed (Permission denied) in > > > Please could someone let me know the cause of this error message > "Warning: Unlink failed (Permission denied) in ...". > > Regards > Kevin > > -- > 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] ftp_put: permission denied
I am assuming you have testing from a desktop client. Are you sure that the PHP script has been logged in?? Can you see via a log file of the successful authentication?? Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Oliver Witt [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 4:53 AM > To: [EMAIL PROTECTED] > Subject: [PHP] ftp_put: permission denied > > > Hi, > I am running a really simple php script to upload files on my > server via ftp. But it always return this warning: ftp_put(): > Permission denied I can't have to do anything with CHMOD can > it? I mean it's ftp!! I don't know what else it is but I > guess it's a pretty common problem. Thx for any help, Olli > > > -- > 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] apache + mod_php question
use: apachectl graceful It will reload the config's and allow operation to continue!! See apachectl (help) start - start httpd stop - stop httpd restart- restart httpd if running by sending a SIGHUP or start if not running fullstatus - dump a full status screen; requires lynx and mod_status enabled status - dump a short status screen; requires lynx and mod_status enabled graceful - do a graceful restart by sending a SIGUSR1 or start if not running configtest - do a configuration syntax test help - this screen Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Hugh Beaumont [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 5:14 AM > To: [EMAIL PROTECTED] > Subject: [PHP] apache + mod_php question > > > Hello, > > I have searched the archives and not been able to find the > solution to > the following problem. I would be very grateful if someone > here could help or provide some pointers. > > The basic problem is this: > > Our apache server will not start if there are system > processes running that were spawned from apache's last > invocation (ie. spawned from cgi's, mod_php system() calls, > etc.). It dies with "cannot bind to ip_address_here port 80", etc. > > > Example: > > We restart our servers every so often via crontab in order to > reload modified conf files, etc. However it appears that if > a user has spawned a process from mod_php, cgi, etc. that the > server will not restart until those processes are killed off > manually. > > The worst cases are when badly wrote user scripts allow an > attacker to upload scripts that bind to a port and attempt to > make network access, etc. (I would love to disallow users > from having uploads to the server but > that is not currently an option). > > Does anyone have any suggestion on how to automagically kill > these processes? > > Does anyone have their own favorite recipe for > stopping/starting apache in an automated fashion. > > Right now these situations result in downtime for users and a > pager in the middle of the night to me! I would very much > like to stop this :) > > Thanks much! > > > __ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.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
RE: [PHP] anyway to do a 'whos online' from session variable?
If you use a database for session management you have total control over when and what is garbage collected and therefore extend / delete whatever anytime you want. Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Jeff Bluemel [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 5:24 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] anyway to do a 'whos online' from session variable? > > > ok - let me take that a step further - if I store the SID in > the table also are the files in the /tmp directory stored > with the SID? if they are this may be a way I can delete out > inactive session, but be able to allow extended inactive > sessions for users who may be pulling lengthy reports... > > > "Timothy Hitchens )" <[EMAIL PROTECTED]> wrote in > message 007e01c2b6c4$4612d600$0500a8c0@bambino">news:007e01c2b6c4$4612d600$0500a8c0@bambino... > > Arr the garbage collection is based on a probability > > (session.gc_probability) and therefore it will clean > > up if you get enough hits to the server. Check the > documentation for > > config of sessions. > > > > I use db for sessions with a check to ensure db is > available. (you can > > then cleanup whatever you want) > > > > > > > > Timothy Hitchens (HiTCHO) > > Open Platform Consulting > > e-mail: [EMAIL PROTECTED] > > > > > -Original Message- > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > > > Sent: Wednesday, 8 January 2003 1:11 PM > > > To: Timothy Hitchens (HiTCHO) > > > Cc: 'Jeff Bluemel'; [EMAIL PROTECTED] > > > Subject: RE: [PHP] anyway to do a 'whos online' from session > > > variable? > > > > > > > > > > > > > > > On Wed, 8 Jan 2003, Timothy Hitchens (HiTCHO) wrote: > > > > > > > Hmm... yes you could create an array of the files then > > > check the last > > > > mod stamp using stat (remember to reset stat). > > > > > > > > Sessions are also cleaned up via the garbage collection system > > > > controlled via php.ini > > > > > > How do you force garbage collection? I've written an application > > > using sessions for storage and there's been a session > sitting in my > > > /tmp directory for 2 days now, well over the 1440 seconds > > > expiration. > > > > > > Ed > > > > > > > > > > > > -- > > > 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ftp_put: permission denied
Using ftp_login() ?? Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Oliver Witt [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 5:30 AM > To: [EMAIL PROTECTED]; Timothy Hitchens ) > Subject: Re: [PHP] ftp_put: permission denied > > > "Timothy Hitchens )" schrieb: > > > I am assuming you have testing from a desktop client. > > > > Are you sure that the PHP script has been logged in?? > > > > Can you see via a log file of the successful authentication?? > > > > I logged in using the same information as I used to upload > that script. > > if ((!$conn_id) || (!$login_result)) { > echo "Not logged in"; > die; > } else { > echo "Logged in"; > } > > That script returned Logged in. > Olli > > > > -- > 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] How Do I Return Values Across Servers
If I understand you want to be able to get a value from a script on another server. Well I would suggest a really each way would be to do have the calling server call a script on the supplying server using include(); which is supported but please see this page regarding URL fopen wrappers: http://www.php.net/manual/en/function.include.php Requests for includes and on the supplying server simply output the value like: If you do it this way it will be simply included and be available as a variable instantly. (**subject to security issues and speed) Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Bill Arbuckle, Jr. [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 8:17 AM > To: [EMAIL PROTECTED] > Subject: [PHP] How Do I Return Values Across Servers > > > This may be a no-brainer for everyone but me but ... I have > several php scripts residing on a web site on Server A. In a > library file on Server A are misc. functions, some of which > query an underlying database and return a text string as the > result. On another web site on Server B I would like to call > these functions to get the result without reinventing the > wheel so to speak. So my question is ... How can I call a > function that returns a text string from Server A in a script > requiring that text during the processing of a web page on > Server B ... all in php? Thanks in advance. > > Bill > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] strange problem (user poll)
You need to check like this: if (isset($action) && $action == 'add') AND if it is 4.1 + and global vars are turned off?? if (isset($_GET['action']) && $_GET['action'] == 'add') ** The above will need to changed if it is POST in the above example!! Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: - [ Paul Ferrie ] - [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 8:43 AM > To: [EMAIL PROTECTED] > Subject: [PHP] strange problem (user poll) > > > Can anyone see a problem in this? When i run the script i am > getting this error "Notice: Undefined variable: action in > C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13" > > // addpoll.php > // Case Study 1: User Poll - Foundation PHP for Flash > > // If the form has been submitted... > (line 13) if ($action == "add") { > // Include config file > include('common.php'); > > // Connect to database > $link = dbConnect(); > > // Get date for new poll > $posted = time(); > > // Build query to insert new poll > $query = "INSERT INTO polls (question, option1, option2, option3, > posted) > VALUES('$question', '$option1', '$option2', > '$option3', $posted)"; > > // Execute query > $result = @mysql_query($query); > > // If query failed... > if (!$result) { > // Display error > print "Could not insert > poll\n"; > } else { > print "Poll added\n"; > } > > mysql_close($link); > } > ?> > please anyone > > > > -- > 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] How Do I Return Values Across Servers
Issue you have is that if it is on another server you must you a http etc transport to get it!! Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Bill Arbuckle, Jr. [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 9:38 AM > To: Timothy Hitchens (HiTCHO); [EMAIL PROTECTED] > Subject: RE: [PHP] How Do I Return Values Across Servers > > > Yes, I want to get a value from a script on Server A that > runs against a database on Server A, returning that value to > a script variable on Server B. > > I read the manual but must have missed something. This is > what *seemed* as if it should work: > > Server A (containing functions and database) > qotd.php > > requireonce('miscfuncs.php'); > $qotd= qotd(); > ?> > > ** qotd()is a f(x) in miscfuncs.php > > = > Server B > test.php > > ... HTML stuff > > include 'http://www.servera.com/qotd.php'; > echo $qotd . "\n\n"; > ?> > > ... More HTML stuff > > With this setup I get the following error: Warning: Failed > opening 'http://www.servera.com/qotd.php' for inclusion > (include_path='.;c:\php4\pear') in > c:\webdev\kids\homebody.inc on line 27 > > Any ideas? I know that I am missing something here. > > Thanks, > > Bill > > > > -Original Message- > From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 08, 2003 4:45 PM > To: 'Bill Arbuckle, Jr.'; [EMAIL PROTECTED] > Subject: RE: [PHP] How Do I Return Values Across Servers > > > If I understand you want to be able to get a value from a > script on another server. > > Well I would suggest a really each way would be to do have > the calling server call a script on the supplying server > using include(); which is supported but please see this page > regarding URL fopen wrappers: > http://www.php.net/manual/en/function.include.php Requests for includes and on the supplying server simply output the value like: If you do it this way it will be simply included and be available as a variable instantly. (**subject to security issues and speed) Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Bill Arbuckle, Jr. [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 8:17 AM > To: [EMAIL PROTECTED] > Subject: [PHP] How Do I Return Values Across Servers > > > This may be a no-brainer for everyone but me but ... I have several > php scripts residing on a web site on Server A. In a library file on > Server A are misc. functions, some of which query an underlying > database and return a text string as the result. On another web site > on Server B I would like to call these functions to get the result > without reinventing the wheel so to speak. So my question is ... How > can I call a function that returns a text string from Server A in a > script requiring that text during the processing of a web page on > Server B ... all in php? Thanks in advance. > > Bill > -- 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] HTML email that generates "!"s - any ideas?
You need to set an encoding and encode the body see: http://www.php.net/manual/en/function.imap-8bit.php **You will need to add the headers for this plus encode** Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Tom Rogers [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 9:49 AM > To: Philipp Hartmann > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] HTML email that generates "!"s - any ideas? > > > Hi, > > Thursday, January 9, 2003, 7:31:35 AM, you wrote: > PH> Hi everyone, I am new to this list, so this is my first post. > > PH> I am trying to sen dan HTML email, and so far I got everything > PH> running, except for one very odd problem. > > PH> 1.) I am setting up all my variables within the .php Script. > PH> 2.) I generate my HTML email > PH> 3.) I am outputting the email to the browser and send it to myself > > -->> Now here comes the problem: > > PH> In the browseroutput the text looks like I want it to be. In the > PH> email however, there are several EXCLAMATION MARKS ("!") added to > PH> the code (and therefore the body). > PH> How can this happen?? Is there some trick I have missed? > The exclamation > PH> marks are > PH> positioned within the email according to the amaount of > characters I submit > PH> with the > PH> email. > > PH> I have set up a simple page where you can view the .php file, the > PH> output and the email. > > PH> http://www.gsdh.org/pleasehelp/index.html > > PH> If anyone of you could spare the time, I would be really > gratefull > PH> as I have to finish this but am stuck! :( > > PH> Thans again, > PH> Philipp > > What happens if you paste the php output directly into your mailer ? > > -- > regards, > Tom > > > -- > 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] $query help :(
$posted needs to have '' around it!! <-- this could be stopping it!! (and always check to see if the vars exist first and if you are using 4.1 + with globals off you will need to change you code now or in the future) Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: - [ Paul Ferrie ] - [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 10:07 AM > To: [EMAIL PROTECTED] > Subject: [PHP] $query help :( > > > Hi again guys i have run into another problem :( > > i am trying to build a user poll (flash+php+mysql) > I have the interface all sorted but i have a problem with my > add new poll php file. When i hit the update poll button in > flash it seem that everthing has work and it' send back a msg > saying all went well :). but when i check with phpmyadmin i > see that the $query has been successfully added but the > "question","opt1","opt2","opt3" fields are blank no data > added. the only fields to be added were the auto_id and date > stamp below is a sample code of the php file and after that > you will see the code on the button. > > [php] > if ($action == "add") { > // Include config file > include('common.php'); > > // Connect to database > $link = dbConnect(); > > // Get date for new poll > $posted = time(); > > // Build query to insert new poll > $query = "INSERT INTO polls (question, option1, option2, option3, > posted) VALUES ('$quest1', '$opt1', '$opt2', '$opt3', $posted)"; > > // Execute query > $result = @mysql_query($query); > > // If query failed... > if (!$result) { > // Display error > print "&result=Could not insert poll"; > } else { > print "&result=poll created"; > } > > mysql_close($link); > } > ?> > [/php] > > on the button in Flash i have > [code] > on (release) { > if (!quest1.length) { > result = "fields missing"; > } > if (!opt1.length) { > result = "fields missing"; > } > if (!opt2.length) { > result = "fields misasing"; > } > if (!opt3.length) { > result = "fields missing"; > } else { > loadVariables("addpoll.php", this, "POST"); > gotoAndPlay(2); > } > } > > [/code] > > I have tried everything i can think of but i cab't seem to > get it working. Can anyone see anything i am missing? Cheers > > > > > -- > 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] Variables
You are referring to Variables of Variables see: http://www.php.net/manual/en/language.variables.variable.php Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] -Original Message- From: Stephen [mailto:[EMAIL PROTECTED]] Sent: Thursday, 9 January 2003 10:52 AM To: PHP List Subject: [PHP] Variables Yet another question: How would you make a variable's name the value of another variable? For example... Variable 1's value is "joe." I want to make the value of variabe one, or joe, the name of variable two which would equal something else. Thanks, Stephen Craton http://www.melchior.us "What's the point in appearance if your true love, doesn't care about it?" -- http://www.melchior.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Stumped...
Do you require searching of this data eg... select via these numbers or not?? Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] -Original Message- From: Stephen [mailto:[EMAIL PROTECTED]] Sent: Thursday, 9 January 2003 11:56 AM To: PHP List Subject: [PHP] Stumped... Sorry for so many questions but this should be the last one for a while. I have a form that I want to insert into a MySQL table. This form is based on how many entries a user wants to enter. For example, a user wants to type in 12 names, so 12 form fields appear. Or they want 50, 50 appear. What I want to do is store them all into a database, but for one, I can't quit figure out how I can insert them, and second, even if I did know how, I couldn't possibly make enough tables unless I made 999 since I put the char limit to 3 digits. How could I work this keeping in mine any number between 1 and 999 could be entered and without making 999 tables? Thanks, Stephen Craton http://www.melchior.us "What's the point in appearance if your true love, doesn't care about it?" -- http://www.melchior.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Stumped...
What you can do it simply get the data and create an array serialise the array and sent it to the database ... the issue that arises from this is that you can't select if that record has 45 and 786 etc etc The other option you have is to create a table then a second table that has entries that show you which numbers it has: Table 1: Code Name etc Table 2: Code Number You will end up with multiple numbers listed in table 2 but you can then easily find everyone with number 45. Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Stephen [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 12:00 PM > To: Timothy Hitchens (HiTCHO) > Cc: PHP List > Subject: Re: [PHP] Stumped... > > > I will later select them and display them to be edited, but > other then that, not really... > > > ----- Original Message - > From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]> > To: "'Stephen'" <[EMAIL PROTECTED]>; "'PHP List'" > <[EMAIL PROTECTED]> > Sent: Wednesday, January 08, 2003 8:58 PM > Subject: RE: [PHP] Stumped... > > > : Do you require searching of this data eg... select via > these numbers or > : not?? > : > : > : Timothy Hitchens (HiTCHO) > : Open Platform Consulting > : e-mail: [EMAIL PROTECTED] > : > : > : -Original Message- > : From: Stephen [mailto:[EMAIL PROTECTED]] > : Sent: Thursday, 9 January 2003 11:56 AM > : To: PHP List > : Subject: [PHP] Stumped... > : > : > : Sorry for so many questions but this should be the last one > for a while. > : > : I have a form that I want to insert into a MySQL table. This form is > : based on how many entries a user wants to enter. For example, a user > : wants to type in 12 names, so 12 form fields appear. Or > they want 50, 50 > : appear. What I want to do is store them all into a database, but for > : one, I can't quit figure out how I can insert them, and > second, even if > : I did know how, I couldn't possibly make enough tables > unless I made 999 > : since I put the char limit to 3 digits. How could I work > this keeping in > : mine any number between 1 and 999 could be entered and > without making > : 999 tables? > : > : Thanks, > : Stephen Craton > : http://www.melchior.us > : > : "What's the point in appearance if your true love, doesn't > care about > : it?" -- http://www.melchior.us > : > : > : > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] apache and php
Your settings should be something similar to this: AddType application/x-httpd-php .php .html AddType application/x-httpd-php-source .phps Do you have the page remotely available to see what is happening for you?? Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Gareth Thomas [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 12:03 PM > To: [EMAIL PROTECTED] > Subject: [PHP] apache and php > > > I am trying to run a PHP page from my browser (Mozilla) and > each time I load the page it is attempting to force a dowload > of the page instead, based on the mime-type. I had been > developing a command line PHP application which works fine > and then had just started on a web interface and realised > that Apache may not be configured correctly. So I edited > httpd.conf and added the Add Type line for x-type-httpd .php. > I am running Apache 2.0.40 on RedHat 8 and PHP 4.3.0pre2. Can > anyone tell me what I am doing wrong? What should the > modifications be to httpd.conf for PHP? > > Thanks in advance > > > > > > -- > 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] How to strip extra characters off of a string
Give this a shot ... a bit of a hack but works for you: Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 12:17 PM > To: php-general > Subject: [PHP] How to strip extra characters off of a string > > > > I need to be able to just extract the number that is right > Under blocks in this example it is the number 57070. This was > generated by the quota -g groupname command. > > Disk quotas for group site53 (gid 165): > Filesystem blocks quota limit grace files > quota limit grace > /dev/hda4 57070 307201 3072001146 > 0 0 > > I have tried using some of the string > functions like I used > $test=strstr ($test, "hda"); > $test= substr("$test",7); > This well get me up to the start of the number but now I need > to get read of every thing after the number. Is there a > better way of getting this info or for striping all the other > stuff away. > > > > > -- > Best regards, > rdkurth mailto:[EMAIL PROTECTED] > > > -- > 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] Stumped...
Check out: http://www.php.net/manual/en/function.serialize.php Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Stephen [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 12:13 PM > To: Timothy Hitchens (HiTCHO) > Cc: PHP List > Subject: Re: [PHP] Stumped... > > > How would I serialise it? I can make the numbers into an > array, but if I echo the array itself, I'd get "Array" and I > need the number in the db, not the word... > > > - Original Message - > From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]> > To: "'Stephen'" <[EMAIL PROTECTED]> > Cc: "'PHP List'" <[EMAIL PROTECTED]> > Sent: Wednesday, January 08, 2003 9:09 PM > Subject: RE: [PHP] Stumped... > > > : What you can do it simply get the data and create an array > serialise the > : array and sent it to > : the database ... the issue that arises from this is that you can't > : select if that record has > : 45 and 786 etc etc > : > : The other option you have is to create a table then a > second table that > : has entries that show > : you which numbers it has: > : > : Table 1: > : > : Code > : Name > : etc > : > : Table 2: > : > : Code > : Number > : > : You will end up with multiple numbers listed in table 2 but > you can then > : easily find everyone with number 45. > : > : > : > : Timothy Hitchens (HiTCHO) > : Open Platform Consulting > : e-mail: [EMAIL PROTECTED] > : > : > -Original Message- > : > From: Stephen [mailto:[EMAIL PROTECTED]] > : > Sent: Thursday, 9 January 2003 12:00 PM > : > To: Timothy Hitchens (HiTCHO) > : > Cc: PHP List > : > Subject: Re: [PHP] Stumped... > : > > : > > : > I will later select them and display them to be edited, but > : > other then that, not really... > : > > : > > : > - Original Message - > : > From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]> > : > To: "'Stephen'" <[EMAIL PROTECTED]>; "'PHP List'" > : > <[EMAIL PROTECTED]> > : > Sent: Wednesday, January 08, 2003 8:58 PM > : > Subject: RE: [PHP] Stumped... > : > > : > > : > : Do you require searching of this data eg... select via > : > these numbers or > : > : not?? > : > : > : > : > : > : Timothy Hitchens (HiTCHO) > : > : Open Platform Consulting > : > : e-mail: [EMAIL PROTECTED] > : > : > : > : > : > : -Original Message- > : > : From: Stephen [mailto:[EMAIL PROTECTED]] > : > : Sent: Thursday, 9 January 2003 11:56 AM > : > : To: PHP List > : > : Subject: [PHP] Stumped... > : > : > : > : > : > : Sorry for so many questions but this should be the last one > : > for a while. > : > : > : > : I have a form that I want to insert into a MySQL table. > This form is > : > : based on how many entries a user wants to enter. For > example, a user > : > : wants to type in 12 names, so 12 form fields appear. Or > : > they want 50, 50 > : > : appear. What I want to do is store them all into a > database, but for > : > : one, I can't quit figure out how I can insert them, and > : > second, even if > : > : I did know how, I couldn't possibly make enough tables > : > unless I made 999 > : > : since I put the char limit to 3 digits. How could I work > : > this keeping in > : > : mine any number between 1 and 999 could be entered and > : > without making > : > : 999 tables? > : > : > : > : Thanks, > : > : Stephen Craton > : > : http://www.melchior.us > : > : > : > : "What's the point in appearance if your true love, doesn't > : > care about > : > : it?" -- http://www.melchior.us > : > : > : > : > : > : > : > > : > > : > : > : > > > > -- > 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] problem with location???
Hmm "language" !!! languaje Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Ysrael Guzmán [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 12:43 PM > To: [EMAIL PROTECTED] > Subject: [PHP] problem with location??? > > > give a idea please. > > This is correct? > > > location.href="page.php?<?=SID?>&cliente=$cli"; > > > > > Ysrael Guzmán Meza > > > > -- > 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] Different php.ini for each user on same server
You can set php_value and php_flags etc inside of the virtual host def in httpd.conf etc Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: SED [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 1:10 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Different php.ini for each user on same server > > > Is it possible to define a different php.ini for each user > which use the same server, either Unix and Windows. Let me > give you example what I > mean: > > User 1 (professional PHP-user) > Allow him big uploads, long execution time etc. > Virtual directory www.user1.com > > User 2 (amateur PHP-user) > Allow smal uploads, short execution time etc. > Virtual directory www.user2.com > > Thanks, > Sumarlidi E. Dadason > > SED - Graphic Design > _ > E-mail: [EMAIL PROTECTED] > website: www.sed.is > > > -- > 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] Different php.ini for each user on same server
Please keep it on list and (reply to all) as it assist everyone then!! Check out: http://www.php.net/manual/en/configuration.directives.php As a starting point!! Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: SED [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 1:14 PM > To: 'Timothy Hitchens (HiTCHO)' > Subject: RE: [PHP] Different php.ini for each user on same server > > > Thanks, do you know where I can find document about that? > > > Regards, > Sumarlidi E. Dadason > > SED - Graphic Design > _ > Tel: 896-0376, 461-5501 > E-mail: [EMAIL PROTECTED] > website: www.sed.is > > -Original Message- > From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] > Sent: 9. janúar 2003 03:09 > To: 'SED'; [EMAIL PROTECTED] > Subject: RE: [PHP] Different php.ini for each user on same server > > > You can set php_value and php_flags etc inside of the virtual > host def in httpd.conf etc > > > > Timothy Hitchens (HiTCHO) > Open Platform Consulting > e-mail: [EMAIL PROTECTED] > > > -Original Message- > > From: SED [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, 9 January 2003 1:10 PM > > To: [EMAIL PROTECTED] > > Subject: [PHP] Different php.ini for each user on same server > > > > > > Is it possible to define a different php.ini for each user > which use > > the same server, either Unix and Windows. Let me give you > example what > > I > > mean: > > > > User 1 (professional PHP-user) > > Allow him big uploads, long execution time etc. > > Virtual directory www.user1.com > > > > User 2 (amateur PHP-user) > > Allow smal uploads, short execution time etc. > > Virtual directory www.user2.com > > > > Thanks, > > Sumarlidi E. Dadason > > > > SED - Graphic Design > > _ > > E-mail: [EMAIL PROTECTED] > > website: www.sed.is > > > > > > -- > > 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Different php.ini for each user on same server
What you need to do is have a base php.ini and in each virtual you have the specific eg: # your vitual host DocumentRoot /www/docroot/first/ ServerName dummy.yourdomain.com php_admin_value disable_functions 'mysql_connect' php_admin_value sendmail_path '/usr/sbin/sendmail -f [EMAIL PROTECTED] -t -i' The you can add the file upload size flag and value just like that. Please note some flags and values can be added here and some to the .htaccess files with some restricted for security purposes such as base open etc!! Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: SED [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 1:27 PM > To: 'Timothy Hitchens (HiTCHO)'; [EMAIL PROTECTED] > Subject: RE: [PHP] Different php.ini for each user on same server > > > Maybe I'm little bit slow today but I already look into this > document. What paragraph should I focus better on? What I'm > looking for is *how > to* refer to a different php.ini in each case. > > Thanks, > SED > > -Original Message- > From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] > Sent: 9. janúar 2003 03:15 > To: 'SED' > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] Different php.ini for each user on same server > > > Please keep it on list and (reply to all) as it assist everyone then!! > > Check out: > > http://www.php.net/manual/en/configuration.directives.php > > As a starting point!! > > > Timothy Hitchens (HiTCHO) > Open Platform Consulting > e-mail: [EMAIL PROTECTED] > > > -Original Message- > > From: SED [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, 9 January 2003 1:14 PM > > To: 'Timothy Hitchens (HiTCHO)' > > Subject: RE: [PHP] Different php.ini for each user on same server > > > > > > Thanks, do you know where I can find document about that? > > > > > > Regards, > > Sumarlidi E. Dadason > > > > SED - Graphic Design > > _ > > Tel: 896-0376, 461-5501 > > E-mail: [EMAIL PROTECTED] > > website: www.sed.is > > > > -Original Message- > > From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] > > Sent: 9. janúar 2003 03:09 > > To: 'SED'; [EMAIL PROTECTED] > > Subject: RE: [PHP] Different php.ini for each user on same server > > > > > > You can set php_value and php_flags etc inside of the > virtual host def > > in httpd.conf etc > > > > > > > > Timothy Hitchens (HiTCHO) > > Open Platform Consulting > > e-mail: [EMAIL PROTECTED] > > > > > -Original Message- > > > From: SED [mailto:[EMAIL PROTECTED]] > > > Sent: Thursday, 9 January 2003 1:10 PM > > > To: [EMAIL PROTECTED] > > > Subject: [PHP] Different php.ini for each user on same server > > > > > > > > > Is it possible to define a different php.ini for each user > > which use > > > the same server, either Unix and Windows. Let me give you > > example what > > > I > > > mean: > > > > > > User 1 (professional PHP-user) > > > Allow him big uploads, long execution time etc. > > > Virtual directory www.user1.com > > > > > > User 2 (amateur PHP-user) > > > Allow smal uploads, short execution time etc. > > > Virtual directory www.user2.com > > > > > > Thanks, > > > Sumarlidi E. Dadason > > > > > > SED - Graphic Design > > > _ > > > E-mail: [EMAIL PROTECTED] > > > website: www.sed.is > > > > > > > > > -- > > > 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Databases vs. File Access
My 2 cents would be use a database and templates then create cached static versions of the pages on the first request and then when you need to changes things it is just a simple change the template and you a whole new look without the issue of performance. Make that 5 cents worth!! Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Jean-Christian Imbeault [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 3:54 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Re: Databases vs. File Access > > > Erich Kolb wrote: > > > > I am going to be dealing with a ton of data shortly and my > goal is to > > make it accessible via the web. I am curious about the performance > > differences between using a database or leaving the data in the > > individual files they originated in. Can anyone offer any > > recommendations? > > Depends on what you mean by "a ton of data" and what kind of work you > will do with the data. > > If all you will do is display the file as is on the web, then > leave in > file format. > > If the data needs to be searched, parsed, or indexed, the use a DB. > > My 2 cents, > > Jc > > > > -- > 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] Connection pool extension?
PHP supports sockets check out: http://www.php.net/manual/en/ref.sockets.php Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Vinod Panicker [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 9 January 2003 5:31 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Connection pool extension? > > > Hi, > > I was wondering if there is a php extension available that > allows me to do the following - > > 1.Connect to a given IP address and port > 2.Allow me to send and receive data from a particular ip and port > 3.Pool the connections so that further requests to the given ip > and port will reuse the existing connection > > Tx, > Vinod. > > --- > Vinod Panicker <[EMAIL PROTECTED]> > Sr. Software Designer > Geodesic Information Systems Ltd. > > > > -- > 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] HEEELP...please
You can get away without a include path set by ensuring that the path is absolute eg: If you have your data for your website as with FreeBSD in /usr/local/www/data/ you then do the following to include: ** assume you have a "lib" directory in the /data/ area ** moving from platform to platform always has some impact on includes!! include('/usr/local/www/data/lib/somefile.conf'); I hope this helps... the other way is to set the include paths etc!! Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Friday, 10 January 2003 11:00 AM > To: [EMAIL PROTECTED] > Subject: [PHP] HEEELP...please > > > I absolutely cannot understand the include_path directive. > Can somebody, please, explain this? > I have a situation that I find absolutely incomprehensible: I > moved my > experimental web-site from FreeBSD 4.5 running php4 v. 4.0 > (or something), > apache 1.13 where thesite worked just fine to another box > with FreeBSD 4.7 > running php4 v. 4.2.3, apache 1.13.27_1. > All of a sudden, I get the message: > Warning: Failed opening '/../lib/somefile.conf' for inclusion > (include_path='.:/usr/local/lib/php') in > /usr/local/www/html/index.php on > line 6 > > I can find nothing in the httpd.conf files that could account > for this; > there is no configuration in them for include_path. > > Obviously, the php file is being parsed correctly, but there > is a problem > with the line : > include "$DOCUMENT_ROOT/../lib/somefile.conf". > > It works on one machine, but not on the latest version of > php4 an apache. > > I see there are others on the net who have had this problem, > but I have not > yet found an explanation or a cure. > > HELP please, > > PJ > > > > > > > -- > 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] Medium to Large PHP Application Design
Many people develop their own framework which include classes / functions etc. We have build such a framework that includes authentication layers, custom mark-up language, advanced caching for data sets and templated content. If you develop your application correctly you can build in caching and replication systems for enterprise operations. Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Nick Oostveen [mailto:[EMAIL PROTECTED]] > Sent: Friday, 10 January 2003 1:52 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Medium to Large PHP Application Design > > > As PHP becomes more accepted in the corporate world, it is > only logical > that larger and more complex applications are going to be > developed using > it. While there is an abundance of information out there > about making > specific things work, there seems to be a shortage regarding > the big picture. > > As such, my question is this: What methods and techniques can > be used to > help design and build complex, medium to large PHP > applications that are > not only scalable, but maintainable and extensible? I'm > looking for online > references, personal experience and opinion and even examples of open > source code which you think demonstrate the above criteria on > this one. I > think an extended discussion on this topic could be of great > benefit to > everyone. > > Obviously separating application and business logic from > interface code is > a given, but what about other things? Are the object > orientated facilities > of PHP currently worth really trying to take advantage of? If > so, what are > you doing to take advantage of them? Are design concepts such > as design > patterns relevant at this level? What frameworks, if any, > currently exist > to assist in rapid, structured development, and what specific > benefits do > they bring to the table? > > These are just some of the questions that I'd like to see > expanded upon, > I'm sure there are others out there who can add more to the list. > > Nick Oostveen > > > -- > 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] Converting Excel Spreadsheet to MySQL table ...
Native Excel.. good luck as it is a binary format. If you save it as a CSV version of the document then you have many approaches to this issue. Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Adam Ferguson [mailto:[EMAIL PROTECTED]] > Sent: Friday, 10 January 2003 4:05 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Converting Excel Spreadsheet to MySQL table ... > > > Hello ... > > I was wondering if anyone had a good resource or code sample > for opening ( or accessing ) an excel spreadsheet using php. > I need to be able to convert a spreadsheet of products and > info to a table of products in a mysql database. Also ... I > need to be able to perform this on a Linux machine. Any help > would be great. > > Thanks guys! > Adam Ferguson > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] searching for string inside document
Use Preg: // put your html into $html preg_match('/(.*)<\/title>/Usi', $htlm, $title); echo $title[1]; ** very basic example Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Martin Hudec [mailto:[EMAIL PROTECTED]] > Sent: Friday, 10 January 2003 3:22 PM > To: [EMAIL PROTECTED] > Subject: [PHP] searching for string inside document > > > Hello, > > i have document in html and i want to get out string between > tags to put it into another variable.. > > i am wondering if i could use eregi() herebut how? I cant > figure out any possible way... same with strchr() and strstr() > > can anyone help me please? > > -- > Best regards, > Martin mail [EMAIL PROTECTED] > mobile +421.907.303.393 > icq34358414 > wwwhttp://www.corwin.sk > > PGP key fingerprint 21365ca05ecfd8aeb1cf19c838fff033 > > "In those days spirits were brave, the stakes were high, > men were real men, women were real women and small furry > creatures from Alpha Centauri were real small furry creatures > from Alpha Centauri." > > by Douglas Adams > > > -- > 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] searching for string inside document
Oops... // $htlm should have been $html preg_match('/(.*)<\/title>/Usi', $html, $title); Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message----- > From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] > Sent: Friday, 10 January 2003 3:22 PM > To: 'Martin Hudec'; [EMAIL PROTECTED] > Subject: RE: [PHP] searching for string inside document > > > Use Preg: > > // put your html into $html > > preg_match('/(.*)<\/title>/Usi', $htlm, $title); > > echo $title[1]; > > ** very basic example > > > Timothy Hitchens (HiTCHO) > Open Platform Consulting > e-mail: [EMAIL PROTECTED] > > > -Original Message- > > From: Martin Hudec [mailto:[EMAIL PROTECTED]] > > Sent: Friday, 10 January 2003 3:22 PM > > To: [EMAIL PROTECTED] > > Subject: [PHP] searching for string inside document > > > > > > Hello, > > > > i have document in html and i want to get out string between > > tags to put it into another variable.. > > > > i am wondering if i could use eregi() herebut how? I cant > > figure out any possible way... same with strchr() and strstr() > > > > can anyone help me please? > > > > -- > > Best regards, > > Martin mail [EMAIL PROTECTED] > > mobile +421.907.303.393 > > icq34358414 > > wwwhttp://www.corwin.sk > > > > PGP key fingerprint 21365ca05ecfd8aeb1cf19c838fff033 > > > > "In those days spirits were brave, the stakes were high, > > men were real men, women were real women and small furry > > creatures from Alpha Centauri were real small furry creatures > > from Alpha Centauri." > > > > by Douglas Adams > > > > > > -- > > 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is this possible with php?
So you want to be able to have a directory that when saved to it is really the server well besides ftp or samba integration into explorer the only other option you have is to use webdav with apache and that way it would be a post of sorts to the mod webdav module in apache. Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Friday, 10 January 2003 4:06 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Is this possible with php? > > > I would like to know if the follwing function can be > implemneted in php with help of other tools: > > using MS Word in windows, when a file is saved, can it be > AUTOMATICALLY uploaded (via http POST or other mechanism) to a server? > > Currently I need to first save it on my desktop, then upload > that copy to a php-supported server. > > Thanks in advance. > > Tim > > -- > 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] Make fil downloadable
You need to send headers to tell the browser how to handle it see: header(); or.. if it is a php file and you want the visitor to see/download the source you would be better off giving it another extension eg .phps or .txt etc or have a handler file that did a readfile after sending headers. Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] -Original Message- From: Stephen [mailto:[EMAIL PROTECTED]] Sent: Saturday, 11 January 2003 10:17 AM To: PHP List Subject: [PHP] Make fil downloadable I need to somehow make it so when a user clicks a link, then get displayed the download dialogue for the file. The file is a .php file so I'm not sure how this is done but I've seen it been done before. How can you do this? Thanks, Stephen Craton http://www.melchior.us "What's the point in appearance if your true love, doesn't care about it?" -- http://www.melchior.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Make fil downloadable
eg: Download File Click Here Now in the file.php you have: This won't put the headers into the downloaded file and remember to change the xxx.php into the file to be delivered and the xxx.php in the header to the name you would like them to save as. * the file.php in the top is not the real file but a script that reads into the buffer the real file!! Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Stephen [mailto:[EMAIL PROTECTED]] > Sent: Saturday, 11 January 2003 10:29 AM > To: Timothy Hitchens (HiTCHO) > Cc: PHP List > Subject: Re: [PHP] Make fil downloadable > > > It's a dynamically created file the user downloads and uses > later as a PHP script. If I put header() in it, that would > make it downloadable again when the user uses it on his/her > server, wouldn't it? > > > - Original Message - > From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]> > To: "'Stephen'" <[EMAIL PROTECTED]>; "'PHP List'" > <[EMAIL PROTECTED]> > Sent: Friday, January 10, 2003 7:24 PM > Subject: RE: [PHP] Make fil downloadable > > > : You need to send headers to tell the browser how to handle it see: > : header(); or.. if it is a php file and you want the visitor to > : see/download the source you would be better off giving it another > : extension eg .phps or .txt etc or have a handler file that did a > : readfile after sending headers. > : > : > : Timothy Hitchens (HiTCHO) > : Open Platform Consulting > : e-mail: [EMAIL PROTECTED] > : > : > : -Original Message- > : From: Stephen [mailto:[EMAIL PROTECTED]] > : Sent: Saturday, 11 January 2003 10:17 AM > : To: PHP List > : Subject: [PHP] Make fil downloadable > : > : > : I need to somehow make it so when a user clicks a link, then get > : displayed the download dialogue for the file. The file is a > .php file so > : I'm not sure how this is done but I've seen it been done > before. How can > : you do this? > : > : Thanks, > : Stephen Craton > : http://www.melchior.us > : > : "What's the point in appearance if your true love, doesn't > care about > : it?" -- http://www.melchior.us > : > : > : -- > : 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] Make fil downloadable
Correct!... yes the source not interpreted raw!! Isn't that what you wanted?? Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Stephen [mailto:[EMAIL PROTECTED]] > Sent: Saturday, 11 January 2003 11:01 AM > To: Timothy Hitchens (HiTCHO) > Cc: PHP List > Subject: Re: [PHP] Make fil downloadable > > > Would this print the contents or the actual file for download? > > > - Original Message - > From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]> > To: "'Stephen'" <[EMAIL PROTECTED]> > Cc: "'PHP List'" <[EMAIL PROTECTED]> > Sent: Friday, January 10, 2003 7:47 PM > Subject: RE: [PHP] Make fil downloadable > > > : eg: > : > : Download File Click Here > : > : Now in the file.php you have: > : > : : > : header("Content-type: text/plain"); > : header("Content-Disposition: attachment; filename=xxx.php");; > : // now we read the real file > : readfile('xxx.php'); > : > : exit(); > : > : ?> > : > : This won't put the headers into the downloaded file and remember to > : change the xxx.php into the file > : to be delivered and the xxx.php in the header to the name > you would like > : them to save as. > : > : * the file.php in the top is not the real file but a script > that reads > : into the buffer the real file!! > : > : > : > : Timothy Hitchens (HiTCHO) > : Open Platform Consulting > : e-mail: [EMAIL PROTECTED] > : > : > -Original Message- > : > From: Stephen [mailto:[EMAIL PROTECTED]] > : > Sent: Saturday, 11 January 2003 10:29 AM > : > To: Timothy Hitchens (HiTCHO) > : > Cc: PHP List > : > Subject: Re: [PHP] Make fil downloadable > : > > : > > : > It's a dynamically created file the user downloads and uses > : > later as a PHP script. If I put header() in it, that would > : > make it downloadable again when the user uses it on his/her > : > server, wouldn't it? > : > > : > > : > - Original Message - > : > From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]> > : > To: "'Stephen'" <[EMAIL PROTECTED]>; "'PHP List'" > : > <[EMAIL PROTECTED]> > : > Sent: Friday, January 10, 2003 7:24 PM > : > Subject: RE: [PHP] Make fil downloadable > : > > : > > : > : You need to send headers to tell the browser how to > handle it see: > : > : header(); or.. if it is a php file and you want the visitor to > : > : see/download the source you would be better off giving > it another > : > : extension eg .phps or .txt etc or have a handler file that did a > : > : readfile after sending headers. > : > : > : > : > : > : Timothy Hitchens (HiTCHO) > : > : Open Platform Consulting > : > : e-mail: [EMAIL PROTECTED] > : > : > : > : > : > : -Original Message- > : > : From: Stephen [mailto:[EMAIL PROTECTED]] > : > : Sent: Saturday, 11 January 2003 10:17 AM > : > : To: PHP List > : > : Subject: [PHP] Make fil downloadable > : > : > : > : > : > : I need to somehow make it so when a user clicks a link, then get > : > : displayed the download dialogue for the file. The file is a > : > .php file so > : > : I'm not sure how this is done but I've seen it been done > : > before. How can > : > : you do this? > : > : > : > : Thanks, > : > : Stephen Craton > : > : http://www.melchior.us > : > : > : > : "What's the point in appearance if your true love, doesn't > : > care about > : > : it?" -- http://www.melchior.us > : > : > : > : > : > : -- > : > : 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] Suggestions on FAQ application?
It is a 30 minute write... not that hard!! Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Jeff Lewis [mailto:[EMAIL PROTECTED]] > Sent: Saturday, 11 January 2003 12:37 PM > To: php-gen > Subject: [PHP] Suggestions on FAQ application? > > > I've checked Hotscripts and I can't findanything relatively > new or that suits my needs. I was wondering if anyone uses a > FAQ program that they could suggest? > > Jeff > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php stored in mysql
Please be aware that eval code is extremely hard to debug!! Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Paul Roberts [mailto:[EMAIL PROTECTED]] > Sent: Friday, 10 January 2003 9:33 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] php stored in mysql > > > I should have used > > return($price = $price - ($price *.1)); in the db > > and eval($str); > > Best Wishes & Happy New Year > > Paul Roberts > [EMAIL PROTECTED] > > > - Original Message - > From: "Paul Roberts" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, January 09, 2003 10:29 PM > Subject: [PHP] php stored in mysql > > > Hi > > I want to store some discount codes in mysql, i was thinking > of putting > > $price = $price - ($price *.i); > > in a mysql field that can be looked up via the coupon number > > what's the best way to do this and return $price with the > discount applied. > > Thanks > > Best Wishes & Happy New Year > > Paul Roberts > [EMAIL PROTECTED] > > > > > -- > 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] Sorry, PHP & HTML
I don't see the problem I can run the script with one issue that the comments are outside of PHP parsing. The other issue is that you are closing off for PHP but not opening up in the second block!! ** what are you errors exactly!! are they notices about variables??? Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Denis L. Menezes [mailto:[EMAIL PROTECTED]] > Sent: Sunday, 12 January 2003 11:32 AM > To: PHP general list > Subject: [PHP] Sorry, PHP & HTML > > > Hello friends. > > I have a database from which I take 2 variables as follows : > $CompanyWebsite > $CompanyLogo > > I want to dynamically show two GIFs and when the user clicks > on these, they should go to > http://www.hotmail.com and > http://www.yahoo.com > respectively. I have problem only with > the displaying(the error is parse error on the lines > containing tags), for which I use the folowing code. > Please tell me where I am wrong. > > Print "Organisation address : > ".$row[CompanyAddress]." \n".""; > Print "Organisation website : > ".$row[CompanyWebsite]."\n"." "; // I am > displaying this when testing only. > Print "Organisation logo : > ".$row[CompanyLogo]."\n"." ";?> > // I am displaying this when testing only. > > Print "http://www.hotmail.com";> src="logos/constr12.gif" width="100" height="100" > border="0">"; Print "http://www.yahoo.com";> src="logos/constr12.gif" width="100" height="100" border="0">"; ?> > > Thanks > Denis > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Amount of data in the database
Give this a go.. for each of the databases use: SHOW TABLE STATUS FROM xx; That will return a huge amount of size etc data!! Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Denis L. Menezes [mailto:[EMAIL PROTECTED]] > Sent: Sunday, 12 January 2003 2:58 PM > To: PHP general list > Subject: [PHP] Amount of data in the database > > > Hello friends. > > I have a need for checking how much data(in kb) exists of > each of the user members in the MySQL so that when they > upload more data I can restrict/warn them of the amount of > data they have on the server at present. > > can anyone please tell me how to check the amount of data on > the mysql for each record? > > thanks very much > Denis > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Changing permissions with mkdir?
Hmm that is strange... chmod it after then: http://www.php.net/manual/en/function.chmod.php Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Ben Cheng [mailto:[EMAIL PROTECTED]] > Sent: Sunday, 12 January 2003 2:56 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Changing permissions with mkdir? > > > When I run mkdir("path to new dir", 0777); I get a directory that has > owner and group set to "nobody" and drwxr-xr-x permission. How do I > get the permission to be set to drwxrwxrwx? > > -Ben > > > -- > 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] Amount of data in the database
I haven't seen a way to get the size of an individual record. What about using the max size of the fields in that table against number of records eg: 255 char = x bytes etc etc = 156KB per record max Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Denis L. Menezes [mailto:[EMAIL PROTECTED]] > Sent: Sunday, 12 January 2003 4:10 PM > To: [EMAIL PROTECTED]; 'PHP general list' > Subject: Re: [PHP] Amount of data in the database > > > Thanks Timothy. > > I want to find the amount of data for each member in the > database using PHP and displaying in a web page. I know how > to query records of a member and also know to display. Only I > need to know the command for finding the size(in bytes or kb) > for each of these records :Something like seeing the file > sizes of each email in hotmail. > > > Thanks > Denis > - Original Message - > From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]> > To: "'Denis L. Menezes'" <[EMAIL PROTECTED]>; "'PHP > general list'" <[EMAIL PROTECTED]> > Sent: Sunday, January 12, 2003 1:29 PM > Subject: RE: [PHP] Amount of data in the database > > > > Give this a go.. for each of the databases use: > > > > SHOW TABLE STATUS FROM xx; > > > > That will return a huge amount of size etc data!! > > > > > > > > Timothy Hitchens (HiTCHO) > > Open Platform Consulting > > e-mail: [EMAIL PROTECTED] > > > > > -Original Message- > > > From: Denis L. Menezes [mailto:[EMAIL PROTECTED]] > > > Sent: Sunday, 12 January 2003 2:58 PM > > > To: PHP general list > > > Subject: [PHP] Amount of data in the database > > > > > > > > > Hello friends. > > > > > > I have a need for checking how much data(in kb) exists of each of > > > the user members in the MySQL so that when they upload > more data I > > > can restrict/warn them of the amount of data they have on > the server > > > at present. > > > > > > can anyone please tell me how to check the amount of data on the > > > mysql for each record? > > > > > > thanks very much > > > Denis > > > > > > -- > 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] strip php tags from code ?
So you want to remove only the unparsed/raw php script blocks. Why... are you displaying PHP without parsing?? If this is the case you can write a couple of very simple preg_replace with a call back and all is done. Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: David D [mailto:[EMAIL PROTECTED]] > Sent: Monday, 6 January 2003 10:48 PM > To: [EMAIL PROTECTED] > Subject: [PHP] strip php tags from code ? > > > I only want to keep html code of a page. > I want to remove php tags. > Some tell that strip_tags is not adapted. > > sample of what i want to do: > > na > > > -> > > na > > > php tags can be : > or > or /i > > Merci. > > > > .. > > > > -- > 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] highlight keywords issue
You will need to break apart the entire document then process each area inside of the tags and to be very careful for nested tags. The simplest way around I have found to do with is to add to tags that have been processed with attributes that are ignored by the browser renderer eg... PHP as you can see the -Original Message- > From: Hatem Ben [mailto:[EMAIL PROTECTED]] > Sent: Sunday, 12 January 2003 7:24 PM > To: PHP List > Subject: [PHP] highlight keywords issue > > > Heya all, > > I'm trying to highlight search keywords in a string, > everything work expect when this keyword is inside a tag like this : > > keyword (php) : > > php > > > > will be highlighted to : > > #66">php"> style="color: black; background-color: #66">php > > #66">php.gif" border=0 alt="php.net"> > > I have tryed to separate text from html, then highlight it > then join html/text again, but this will be very long and not > really usefull ! > > I'm using preg_replace : > > preg_replace('|\b('.quotemeta($keyword).')\b|iU', ' style="color: black; > background-color: #66">\\1', $content); > > Any help to fix that ? > > Thanks; > Hatem > > > -- > 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] Permission Denied
Did you use the umask(0) prior to the mkdir() in your script?? Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Stephen [mailto:[EMAIL PROTECTED]] > Sent: Monday, 13 January 2003 9:09 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Permission Denied > > > Ok, I got it to make a directory as a absolute path but I'm > getting a "Permission Denied" error again. I'm running IIS so > I can't CHMOD and all the permission options are checked in > the options box. > > > - Original Message - > From: "Jason Wong" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Sunday, January 12, 2003 4:03 AM > Subject: Re: [PHP] Permission Denied > > > : On Sunday 12 January 2003 10:10, Stephen wrote: > : > There's already a folder named packs but my problem was > not having the / > : > before it. One more question. How can I dynamically get > the path to the > : > current folder? Like your at > http://www.bob.com/joe/index.php and you want > : > to get the > http://www.bob.com/joe/ bit and do it dynamically? > : > : print_r($_SERVER) will show you which bits you can use. > : > : -- > : Jason Wong -> Gremlins Associates -> www.gremlins.biz > : Open Source Software Systems Integrators > : * Web Design & Hosting * Internet & Intranet Applications > Development * > : > : /* > : I'll show you MY telex number if you show me YOURS ... > : */ > : > : > : -- > : 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP/MySQL help?
Hmm from your code below: FROM users WHERE 14 = '$0'" What is "14" it isn't a field I would hope!! Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Steven M [mailto:[EMAIL PROTECTED]] > Sent: Monday, 13 January 2003 9:28 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] PHP/MySQL help? > > > Hi Johannes > > Thanks for the help. I have taken out the mysql_close() and > it looks like it is submitting ok (ie no error messages) but > it is not updating the database when i check it. Any ideas? > > Thanks. > > Steven > "Johannes Schlueter" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi Steven, > > On > Sunday 12 January 2003 23:58, Steven M wrote: > > include 'db.php'; > > > > $result = mysql_query("SELECT newtest FROM users WHERE 14 = '$0'"); > > list($number) = mysql_fetch_row($result); > > Here you are closing your conenction to the MySQL-Server: > > mysql_close(); > > > if($number==0) > > But here you need it again: > > {mysql_query("UPDATE users SET points = '$+2' WHERE 14 = '$0'"); > > mysql_query("UPDATE users SET newtest = '$1' WHERE newtest = '$0'"); > > So remove the mysql_close() if it don't work: Post the error message! > > johannes > > > > -- > 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/MySQL help?
You can't use numbers as vars: $1 etc are illegal syntax for PHP Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Steven M [mailto:[EMAIL PROTECTED]] > Sent: Monday, 13 January 2003 10:04 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] PHP/MySQL help? > > > I thought i read somewhere that you could refer to the field > by number. Was i wrong? It doesn't seem to make a difference > anyway. It still doesn't work. Here's the code with words > instead of numbers. I'd be grateful if you could let me know > if there are any obvious errors. > > Best wishes. > > Steven M > > include 'db.php'; > > $result = mysql_query("SELECT newtest FROM users WHERE > newtest = '$0'"); > list($number) = mysql_fetch_row($result); > > if($number==0) > {mysql_query("UPDATE users SET points = '$+2' WHERE newtest = > '$0'"); mysql_query("UPDATE users SET newtest = '$1' WHERE > newtest = '$0'"); > header("Location: redirect1.php"); > } > elseif($number==1) > { > header("Location: redirect2.php"); > } > else > { > header("Location: error.php"); > } > > > > -- > 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] object in session & security
It is viewable from the script only not the outside world eg the visitor to the website unless you output it. Also you are better offer having your vars set by methods from a constructor then you can do what you just showed below. Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Hannes Smit [mailto:[EMAIL PROTECTED]] > Sent: Monday, 13 January 2003 9:48 AM > To: [EMAIL PROTECTED] > Subject: [PHP] object in session & security > > > Hello, > > Im building a object oriented webapplication with PHP. I know > PHP doesnt fully support OOP. I made a class called Database. > This class contains several variables. One of these vars is > the username and the password for the database. When i create > a Database object I want to register it in the applications > session, so it available through the whole app. Is this > secure? is it possible to view this variable from the > outside? To make it more secure i tried 'crypt()'. But this > doesnt work in this way: > > class Database{ > var $server="db.provider.com"; > var $username="myusername"; > var $password=crypt("8d3j22d"); > var $database="webshop"; > } > > it results in: > > Parse error: parse error, unexpected T_VARIABLE, expecting > T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' > > > > -- > 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] Permission Denied
Who owns the htdocs root (I know it is Windows) when you right click you should should see sharing/security. Do you if not what OS Ver are you using? Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Stephen [mailto:[EMAIL PROTECTED]] > Sent: Monday, 13 January 2003 1:36 PM > To: [EMAIL PROTECTED] > Cc: PHP List > Subject: Re: [PHP] Permission Denied > > > Yes, I just added it but same error: > > Warning: mkdir(c:\inetpub\wwwroot\phpiw\packs\bob) > [function.mkdir]: Permission denied in > c:\inetpub\wwwroot\phpiw\classes\class.cp.php on line 28 > > Here's the part where I try and make the folder: > > function do_dir($package) { > umask(0); > if(mkdir($this->currentfolder().'packs\\bob', 0777)) { > return true; > } else { > echo 'There is already a package by the name of > '.$package.'! Delete it and try again.'; > return false; > } >} > > Any ideas? > - Original Message - > From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]> > To: "'Stephen'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Sunday, January 12, 2003 6:33 PM > Subject: RE: [PHP] Permission Denied > > > : Did you use the umask(0) prior to the mkdir() in your script?? > : > : > : Timothy Hitchens (HiTCHO) > : Open Platform Consulting > : e-mail: [EMAIL PROTECTED] > : > : > -Original Message- > : > From: Stephen [mailto:[EMAIL PROTECTED]] > : > Sent: Monday, 13 January 2003 9:09 AM > : > To: [EMAIL PROTECTED] > : > Subject: Re: [PHP] Permission Denied > : > > : > > : > Ok, I got it to make a directory as a absolute path but I'm > : > getting a "Permission Denied" error again. I'm running IIS so > : > I can't CHMOD and all the permission options are checked in > : > the options box. > : > > : > > : > - Original Message - > : > From: "Jason Wong" <[EMAIL PROTECTED]> > : > To: <[EMAIL PROTECTED]> > : > Sent: Sunday, January 12, 2003 4:03 AM > : > Subject: Re: [PHP] Permission Denied > : > > : > > : > : On Sunday 12 January 2003 10:10, Stephen wrote: > : > : > There's already a folder named packs but my problem was > : > not having the / > : > : > before it. One more question. How can I dynamically get > : > the path to the > : > : > current folder? Like your at > : > http://www.bob.com/joe/index.php and you want > : > : > to get the > : > http://www.bob.com/joe/ bit and do it dynamically? > : > : > : > : print_r($_SERVER) will show you which bits you can use. > : > : > : > : -- > : > : Jason Wong -> Gremlins Associates -> www.gremlins.biz > : > : Open Source Software Systems Integrators > : > : * Web Design & Hosting * Internet & Intranet Applications > : > Development * > : > : > : > : /* > : > : I'll show you MY telex number if you show me YOURS ... > : > : */ > : > : > : > : > : > : -- > : > : 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Png Could not find/open font
I would suggest that in your script it is using a font for a GD operation and you need to make sure that PHP know's how to find that font. Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Breno Cardoso Perucchi [mailto:[EMAIL PROTECTED]] > Sent: Monday, 13 January 2003 4:37 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Png Could not find/open font > > > How I can resolve this ? > This is my configuration of php (phpinfo) > Somebody can help me ? This is very important > GD > GD Support enabled > GD Version bundled (2.0 compatible) > FreeType Support enabled > FreeType Linkage with freetype > GIF Read Support enabled > PNG Support enabled > WBMP Support enabled > > Warning: Could not find/open font in > /usr/home/hosting/b4u/public_html/congressos/fenasoft/Programa > caoListar.php > on line 5 > ?PNG IHDRj+¹¦ËPLTEÎÁ´Ï¿ÊÈÈTÌÁ_%Y)IDATxocP" 0(" ~" > "I×e¨Ä@º&cãQ]£ºFuê¢".*Y"â@uPIEND®B`, > > > Breno > [EMAIL PROTECTED] > > > > > -- > 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] Can I Copy a directory using PHP?
If you are using Unix simply call out the shell using back ticks `mv xxx xxx` or check out. http://www.php.net/manual/en/function.exec.php Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Alex Ciurea [mailto:[EMAIL PROTECTED]] > Sent: Monday, 13 January 2003 7:53 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Can I Copy a directory using PHP? > > > Hello, > > I want to write a script that makes a backup of a database directory. > > Actually, to copy all database files to another directory. > I've figured that I have to use the "copy" function of the > PHP, but the function doesn't works only with files? > > > > Is it possible to copy the entire directory to another > location, using PHP? I presume that is more > "resource-friendly" than to copy the directory file-by-file. > > > Thanks and best regards, > Alexoiul > > > -- > 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] Session wierdness...
Do this for me: print_r($GLOBALS); and see if you have the $_SESSIONS array visible.. you will need to view the output in a text editor as the print_r won't look good rendered in the browser. Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Duncan Abbott [mailto:[EMAIL PROTECTED]] > Sent: Monday, 13 January 2003 1:05 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Session wierdness... > > > I can't seem to be able to set a session var from within a > function in an include file > > I have a call to a function at the top of my doc (but after > session_start()) and if I write the line: > $_SESSION['userData'] = test1; in the function body - it does > nothing... > > but if I put this statement on the line above or below > the call to the function, it works > > I've tried using session_register() instead but the same > thing happens. The block of code is definitely being executed. > > Someone please please help me, I'm going insane. Thanks... > > > > -- > 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] attachment problem
So you have tried as per the manual: header("Content-Disposition: attachment; filename=downloaded.pdf"); I use this all the time without issue.. do you have a shell that you can use to "wget -S" and see if the correct headers are coming out?? Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Lars Olsson [mailto:[EMAIL PROTECTED]] > Sent: Monday, 13 January 2003 11:05 PM > To: [EMAIL PROTECTED] > Subject: [PHP] attachment problem > > > Hi all! > > I'm writing a webmail application in PHP and most basic things are > working now. However, I've recently run into a problem > concerning mail > attachments. This is the situation right now: > > When the user opens a letter there are links to all attachments. The > links looks like this: > http://www.lassoweb.nu/webmail/attachment.php/mailbox=INBOX&ms guid=218&part=2 Mailbox is the mailbox name, msguid is the message number and part corresponds to the part of the letter that is an attachment. When the user clicks the link the attachment data is extracted from the message and displayed in the browser (if possible). This works nice, but here comes the problem. Since the document is named 'attachment.php', that's the name that comes up in the save box whenever the user tries to save the file. Iv'e tried setting the Content-Disposition header to tell the browser what to call the attachment, but to no avail. The browser still insists on calling all attachments 'attachment.php'! I've been trying to figure this out for a couple of days now, but no luck yet. Perhaps someone out there have had the same problem (and solved it)? I'm thankful for any hints /Lars 'lasso' Olsson ([EMAIL PROTECTED]) PS. One solution might be to 'trick' the browser by creating a fake URL (like http://www.lassoweb.nu/webmail/void/bob.gif), but in order for this to work I need to tell Apache to send all requests to the 'void' directory to a single PHP file. Anyone knows how to set this up? DS. -- 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] attachment problem
What happens when you change the "inline" to attachment?? Also does this page have any errors in it... eg parsing ones that are causing PHP to take over the headers and error out?? Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Lars Olsson [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, 14 January 2003 7:15 AM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] attachment problem > > > Yes, I've tried using the Content-Disposition header. It > doesn't seem to > work...here are the relevant parts of my code: > > > // Change Content-Type so that it matches the MIME-type of the part > header('Content-Type: ' . $type . '/' . $subtype); > > // Check if there is a name for the part > if (isset($name)) { > header('Content-Disposition: inline; filename=' . $name); > } > else { > header('Content-Disposition: inline'); > } > > > I've tried printing $type, $subtype and $name and they all contain > correct values...still no luck. > > > As per your suggestion I tried using wget -S to check the > headers. Here > are the results: > > C:\WINDOWS\Profiles\Lasso\Skrivbordet>wget -S --spider > http://localhost/webmail/ > attachment.php?mailbox=INBOX&msguid=279&part=2 > --21:59:30-- > http://localhost/webmail/attachment.php?mailbox=INBOX&msguid=279&p > art=2 > => `attachment.php@mailbox=INBOX&msguid=279&part=2' > Resolving localhost... done. > Connecting to localhost[127.0.0.1]:80... connected. > HTTP request sent, awaiting response... > 1 HTTP/1.1 200 OK > 2 Date: Mon, 13 Jan 2003 20:59:39 GMT > 3 Server: Apache/1.3.27 (Win32) PHP/4.2.3 > 4 X-Powered-By: PHP/4.2.3 > 5 Set-Cookie: PHPSESSID=12ab68cb5cd7355b2a63b9007bda0221; path=/ > 6 Expires: Thu, 19 Nov 1981 08:52:00 GMT > 7 Cache-Control: no-store, no-cache, must-revalidate, post-check=0, > pre-check=0 > > 8 Pragma: no-cache > 9 Keep-Alive: timeout=15, max=100 > 10 Connection: Keep-Alive > 11 Content-Type: text/html > 200 OK > > > I'm VERY confused about line 11! The type (for this > particular request) > should be image/bmp (Mozillas Page Info tab confirms this). > Still, wget > claims it is text/html...hm...strange...now what? > > > /Lars Olsson ([EMAIL PROTECTED]) > > > > Timothy Hitchens ) wrote: > > So you have tried as per the manual: > > > > header("Content-Disposition: attachment; filename=downloaded.pdf"); > > > > I use this all the time without issue.. do you have a shell > that you > > can use to "wget -S" and see if the correct headers are coming out?? > > > > > > > > Timothy Hitchens (HiTCHO) > > Open Platform Consulting > > e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Write Image to Cache
Use the correct headers for no-cache see manual for starters: http://www.php.net/manual/en/function.header.php <http://www.php.net/> Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] -Original Message- From: Stephen [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 14 January 2003 6:50 AM To: PHP List Subject: [PHP] Write Image to Cache I have a chat script that refreshes the chat thing about every 5 seconds. The problem with it is emoticons. Each refresh, it makes the images reload aswell which makes it do sort of a flicker. How could I write the image to cache to make this stop happening or is there another method that works better? Thanks, Stephen Craton http://www.melchior.us "What's the point in appearance if your true love, doesn't care about it?" -- http://www.melchior.us
RE: [PHP] question
You are using singles ' then you are doing "". and it should be "" '. etc Try: printf('Fotografía%s ', $i); Timothy Hitchens (HiTCHO) Open Source Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Ezequiel Sapoznik [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 15 January 2003 11:10 AM > To: [EMAIL PROTECTED] > Subject: [PHP] question > > > Anyone can tell me what is wrong with the following sentence? > > printf('Fotografía > %s ', $i); > > if $row1["url"] is ../images/anything.jpg > > the plain HTML should be: > > Fotografía > > Thanks! > > Ezequiel > > > > > > -- > 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] Next and Previous
This is because you are at the beginning and you need to have some logic to not display the previous if at beginning. Timothy Hitchens (HiTCHO) Open Source Consulting e-mail: [EMAIL PROTECTED] > -Original Message- > From: Miguel Brás [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 15 January 2003 11:06 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Next and Previous > > > Hi, > > it's giving me an error. it assumes the next page as > news.php?ID=1 and the previous as news.php?ID=-1 Any hint for that? > > Miguel > > "Chris Shiflett" <[EMAIL PROTECTED]> escreveu na mensagem > news:[EMAIL PROTECTED].> yahoo.com... > > > --- Miguel Brás <[EMAIL PROTECTED]> wrote: > > > > suppose, the page you're seeing is > > > http://www.x.com/news.php?ID=501 how to add a link > for the page > > > to show the ID=502 and the ID=500 > > > > Next > > > > Previous > > > > Chris > > > > -- > 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