[PHP] problem with PostgreSQL
Can somebody tell me what this mines in my error log I have PostgreSQL compiled in to php so that should not be the problem PHP Warning: Function registration failed - duplicate name - pg_connect in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_pconnect in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_close in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_connection_status in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_connection_busy in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_connection_reset in Unknown on line I am also getting this error [Wed Aug 21 11:06:56 2002] [error] PHP Warning: pg_pconnect() unable to connect to PostgreSQL server: PQconnec tPoll() -- connect() failed: Connection refused Is the postmaster running (with -i) at '127.0.0.1' and accepting connections on TCP/IP port '5901'? in /home/sites/site61/web/util/session_management.phps on line 69 -- Best regards, rdkurth mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Web site down?
it seems to be just your network, me and a couple of friends on differnt networks were just talking about that place :) works fine for us! -Sami Adam Williams [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Is it just me having network connectivity problems, or is the PHP website, http://www.php.net down? I tried connecting to it from a couple of difference computers and I can't access it on any of them. Just wondering if anyone else is having problems getting to their website too. Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with PostgreSQL
Basically, That is your problem here: [Wed Aug 21 11:06:56 2002] [error] PHP Warning: pg_pconnect() unable to connect to PostgreSQL server: PQconnec tPoll() -- connect() failed: Connection refused Is the postmaster running (with -i) at '127.0.0.1' and accepting connections on TCP/IP port '5901'? Postgresql needs the postmaster started with the '-i' option...meaning that it can allow access from TCP/IP connections. Also you need to verify if postgresql is listening on port 5901, because its default port is 5432... I would check both of those and then verify that you can connect from your ip-address (or network) to the postmaster in the pg_hba.conf file. -- .: B i g D o g :. - Original Message - From: [EMAIL PROTECTED] To: php-general [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 12:33 PM Subject: [PHP] problem with PostgreSQL Can somebody tell me what this mines in my error log I have PostgreSQL compiled in to php so that should not be the problem PHP Warning: Function registration failed - duplicate name - pg_connect in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_pconnect in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_close in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_connection_status in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_connection_busy in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_connection_reset in Unknown on line I am also getting this error [Wed Aug 21 11:06:56 2002] [error] PHP Warning: pg_pconnect() unable to connect to PostgreSQL server: PQconnec tPoll() -- connect() failed: Connection refused Is the postmaster running (with -i) at '127.0.0.1' and accepting connections on TCP/IP port '5901'? in /home/sites/site61/web/util/session_management.phps on line 69 -- 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
[PHP] RE: Image library
[snip] Having a large number of files in a single directory does affect performance, the degree of which depends on the filesystem. This is generally accepted wisdom for dealing with large numbers of files - but what number is considered large? Any rules of thumb, for different OpSys/file systems? [/snip] I guess the situation I have had (various OS's) and numbers of items in the file(s) (upwards of 40k items) I have never encountered a degredation in performance that could be deemed noticeable. I could perform some file retrieval analysis to see time lags, and I am sure that there would be some dependent upon the file system (and OS), not to mention hardware factors, the most significant which comes to mind is hard-drive seek times. But as yet, none noticed... You could probably find info on this if you dug around in the linux/freebsd source code... I think more important than how many files can you fit in one directory before things start to suck is the issue of that directory getting big enough (kilobyte wise) that it fills up the partition. If you put them in separate directories to start out with you can always add a new disk (fileserver, etc.) and put half of the directories on the new disk, mounted in the same place. This way your code doesn't need to change at all. -philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with PostgreSQL
Just to throw my $.02 in, if you are running an RPM based linux distribution on your server (such as RedHat), edit your /etc/rc.d/init.d/postgresql file and look for the code in it: # Check for postmaster already running... pid=`pidof -s postmaster` if [ $pid ] then echo $Postmaster already running. else #all systems go -- remove any stale lock files rm -f /tmp/.s.PGSQL.* /dev/null echo -n $PSQL_START If you find that (its under the start section), then immidately after the echo -n $PSQL_START change the next line to: su -l postgres -s /bin/sh -c /usr/bin/pg_ctl -D $PGDATA -p /usr/bin/postmaster -o -i start /dev/null 21 /dev/null Adam On Wed, 21 Aug 2002, Ray Hunter wrote: Basically, That is your problem here: [Wed Aug 21 11:06:56 2002] [error] PHP Warning: pg_pconnect() unable to connect to PostgreSQL server: PQconnec tPoll() -- connect() failed: Connection refused Is the postmaster running (with -i) at '127.0.0.1' and accepting connections on TCP/IP port '5901'? Postgresql needs the postmaster started with the '-i' option...meaning that it can allow access from TCP/IP connections. Also you need to verify if postgresql is listening on port 5901, because its default port is 5432... I would check both of those and then verify that you can connect from your ip-address (or network) to the postmaster in the pg_hba.conf file. -- .: B i g D o g :. - Original Message - From: [EMAIL PROTECTED] To: php-general [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 12:33 PM Subject: [PHP] problem with PostgreSQL Can somebody tell me what this mines in my error log I have PostgreSQL compiled in to php so that should not be the problem PHP Warning: Function registration failed - duplicate name - pg_connect in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_pconnect in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_close in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_connection_status in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_connection_busy in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_connection_reset in Unknown on line I am also getting this error [Wed Aug 21 11:06:56 2002] [error] PHP Warning: pg_pconnect() unable to connect to PostgreSQL server: PQconnec tPoll() -- connect() failed: Connection refused Is the postmaster running (with -i) at '127.0.0.1' and accepting connections on TCP/IP port '5901'? in /home/sites/site61/web/util/session_management.phps on line 69 -- 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] problem with PostgreSQL
Good call on that Adam... One thing to note is that when you call the postmaster here you are calling it with the pg_ctl command...so it is beneficial to pass the postmaster options to the pg_ctl command...like so... su -l postgres -s /bin/sh -c /usr/bin/pg_ctl -o '-i' -D $PGDATA -p /usr/bin/postmaster start /var/log/pgsql 21 /dev/null And for debugging purposes I like to add a file to log all errors and notices...which has saved me tons of time...I am logging to /var/log/pgsql file... Also you can edit the pg_hba.conf file that is located in /var/lib/pgsql/data/pg_hba.conf for network and ip access...if redhat rpm installed... .: B i g D o g :. - Original Message - From: Adam Williams [EMAIL PROTECTED] To: Ray Hunter [EMAIL PROTECTED] Cc: PHP GEN [EMAIL PROTECTED]; Richard Kurth [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 12:55 PM Subject: Re: [PHP] problem with PostgreSQL Just to throw my $.02 in, if you are running an RPM based linux distribution on your server (such as RedHat), edit your /etc/rc.d/init.d/postgresql file and look for the code in it: # Check for postmaster already running... pid=`pidof -s postmaster` if [ $pid ] then echo $Postmaster already running. else #all systems go -- remove any stale lock files rm -f /tmp/.s.PGSQL.* /dev/null echo -n $PSQL_START If you find that (its under the start section), then immidately after the echo -n $PSQL_START change the next line to: su -l postgres -s /bin/sh -c /usr/bin/pg_ctl -D $PGDATA -p /usr/bin/postmaster -o -i start /dev/null 21 /dev/null Adam On Wed, 21 Aug 2002, Ray Hunter wrote: Basically, That is your problem here: [Wed Aug 21 11:06:56 2002] [error] PHP Warning: pg_pconnect() unable to connect to PostgreSQL server: PQconnec tPoll() -- connect() failed: Connection refused Is the postmaster running (with -i) at '127.0.0.1' and accepting connections on TCP/IP port '5901'? Postgresql needs the postmaster started with the '-i' option...meaning that it can allow access from TCP/IP connections. Also you need to verify if postgresql is listening on port 5901, because its default port is 5432... I would check both of those and then verify that you can connect from your ip-address (or network) to the postmaster in the pg_hba.conf file. -- .: B i g D o g :. - Original Message - From: [EMAIL PROTECTED] To: php-general [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 12:33 PM Subject: [PHP] problem with PostgreSQL Can somebody tell me what this mines in my error log I have PostgreSQL compiled in to php so that should not be the problem PHP Warning: Function registration failed - duplicate name - pg_connect in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_pconnect in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_close in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_connection_status in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_connection_busy in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_connection_reset in Unknown on line I am also getting this error [Wed Aug 21 11:06:56 2002] [error] PHP Warning: pg_pconnect() unable to connect to PostgreSQL server: PQconnec tPoll() -- connect() failed: Connection refused Is the postmaster running (with -i) at '127.0.0.1' and accepting connections on TCP/IP port '5901'? in /home/sites/site61/web/util/session_management.phps on line 69 -- 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] problem with PostgreSQL
Sorry Adam, I just realized that you are totally correct...damn brain farts or something... excuses my stupidity -- RAY HUNTER - Original Message - From: Adam Williams [EMAIL PROTECTED] To: Ray Hunter [EMAIL PROTECTED] Cc: PHP GEN [EMAIL PROTECTED]; Richard Kurth [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 12:55 PM Subject: Re: [PHP] problem with PostgreSQL Just to throw my $.02 in, if you are running an RPM based linux distribution on your server (such as RedHat), edit your /etc/rc.d/init.d/postgresql file and look for the code in it: # Check for postmaster already running... pid=`pidof -s postmaster` if [ $pid ] then echo $Postmaster already running. else #all systems go -- remove any stale lock files rm -f /tmp/.s.PGSQL.* /dev/null echo -n $PSQL_START If you find that (its under the start section), then immidately after the echo -n $PSQL_START change the next line to: su -l postgres -s /bin/sh -c /usr/bin/pg_ctl -D $PGDATA -p /usr/bin/postmaster -o -i start /dev/null 21 /dev/null Adam On Wed, 21 Aug 2002, Ray Hunter wrote: Basically, That is your problem here: [Wed Aug 21 11:06:56 2002] [error] PHP Warning: pg_pconnect() unable to connect to PostgreSQL server: PQconnec tPoll() -- connect() failed: Connection refused Is the postmaster running (with -i) at '127.0.0.1' and accepting connections on TCP/IP port '5901'? Postgresql needs the postmaster started with the '-i' option...meaning that it can allow access from TCP/IP connections. Also you need to verify if postgresql is listening on port 5901, because its default port is 5432... I would check both of those and then verify that you can connect from your ip-address (or network) to the postmaster in the pg_hba.conf file. -- .: B i g D o g :. - Original Message - From: [EMAIL PROTECTED] To: php-general [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 12:33 PM Subject: [PHP] problem with PostgreSQL Can somebody tell me what this mines in my error log I have PostgreSQL compiled in to php so that should not be the problem PHP Warning: Function registration failed - duplicate name - pg_connect in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_pconnect in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_close in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_connection_status in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_connection_busy in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - pg_connection_reset in Unknown on line I am also getting this error [Wed Aug 21 11:06:56 2002] [error] PHP Warning: pg_pconnect() unable to connect to PostgreSQL server: PQconnec tPoll() -- connect() failed: Connection refused Is the postmaster running (with -i) at '127.0.0.1' and accepting connections on TCP/IP port '5901'? in /home/sites/site61/web/util/session_management.phps on line 69 -- 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] Passing variables between servers
I have read this arcticle too, and yes it will work for PHP to ASP but I have never came across a ASP version like this function to send the information from ASP to PHP. _ Mark McCulligh, Application Developer / Analyst Sykes Canada Corporation www.SykesCanada.com [EMAIL PROTECTED] - Original Message - From: Jay Blanchard [EMAIL PROTECTED] To: 'Mark McCulligh' [EMAIL PROTECTED]; 'Adam Williams' [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 1:40 PM Subject: RE: [PHP] Passing variables between servers [snip] I thought about encrypting the whole querystring then decrypting it on the other server, but I wanted to keep the address bar clean. I wanted the user not to know they just got passed. If all a sudden there was a lot of data in the address bar they will wonder what it is for. [/snip] How about POSTING the whole querystring... http://www.faqts.com/knowledge_base/view.phtml/aid/12039/fid/51 posting without using a form, can probably be re-engineered to for ASP to send information back HTH! Jay *** * Texas PHP Developers Conf Spring 2003 * * T Bar M Resort Conference Center * * New Braunfels, Texas* * San Antonio Area PHP Developers Group * * Interested? Contact [EMAIL PROTECTED] * *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Passing variables between servers
The session variables are need on both server for authorization needs. The two servers host two separate Intranet apps and I am trying to join the two together into one Intranet app. The variable will be used on both sides. The reason I don't what to use cookie is your users keep disabling them. They think a web site can use a cookie to break into their computer. They also disable JavaScript a lot too. _ Mark McCulligh, Application Developer / Analyst Sykes Canada Corporation www.SykesCanada.com [EMAIL PROTECTED] - Original Message - From: Seairth Jacobs [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 2:18 PM Subject: Re: Passing variables between servers Is there any reason to pass the data to the ASP server other than the need for the ASP server to pass it back in case the PHP server session has expired? If not, why not just store the login information in a local table referencable by a primary key that you pass around instead? You could even do this with GET. --- Seairth Jacobs [EMAIL PROTECTED] Mark McCulligh [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have two server. One running PHP/Linux the other running ASP/2000. The user logins into the PHP server and session variables are made to hold their username, password, department, etc.. The site from time to time redirect the user to the ASP server. I want to pass the session variable across to the other server. I can't use the GET method. (www.domain.com/form.asp?username=Mark.) because putting the password on the address bar is not an option. The ASP server will redirect them back when they are done on it. It will pass back the variables just in case the session on the PHP server has expired for the PHP server can create a new session if needed. I don't want to use a cookie. I was thinking of using cURL but I can't fine any information about using it in ASP. I know how to use cURL in PHP to redirect the user to the ASP server and pass the variables in the POST method, but not the other way. Any ideas would be a GREAT help. Mark. _ Mark McCulligh, Application Developer / Analyst Sykes Canada Corporation www.SykesCanada.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] testing
just a test. -Sami -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] copy a string
Hello! Is there any function to copy a string into the computers memory (just like you do when you press ctrl + c in, for example Internet Explorer). Is there any way to do this, just using PHP or JavaScript? Maybe by using the function system()? Note that i dont want to copy a file, just a string. Anyone got a solution to this problem? Im very grateful for any help i can get! With Regards, Oskar Hermansson, Sweden
RE: [PHP] Re: Passing variables between servers
[snip] The session variables are need on both server for authorization needs. The two servers host two separate Intranet apps and I am trying to join the two together into one Intranet app. The variable will be used on both sides. The reason I don't what to use cookie is your users keep disabling them. They think a web site can use a cookie to break into their computer. They also disable JavaScript a lot too. [/snip] What about installing PHP on the IIS server and when time comes to pass back the information using the same method? Trying to think outside the box ... Jay *** * Texas PHP Developers Conf Spring 2003 * * T Bar M Resort Conference Center * * New Braunfels, Texas* * San Antonio Area PHP Developers Group * * Interested? Contact [EMAIL PROTECTED] * *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is there a better way of doing this?
Hello all, You have been lots of help in the past, so I was wondering if you could help me out with this, basically I just have to parse a string similar to 4,31m) figure out if it is numeric or not, then if it is remove the last to characters on the string (the 'm)') and change the string so that it is 4.31. There is probably a better way of doing this but I can't figure out how to make it better or more efficient $tim = 3,43m); // take into account that the last 2 characters may not be\ 'm)' like we are expecting, and store them in a var $last2ontime = substr($tim,strlen($tim),strlen($tim)-3); $tim = str_replace(,,,$tim); // get rid of the , in the time (i.e. time = 3,43 and we want it to be 343) $tim = substr($tim,0,strlen($tim)-2); if(is_numeric($tim)){ if($debug){ print nl2br( Time is Numeric!\n ); } $t = substr($tim,0,strlen($tim)-2); $te = substr($tim,strlen($tim)-2); if($debug){ print nl2br( T = $t\nte = $te\n ); } if(is_null($t) or $t == ){ $tim = $te[0] ..0. $te[1]; }else{ $tim = (string)$t ... (string)$te .m); } }else{ if($debug){ print got else!; } Thank You, Mike [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[3]: [PHP] still problems with register globals set to on
Yeeahhh! Thanks Tom. Works great. It was just a small error causing this much trouble. For turning register globals on it is: php_flag register_globals on Cheers, Andy Tom Rogers [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, Wednesday, August 21, 2002, 10:53:48 PM, you wrote: TR Hi, TR Wednesday, August 21, 2002, 9:32:43 PM, you wrote: A thanx tom, but this doen not seem to have anything to do with it. A Regards, A Andy A Tom Rogers [EMAIL PROTECTED] schrieb im Newsbeitrag A [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, Wednesday, August 21, 2002, 5:34:35 PM, you wrote: A Hello everybody, A I am still having problems to run php scripts inside a directory with A register globals on. A This is what I did put inside the httpd.conf file right after the A Directory / close tag. A Directory /home/www/oasis A php_value register_globals on A /Directory A It does not change anything. I restarted apache of course. A Do u have an idea where the error could live? A Andy A Rasmus Lerdorf [EMAIL PROTECTED] schrieb im Newsbeitrag A [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Sure, turn register_globals on only for the oasis directory. In your httpd.conf add: Directory /some/path/oasis php_value register_globals on /Directory -Rasmus On Mon, 19 Aug 2002, Andy wrote: You may need to add in the directory section (never used it so it is a guess) AllowOverride Options -- regards, Tom TR I eventually got it to work with the following: TR Directory /usr/local/apache/domains/whatever/www/admin TR AllowOverride All TR Order allow,deny TR Allow from all TR php_flag register_globals on TR /Directory In the httpd.conf you can get away with just: Directory /usr/local/apache/domains/whatever/www/admin php_flag register_globals on /Directory -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] test
Travis Trout Production Support Mobile Register Phone: (251) 219-5263 Email: [EMAIL PROTECTED] Address: 401 N Water St. Mobile, AL 36602
RE: [PHP] copy a string
You want to copy a string to do what with it? This answer to this would help all of us help you. ~ Matthew -Original Message- From: Oskar Hermansson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 11:32 AM To: [EMAIL PROTECTED] Subject: [PHP] copy a string Hello! Is there any function to copy a string into the computers memory (just like you do when you press ctrl + c in, for example Internet Explorer). Is there any way to do this, just using PHP or JavaScript? Maybe by using the function system()? Note that i dont want to copy a file, just a string. Anyone got a solution to this problem? Im very grateful for any help i can get! With Regards, Oskar Hermansson, Sweden -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Passing variables between servers
I have thought about this also, but I need the variables in the ASP session and I don't have the time line to rewrite the ASP pages over in PHP. The current ASP app took a year to develop. I have thought about having PHP on both servers and having the PHP on the 2000 server just save the variables to a XML file or ini file, then have the ASP code read it in, but I thought there is probable some easy solution out there for passing information around. cURL looked like a solution but I can't find information on it using ASP. Maybe I am looking of a easy solutions that doesn't exist and will have to just use the longer one. Thanks for your input, Mark. _ Mark McCulligh, Application Developer / Analyst Sykes Canada Corporation www.SykesCanada.com (888)225-6824 ex. 3262 [EMAIL PROTECTED] - Original Message - From: Jay Blanchard [EMAIL PROTECTED] To: 'Mark McCulligh' [EMAIL PROTECTED]; 'Seairth Jacobs' [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 3:34 PM Subject: RE: [PHP] Re: Passing variables between servers [snip] The session variables are need on both server for authorization needs. The two servers host two separate Intranet apps and I am trying to join the two together into one Intranet app. The variable will be used on both sides. The reason I don't what to use cookie is your users keep disabling them. They think a web site can use a cookie to break into their computer. They also disable JavaScript a lot too. [/snip] What about installing PHP on the IIS server and when time comes to pass back the information using the same method? Trying to think outside the box ... Jay *** * Texas PHP Developers Conf Spring 2003 * * T Bar M Resort Conference Center * * New Braunfels, Texas* * San Antonio Area PHP Developers Group * * Interested? Contact [EMAIL PROTECTED] * *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: copy a string
Hi, there is a JavaScript-command to 'simulate' ctrl-v. It's exec.Command(paste); so I'm quite sure that there is also a command like exec.Command(copy); but this works for MSIE only in newer versions (5.5 and higher) this is not possible because this security-bug was fixed Greetings Carsten Mohr Oskar Hermansson wrote: Hello! Is there any function to copy a string into the computers memory (just like you do when you press ctrl + c in, for example Internet Explorer). Is there any way to do this, just using PHP or JavaScript? Maybe by using the function system()? Note that i dont want to copy a file, just a string. Anyone got a solution to this problem? Im very grateful for any help i can get! With Regards, Oskar Hermansson, Sweden -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Passing variables between servers
http://www.w3.org/TR/SOAP/ ~ Matthew -Original Message- From: Mark McCulligh [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 4:14 PM To: Jay Blanchard Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Re: Passing variables between servers I have thought about this also, but I need the variables in the ASP session and I don't have the time line to rewrite the ASP pages over in PHP. The current ASP app took a year to develop. I have thought about having PHP on both servers and having the PHP on the 2000 server just save the variables to a XML file or ini file, then have the ASP code read it in, but I thought there is probable some easy solution out there for passing information around. cURL looked like a solution but I can't find information on it using ASP. Maybe I am looking of a easy solutions that doesn't exist and will have to just use the longer one. Thanks for your input, Mark. _ Mark McCulligh, Application Developer / Analyst Sykes Canada Corporation www.SykesCanada.com (888)225-6824 ex. 3262 [EMAIL PROTECTED] - Original Message - From: Jay Blanchard [EMAIL PROTECTED] To: 'Mark McCulligh' [EMAIL PROTECTED]; 'Seairth Jacobs' [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 3:34 PM Subject: RE: [PHP] Re: Passing variables between servers [snip] The session variables are need on both server for authorization needs. The two servers host two separate Intranet apps and I am trying to join the two together into one Intranet app. The variable will be used on both sides. The reason I don't what to use cookie is your users keep disabling them. They think a web site can use a cookie to break into their computer. They also disable JavaScript a lot too. [/snip] What about installing PHP on the IIS server and when time comes to pass back the information using the same method? Trying to think outside the box ... Jay *** * Texas PHP Developers Conf Spring 2003 * * T Bar M Resort Conference Center * * New Braunfels, Texas* * San Antonio Area PHP Developers Group * * Interested? Contact [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] Calendar logic question
You know it's been done before by many the many calendar systems out there. You really just want to store the event once and you wouldn't want to even replicate the event ID out to whatever date. I would search the php class libraries and free software to see how they did it. I'm someone has done a calendar management system. Off the top of my head, you could store the event date time information like unix cron does. That should allow for quick searching on what events need to be displayed. On Wednesday, August 21, 2002, at 01:54 PM, Matt Schroebel wrote: I have a calendar application that shows events in a month. I want to add the ability to have re-occuring events. I've been thinking about how to do that, but it's not seeming to be too easy. Say, I have a table of re-occuring events: eventId int eventName varchar eventStartDate date eventEndDate date eventOccuranceType enum(weekly, monthly, daily) eventInterval int eventDOW int Should I populate the actual events table with re-occuring events at insert/update/delete times, or should I code the event listing page to determine if there are events that would occur in the month shown? The first way would be costly at insert time, and may add lots of events that will never occur -- plus one can't go on forever, so at some point, it seems, it would have to do the second way anyway. The second way, is costly at page view time. With a small number of re-occurring events, that probably wouldn't be an issue, but as the calendar usage grows, I can see that becoming resource costly. Is there a better way? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] executing php at shell level...
Hi folks, Having a strange problem... I've got a php script named 'phptest' with the following code: #!/usr/bin/php -q ? var_dump($argv); ? I've set the permission on the file to 755, and am executing the file by typing: ./phptest var1 var2 var3 The only output I get is NULL. No matter what I do, I can't seem to pass any variables to the script. Not just this script, either, I can't pass vars to any php script executing at the shell level. I'm running 4.03 (please, no digs about the security hole(s), long, long story...) is there anything in the php.ini file I need to change? TIA, Kelly
Re: [PHP] Is there a better way of doing this?
Hello Mike, parse a string similar to 4,31m) figure out if it is numeric or not, then if it is remove the last to characters on the string (the 'm)') and change the string so that it is 4.31. There is probably a better way of doing this but I can't figure out how to make it better or more efficient $tim = 3,43m); // take into account that the last 2 characters may not be\ 'm)' like we are expecting, and store them in a var $last2ontime = substr($tim,strlen($tim),strlen($tim)-3); $tim = str_replace(,,,$tim); // get rid of the , in the time (i.e. time = 3,43 and we want it to be 343) $tim = substr($tim,0,strlen($tim)-2); if(is_numeric($tim)){ if($debug){ print nl2br( Time is Numeric!\n ); } $t = substr($tim,0,strlen($tim)-2); $te = substr($tim,strlen($tim)-2); if($debug){ print nl2br( T = $t\nte = $te\n ); } if(is_null($t) or $t == ){ $tim = $te[0] ..0. $te[1]; }else{ $tim = (string)$t ... (string)$te .m); } }else{ if($debug){ print got else!; } Add the following code to the above (NB think you're a } short): $RegExIn = 3,43m); echo brbrWith RegEx: $RegExIn; $RegExPattern = /(\d{1,3})(,)(\d{1,3})([a-z]{1,2})(.*)/i; echo brRegEx ~$RegExPattern~; $bValidity = $iFound = preg_match( $RegExPattern, $RegExIn, $aRegExOut ); if ( FALSE === $bValidity ) { $aLocated = NULLSTRING; echo 'brError interpreting RegEx'; } if ( 0 == $iFound ) { $aLocated = NULLSTRING; } if ( 0 $iFound ) { echo brFirst number = . $aRegExOut[1]; echo brSeparator = . $aRegExOut[2]; echo brSecond number = . $aRegExOut[3]; echo brText unit = . $aRegExOut[4]; echo brAdditional non-text = . $aRegExOut[5]; $value = $aRegExOut[1] . . . $aRegExOut[3]; echo brValue = $value; } Totally unsure about $last2ontime. The RegEx has been structured fairly loosely because I'm not sure of all the specifications for how many digits can be in the various places, etc; so feel free to altered the repetition values (inside the curly brackets) to suit. Of course, if the comma is missing or there is no integer value, (etc), then the whole thing will fall apart and give you nothing (hence the $aLocated = NULLSTRING; line which should probably be reworded/tied back to $value (yes I was reusing old code))! Hope it helps, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] No variables imported on form POST
When I do an HTTP POST to a PHP application on my web server, it is not importing the from values as variables. For example, ?php if ($submit == click){ echo Hello, $UserName; }else{ echo ' htmlbody form method=POST action=test1.php Enter Your Name input type=text name=Name/inputbr input type=submit name=submit value=click/input /form /body/html '; } ? A simple example form, there is no value $submit after a POST. I eve tried making an app that just echos $HOME and got nothing, so it seems I'm not importing any environment variables. Can anybody point out a place to start looking for the problem? Jason White
Re: [PHP] No variables imported on form POST
Did you just recently upgrade to PHP v 4.2.x? It has changed the way it handles variables. Check: http://www.php.net/manual/en/language.variables.predefined.php on 8/21/02 5:05 PM, Jason Annin-White at [EMAIL PROTECTED] wrote: A simple example form, there is no value $submit after a POST. I eve tried making an app that just echos $HOME and got nothing, so it seems I'm not importing any environment variables. Can anybody point out a place to start looking for the problem? -- Bill Leonard [EMAIL PROTECTED] www.machinemen.com407.464.0147 XrackHosting.com - Mac OS X hosting on Apple's Xserve! http://www.xrackhosting.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mime types?
Is there a resource somewhere that would show what the various MIME types are? For a file upload page, I want to include .TIF, .AI, .PSD, etc., in addition to the standard GIF and JPG types... Thanx, Wm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is there a better way of doing this?
-Original Message- From: DL Neil [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 4:56 PM To: Mike; [EMAIL PROTECTED] Subject: Re: [PHP] Is there a better way of doing this? Hello Mike, parse a string similar to 4,31m) figure out if it is numeric or not, then if it is remove the last to characters on the string (the 'm)') and change the string so that it is 4.31. There is probably a better way of doing this but I can't figure out how to make it better or more efficient $tim = 3,43m); // take into account that the last 2 characters may not be\ 'm)' like we are expecting, and store them in a var $last2ontime = substr($tim,strlen($tim),strlen($tim)-3); $tim = str_replace(,,,$tim); // get rid of the , in the time (i.e. time = 3,43 and we want it to be 343) $tim = substr($tim,0,strlen($tim)-2); if(is_numeric($tim)){ if($debug){ print nl2br( Time is Numeric!\n ); } $t = substr($tim,0,strlen($tim)-2); $te = substr($tim,strlen($tim)-2); if($debug){ print nl2br( T = $t\nte = $te\n ); } if(is_null($t) or $t == ){ $tim = $te[0] ..0. $te[1]; }else{ $tim = (string)$t ... (string)$te .m); } }else{ if($debug){ print got else!; } Add the following code to the above (NB think you're a } short): $RegExIn = 3,43m); echo brbrWith RegEx: $RegExIn; $RegExPattern = /(\d{1,3})(,)(\d{1,3})([a-z]{1,2})(.*)/i; echo brRegEx ~$RegExPattern~; $bValidity = $iFound = preg_match( $RegExPattern, $RegExIn, $aRegExOut ); if ( FALSE === $bValidity ) { $aLocated = NULLSTRING; echo 'brError interpreting RegEx'; } if ( 0 == $iFound ) { $aLocated = NULLSTRING; } if ( 0 $iFound ) { echo brFirst number = . $aRegExOut[1]; echo brSeparator = . $aRegExOut[2]; echo brSecond number = . $aRegExOut[3]; echo brText unit = . $aRegExOut[4]; echo brAdditional non-text = . $aRegExOut[5]; $value = $aRegExOut[1] . . . $aRegExOut[3]; echo brValue = $value; } Totally unsure about $last2ontime. The RegEx has been structured fairly loosely because I'm not sure of all the specifications for how many digits can be in the various places, etc; so feel free to altered the repetition values (inside the curly brackets) to suit. Of course, if the comma is missing or there is no integer value, (etc), then the whole thing will fall apart and give you nothing (hence the $aLocated = NULLSTRING; line which should probably be reworded/tied back to $value (yes I was reusing old code))! Hope it helps, =dn Sweet! It worked perfectly as I needed it to and I get to remove a lot of extra code from my script. Thank you bunches, Mike -- 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] SeparatingWords
Hi, I have strings like FileName, SoftwareVersion etc. How can I add space between words? Somehow with preg_replace perhaps? First letter of each word is capitalized. -Hessu- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: SeparatingWords
This works. $word = SoftwareVersionThingy; $word = ereg_replace(([A-Z]), \\1, $word); $word = ltrim($word); -philip On Thu, 22 Aug 2002, Hessu wrote: Hi, I have strings like FileName, SoftwareVersion etc. How can I add space between words? Somehow with preg_replace perhaps? First letter of each word is capitalized. -Hessu- -- 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] No variables imported on form POST
You are correct Bill, problem solved, thank you. Jason White - Original Message - From: Bill Leonard [EMAIL PROTECTED] To: Jason Annin-White [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 2:13 PM Subject: Re: [PHP] No variables imported on form POST Did you just recently upgrade to PHP v 4.2.x? It has changed the way it handles variables. Check: http://www.php.net/manual/en/language.variables.predefined.php on 8/21/02 5:05 PM, Jason Annin-White at [EMAIL PROTECTED] wrote: A simple example form, there is no value $submit after a POST. I eve tried making an app that just echos $HOME and got nothing, so it seems I'm not importing any environment variables. Can anybody point out a place to start looking for the problem? -- Bill Leonard [EMAIL PROTECTED] www.machinemen.com407.464.0147 XrackHosting.com - Mac OS X hosting on Apple's Xserve! http://www.xrackhosting.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Mime types?
If I remember correctly, there are various articles about file upload in sites such as www.phpbuilder.com, www.codewalkers.com and such. Hope that helps you get started :) -Joni- -- // Joni Järvinen // [EMAIL PROTECTED] // http://www.reactorbox.org/~wandu Wm [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Is there a resource somewhere that would show what the various MIME types are? For a file upload page, I want to include .TIF, .AI, .PSD, etc., in addition to the standard GIF and JPG types... Thanx, Wm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: SeparatingWords
Philip, What about SoftwareVersion Thingy? Won't that end up as Software Version Thingy - with two spaces before the T? Can the RegEx be 'turned off' if the u/case letter is already preceded by a space? (sorry, may not be Hessu's requirement = my curiosity) Regards, =dn This works. $word = SoftwareVersionThingy; $word = ereg_replace(([A-Z]), \\1, $word); $word = ltrim($word); -philip On Thu, 22 Aug 2002, Hessu wrote: Hi, I have strings like FileName, SoftwareVersion etc. How can I add space between words? Somehow with preg_replace perhaps? First letter of each word is capitalized. -Hessu- -- 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: SeparatingWords
Yes, it would and yes you can, but I'll leave that up to you :) On Wed, 21 Aug 2002, DL Neil wrote: Philip, What about SoftwareVersion Thingy? Won't that end up as Software Version Thingy - with two spaces before the T? Can the RegEx be 'turned off' if the u/case letter is already preceded by a space? (sorry, may not be Hessu's requirement = my curiosity) Regards, =dn This works. $word = SoftwareVersionThingy; $word = ereg_replace(([A-Z]), \\1, $word); $word = ltrim($word); -philip On Thu, 22 Aug 2002, Hessu wrote: Hi, I have strings like FileName, SoftwareVersion etc. How can I add space between words? Somehow with preg_replace perhaps? First letter of each word is capitalized. -Hessu- -- 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] Background process (sending mails)
I know this issue have been discussed a lot of times but I checked a lot of archives and documents and I couldn't find any solution. What I want to do is send a lot of mails (belive me, it's not spamming) and I thought about running the process of sending mails in background (detached from the PHP script that runs it), so the page will return immediatly and the other process will continue sending the mails in the background. I didn't find any way to run a process in the background from PHP succesfully. The manual says that using system(), if the stdout is redirected to a file, it's run in background, I tryed redirecting stdout, stderr and stdin to/from files and it still waits for the termination of the process, I tryed adding at the end of the process line and it didn't work neither. Any idea of how I can do this (without using at, but maybe cron, I don't know how) ? Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Background process (sending mails)
Simply configure your MTA to queue requests coming from PHP. Your php.ini file has the sendmail invocation line that is used by PHP's mail() function. Most MTA's out there have a sendmail-like interface and most have a way to tell it to simply queue the request and return immediately. For sendmail you tell it to queue by adding a option to the command line specified in php.ini using the -o flag. Check your sendmail docs for the actual option, but on my system my docs say: DeliveryMode=x Set the delivery mode to x. Delivery modes are `i' for interactive (synchronous) delivery, `b' for background (asynchronous) delivery, `q' for queue only - i.e., actual delivery is done the next time the queue is run, and `d' for deferred - the same as `q' except that database lookups for maps which have set the -D option (default for the host map) are avoided. Don't forget that if you just queue the mssages, you need to flush the queue every now and then. Traditionally that is done by a cron job that runs periodically and calls sendmail to flush the queue. -Rasmus On Wed, 21 Aug 2002, Pupeno wrote: I know this issue have been discussed a lot of times but I checked a lot of archives and documents and I couldn't find any solution. What I want to do is send a lot of mails (belive me, it's not spamming) and I thought about running the process of sending mails in background (detached from the PHP script that runs it), so the page will return immediatly and the other process will continue sending the mails in the background. I didn't find any way to run a process in the background from PHP succesfully. The manual says that using system(), if the stdout is redirected to a file, it's run in background, I tryed redirecting stdout, stderr and stdin to/from files and it still waits for the termination of the process, I tryed adding at the end of the process line and it didn't work neither. Any idea of how I can do this (without using at, but maybe cron, I don't know how) ? Thank you. -- 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] Background process (sending mails)
Rasmus Lerdorf wrote: Simply configure your MTA to queue requests coming from PHP. Your php.ini file has the sendmail invocation line that is used by PHP's mail() function. Most MTA's out there have a sendmail-like interface and most have a way to tell it to simply queue the request and return immediately. For sendmail you tell it to queue by adding a option to the command line specified in php.ini using the -o flag. Check your sendmail docs for the actual option, but on my system my docs say: DeliveryMode=x Set the delivery mode to x. Delivery modes are `i' for interactive (synchronous) delivery, `b' for background (asynchronous) delivery, `q' for queue only - i.e., actual delivery is done the next time the queue is run, and `d' for deferred - the same as `q' except that database lookups for maps which have set the -D option (default for the host map) are avoided. Don't forget that if you just queue the mssages, you need to flush the queue every now and then. Traditionally that is done by a cron job that runs periodically and calls sendmail to flush the queue. But I'm running on a shared hosting server, I'm not able to modify Sendmail's configuration :( Thank you anyway for your help, any other idea ? -- Pupeno: [EMAIL PROTECTED] http://www.pupeno.com --- Help the hungry children of Argentina, please go to (and make it your homepage): http://www.porloschicos.com/servlet/PorLosChicos?comando=donar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Background process (sending mails)
You don't need to modify sendmail's config, you simply need to modify how you are calling sendmail from PHP. Chances are the server you are on already flushes the queue occasionally. You'd need to try to figure out how often, perhaps simply by trial and error. Since you have no control over the php.ini file, and you can't set this particular ini directive using ini_set(), you will have to call sendmail manually using system(). You don't need to put it into the background since you will just be telling sendmail to queue by passing the correct flags to it, so it should be straightforward. -Rasmus On Wed, 21 Aug 2002, Pupeno wrote: Rasmus Lerdorf wrote: Simply configure your MTA to queue requests coming from PHP. Your php.ini file has the sendmail invocation line that is used by PHP's mail() function. Most MTA's out there have a sendmail-like interface and most have a way to tell it to simply queue the request and return immediately. For sendmail you tell it to queue by adding a option to the command line specified in php.ini using the -o flag. Check your sendmail docs for the actual option, but on my system my docs say: DeliveryMode=x Set the delivery mode to x. Delivery modes are `i' for interactive (synchronous) delivery, `b' for background (asynchronous) delivery, `q' for queue only - i.e., actual delivery is done the next time the queue is run, and `d' for deferred - the same as `q' except that database lookups for maps which have set the -D option (default for the host map) are avoided. Don't forget that if you just queue the mssages, you need to flush the queue every now and then. Traditionally that is done by a cron job that runs periodically and calls sendmail to flush the queue. But I'm running on a shared hosting server, I'm not able to modify Sendmail's configuration :( Thank you anyway for your help, any other idea ? -- Pupeno: [EMAIL PROTECTED] http://www.pupeno.com --- Help the hungry children of Argentina, please go to (and make it your homepage): http://www.porloschicos.com/servlet/PorLosChicos?comando=donar -- 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] Adding shadow effects to Images
I'm trying to auto-add shadow effects to my image thumbs using PHP or the GD Library if that's even possible. Any ideas where I start? Thanks, Steph
Re: [PHP] Mime types?
From: Wm [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 5:17 PM Subject: [PHP] Mime types? Is there a resource somewhere that would show what the various MIME types are? For a file upload page, I want to include .TIF, .AI, .PSD, etc., in addition to the standard GIF and JPG types... http://www.iana.org/assignments/media-types/index.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] UPS Ship Rates avail? XML?
Anyone know if there is a place I can query US shipping rates from say UPS or FedEx? Possibly through Amazon's API? Thanks in Advance!!! -NorthBayShane -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Multiple File Uploads With a Single Input
Is anyone aware of any recent developments that would allow you to upload multiple files from a single input type=file. Many of the messages in the archives say that this is impossible; however, these messages are more that a year old. I would like to be able to click a browse button, select multiple files, and upload them to a directory all at one time. Can it be done? Roger Lewis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Further Security Clarifications [was: Simple Security Clarifcation]
My main files are located in /var/www/html (the 'DOCUMENT_ROOT' in Apache, according to php.ini). All sensitive files have been moved to '/var/www/secure', but now I can't access them! (According to php.ini, the PHP core 'doc_root=none'). I'm totally confused. If I understand this correctly, I want the files in '/var/www/secure' to be served through php scripts that reside in the individual files that call them up in /var/www/html. So, the problem seems to be that either Apache or PHP doesn't know/can't access them. So, what am I doing wrong here? I've also added a FILes ~\.sht$ directive to refuse all .sht files (they're .inc's). How do get access for php to the secure file directory, and exclude the hackers? At this point, I'm about as confused as I've ever been since beginning PHP. Any clarifications that will guide back into the fold, will be greatly appreciated! Tia, Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Further Security Clarifications [was: Simple Security Clarifcation]
Usually the first thing you want to do here is check your error log. Most of the time, this sort of thing will be a permissions problem, as the apache server runs the PHP scripts as a user (ie you), that user needs to have the ability to execute those files. If you aren't sure, make the file owner you and give the files 777 and work backwards from there. Don't forget to check the directory permissions as well as the file permissions. From a hosting point of view, its different and a little more complicated if you have multiple users on the server, if it's just you though, it makes it a little easier. Take note of what the file permissions/ownership are befor eyou change them (in case this isn't the problem). Another simple things to check - make sure you're using the full path, ie, /var/www/secure/filename.php How are you including them? I use a require(/pathtofile/filename.php); Works for me assuming I have the right permissions. Best Regards Bob Irwin Server Admin Web Programmer Planet Netcom - Original Message - From: Andre Dubuc [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 22, 2002 11:19 AM Subject: [PHP] Further Security Clarifications [was: Simple Security Clarifcation] My main files are located in /var/www/html (the 'DOCUMENT_ROOT' in Apache, according to php.ini). All sensitive files have been moved to '/var/www/secure', but now I can't access them! (According to php.ini, the PHP core 'doc_root=none'). I'm totally confused. If I understand this correctly, I want the files in '/var/www/secure' to be served through php scripts that reside in the individual files that call them up in /var/www/html. So, the problem seems to be that either Apache or PHP doesn't know/can't access them. So, what am I doing wrong here? I've also added a FILes ~\.sht$ directive to refuse all .sht files (they're .inc's). How do get access for php to the secure file directory, and exclude the hackers? At this point, I'm about as confused as I've ever been since beginning PHP. Any clarifications that will guide back into the fold, will be greatly appreciated! Tia, Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multiple File Uploads With a Single Input
That's not how rfc1867 file uploads work. You need multiple browse buttons unless you do some weird client side magic that would zip a bunch of files together and upload them as one. -Rasmus On Wed, 21 Aug 2002, Roger Lewis wrote: Is anyone aware of any recent developments that would allow you to upload multiple files from a single input type=file. Many of the messages in the archives say that this is impossible; however, these messages are more that a year old. I would like to be able to click a browse button, select multiple files, and upload them to a directory all at one time. Can it be done? Roger Lewis -- 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] Web Site
I am setting up a web site which will be hosted on my own equipmet at home, located in Melbourne, Australia I would like some general advice on two questions. 1. What sort of permanent interconnect should I look at (Cable is not available in my area). Is DSL suitable? Are there any good providers in the area? 2. I need to set up credit card payments. Has anyone any experience with PayPal? Are there any other providers I should consider. I don't know if this is the correct list for the questions, but if not perhaps someone could point me to where I can get some advice. Regards Peter Goggin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Further Security Clarifications [was: Simple Security Clarifcation]
Thanks Bob, Got a 404: File not Found. Checked the ssl_error_log as suggested, and found a rather interesting entry: No such file: /var/www/html/var/www/secure/test.php Obviously it's goes to DOCUMENT_ROOT (pre-pending the/var/www/html) and adds what I've asked for. So, how do I tell it where to look, and not the default setting? How am I including them? Well, most of the action occurs from the menu so it's: a href=https://localhost/var/www/secure/test.php;Testing for Bugs/a (I've also tried /secure/test.php Any ideas what I'm messing up? Tioa, Andre On Wednesday 21 August 2002 09:26 pm, Bob Irwin wrote: Usually the first thing you want to do here is check your error log. Most of the time, this sort of thing will be a permissions problem, as the apache server runs the PHP scripts as a user (ie you), that user needs to have the ability to execute those files. If you aren't sure, make the file owner you and give the files 777 and work backwards from there. Don't forget to check the directory permissions as well as the file permissions. From a hosting point of view, its different and a little more complicated if you have multiple users on the server, if it's just you though, it makes it a little easier. Take note of what the file permissions/ownership are befor eyou change them (in case this isn't the problem). Another simple things to check - make sure you're using the full path, ie, /var/www/secure/filename.php How are you including them? I use a require(/pathtofile/filename.php); Works for me assuming I have the right permissions. Best Regards Bob Irwin Server Admin Web Programmer Planet Netcom - Original Message - From: Andre Dubuc [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 22, 2002 11:19 AM Subject: [PHP] Further Security Clarifications [was: Simple Security Clarifcation] My main files are located in /var/www/html (the 'DOCUMENT_ROOT' in Apache, according to php.ini). All sensitive files have been moved to '/var/www/secure', but now I can't access them! (According to php.ini, the PHP core 'doc_root=none'). I'm totally confused. If I understand this correctly, I want the files in '/var/www/secure' to be served through php scripts that reside in the individual files that call them up in /var/www/html. So, the problem seems to be that either Apache or PHP doesn't know/can't access them. So, what am I doing wrong here? I've also added a FILes ~\.sht$ directive to refuse all .sht files (they're .inc's). How do get access for php to the secure file directory, and exclude the hackers? At this point, I'm about as confused as I've ever been since beginning PHP. Any clarifications that will guide back into the fold, will be greatly appreciated! Tia, Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Agh! trim (#$@#@^%!!!)
Instead of trim($str), you need: $str = trim($str); Justin French on 22/08/02 12:44 AM, Mike At Spy ([EMAIL PROTECTED]) wrote: But isn't taking off characters or spaces considered modifying a string? I'll take another look at the manual, thanks. -Mike -Original Message- From: Darren Gamble [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 10:32 AM To: 'Mike At Spy'; [EMAIL PROTECTED] Subject: RE: [PHP] Agh! trim (#$@#@^%!!!) Good day, Well, for one, you are discarding the results of trim(). Check out the online manual page for trim(). The trim'ed string is returned. It does not say it modifies the string it is passed. Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -Original Message- From: Mike At Spy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 7:12 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] Agh! trim (#$@#@^%!!!) Here is the complete code - I have a lot of prints to watch things as they happen. $whois is the result of a WHOIS search. // beginning of my stuff function get_date ($whois){ trim ($whois); $whoisarray = explode (\n, $whois); print_r(array_values ($whoisarray)); $total_elements = count ($whoisarray); print pb$total_elements/b elements in this array; $ce = 0; while ($ce $total_elements){ $single_line = array_pop ($whoisarray); $expiration = strstr ($single_line,xpires); if ($expiration != '' || 0) { print pbThis is the line you want! Line $ce that sez: $single_line/bp; // $single_line = preg_replace (., , $single_line); $single_line = substr($single_line, 0, -2); // $single_line = rtrim ($single_line, \t\s\n\r); $getdatearray = explode ( , $single_line); print_r(array_values ($getdatearray)); $total_expire_elements = count ($getdatearray); print pbr.$total_expire_elements; $dc = 0; while ($dc $total_expire_elements){ $element = array_pop($getdatearray); $date_dash = strstr($element,-); if ($date_dash != '' || 0){ print pbrFirst Detection .$element; // $trimmed = rtrim ($element, \t.); print pbrLast print before date function .$element; month_replace ($element); print pbrResult after function .$element.pbr; $MySQLDate=date_validate($element); if (substr($MySQLDate, 0, 5)==Error) { // Insert Error Code if you want } else { // Insert Valid Date Code if you want } print pThe MySQL Formated date is $MySQLDate; } else {} $dc++; } } else {} $ce++; } } // end of my stuff Thanks, -Mike -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 8:53 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Agh! trim (#$@#@^%!!!) On Wednesday 21 August 2002 20:36, Mike At Spy wrote: Get this - it didn't work! :( I tried decreasing the -1 to -2 and so on, but nothing on that either. :( Post your exact code which didn't work. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* You can't go home again, unless you set $HOME. */ -- 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
[PHP] Re: Adding shadow effects to Images
If you need real shadow effects (i.e. if the image data itself should contain the shadow), you can follow the suggestion below but using GD to achieve the effect by concatenating images. If you're looking for a solution to *display* the thumbnails in the page, then this is what I would do: I'd create the shadow of a rectangle in any imaging software, with the appropriate blur size and transparency for the given situation (depending on thumbnail size and background color/pattern, respectively). Then I'd create a new layer to mask the undesired portion of the shadow (a placeholder for the actual thumbnail in effect), select it and use the selection to trim the shadow. I'd now have a mirrored L-shaped shadow mask. I would now determine where exactly do the corners end and where the continous linear parts begin (to the pixel, by deeply zooming in). Now all I'd have to do would be to trim the five areas which are different (three corners, a vertical and a horizontal patch) and I'd save those as five distinct files - and then use tables to display them around each thumbnails. The corners would be TDIMG SRC=top_right.png/TD and the vertical and horizontal ones would be TD BACKGROUND=horizontal.pngIMG SRC=spacer.gif/TD. You'll obviously have to make sure that the corner images match their width/height with the respective backgrounds. HTH Bogdan Steph wrote: I'm trying to auto-add shadow effects to my image thumbs using PHP or the GD Library if that's even possible. Any ideas where I start? Thanks, Steph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] copy a string
$str = foo foo; $str_copy = $str; // a copy of $str Unless of course you want to return a portion of a string, a certain word, a modified string, etc etc, in which case you'd need to check out all the string functions in the manual, and tell us what you wanna do. Justin on 22/08/02 1:32 AM, Oskar Hermansson ([EMAIL PROTECTED]) wrote: Hello! Is there any function to copy a string into the computers memory (just like you do when you press ctrl + c in, for example Internet Explorer). Is there any way to do this, just using PHP or JavaScript? Maybe by using the function system()? Note that i dont want to copy a file, just a string. Anyone got a solution to this problem? Im very grateful for any help i can get! With Regards, Oskar Hermansson, Sweden -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Further Security Clarifications [was: Simple Security Clarifcation]
Thanks Bob, Got a 404: File not Found. Checked the ssl_error_log as suggested, and found a rather interesting entry: No such file: /var/www/html/var/www/secure/test.php Ahhh - ok - I thought you were including them internally from PHP. You are actually linking to the file being SERVED by the web server in HTML. IN this case, all you need to do is reference to it as https://secureserveraddress/filename.php First of all, we need to understand this. We have two seperate servers here, the unix server that apache is running on and the apache server (this runs PHP, the secure server etc) itself. So... your normal website (served by the apache server) is at http://mywebsite.com/files.php BUT 'files.php' is located ON THE UNIX SERVER as /var/www/html/files.php The /var/www/html/ is the UNIX path to the file. The users who are using your APACHE server to get file do not see this in anyway. All they see is what is in the root directory, ie, /var/www/html from http://mywebsite.com/, this is exactly the same for the secure server, except the served files are encrypted. Success in this depends on what you are trying to do. Are you trying to secure files that contain information like your database passwords? Or are you just trying to run PHP scripts that produce HTML on a secure server (so that you can take credit card details from the remote users?). If you are trying to hide scripts with important information (ie, passwords) then running a secure server will not work. They will STILL be available from the internet, just at https://mywebsite/myfilewithapassword.php. This is not easily explained and I don't want to spend time going into it if its not what you're after, but if this is what you are doing, let me know and I'll help out. If you are just trying to encrypted the data from the server to the user, then you are doing the right thing, you just need to lose the /var/www/secure/ in the https:// address. Obviously it's goes to DOCUMENT_ROOT (pre-pending the/var/www/html) and adds what I've asked for. So, how do I tell it where to look, and not the default setting? How am I including them? Well, most of the action occurs from the menu so it's: a href=https://localhost/var/www/secure/test.php;Testing for Bugs/a (I've also tried /secure/test.php Any ideas what I'm messing up? Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] directory help
I need some help, I need to go through a number of directories and rename each of the files like this img001 img002 img003 do dir 1 would have img001 img002 img003 directory 2 might have img004 img005 and directory 3 would have img006 img007 img008 Thanks Randy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session problems: Warning: write failed: Disk quota exceeded
Hi, Recently, my php app has started to throw these warnings: Warning: write failed: Disk quota exceeded (122) in Unknown on line 0 Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0 I narrowed it down to this code: ?php session_start(); session_register('anything'); ? (A test file containing only that will throw those two warnings.) The php version is 4.2.2. This script is running in a shared hosting environment. My guess is that the ISP has misconfigured php, and has not set the appropriate permissions to the /tmp directory. Does this make sense? Or is there something that I've missed? Thank you, Beau -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session problems: Warning: write failed: Disk quota exceeded
G'day, Most likely they haven't pointed it to the right place (or maybe permissions? Doubt it would give this error for that). Session information is usually stored in /tmp on the hosting server (and on unix servers /tmp is actually a disk partition with a set size). There are a lot of applications on a hosting server that might use /tmp to store temporary files, so I suppose it is possible that something has filled /tmp up and PHP simply can't write to it because there is no where to write to! Call your host is my advice. Best Regards Bob Irwin Server Admin Web Programmer Planet Netcom - Original Message - From: Beau Hartshorne [EMAIL PROTECTED] To: php-general [EMAIL PROTECTED] Sent: Thursday, August 22, 2002 12:24 PM Subject: [PHP] Session problems: Warning: write failed: Disk quota exceeded Hi, Recently, my php app has started to throw these warnings: Warning: write failed: Disk quota exceeded (122) in Unknown on line 0 Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0 I narrowed it down to this code: ?php session_start(); session_register('anything'); ? (A test file containing only that will throw those two warnings.) The php version is 4.2.2. This script is running in a shared hosting environment. My guess is that the ISP has misconfigured php, and has not set the appropriate permissions to the /tmp directory. Does this make sense? Or is there something that I've missed? Thank you, Beau -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How Do You Protect Individual Files
on 22/08/02 2:15 AM, Roger Lewis ([EMAIL PROTECTED]) wrote: Well, I originally searched for protect file downloads. I also searched protect individual files, protect files, authenticate files, and on and on. There are thousands of messages, but very few with relevant titles or content. I was giving you exact subject lines from threads, not suggested search terms. And I also advised that they were VERY recent threads. One point to consider: I have no control over the files themselves. They are being uploaded to the document directories by end users, so I do not know the file names. That's fine. There's plenty of code for file uploading, including the PHP manual which has a full example. when you move_uploaded_file(), you need to move it to the target directory of restricted download files. What I am trying to do is prevent someone who knows the path to the file from being able to gain access to it without authorization. I understand what you're trying to achieve, and it IS asked on here weekly. Sign, again, here's the components you need: 1. an authorisation/session/user system of some form, based on PHP... in other words, I login via a PHP script, and then I walk around your site as a validated user. 2. a file storage method which enables you to store files in your disc hierarchy, but does not allow the files to be DIRECTLY served via HTTP. the two methods for this are: a) store your files ABOVE your web document root b) store your files within (below) your document root, and prevent them from being served by the use of a htaccess file. for this, place a file named .htaccess in the directory you want to protect (eg mydocroot/mp3/) with something like this in it: Files ~ \.inc$ Order Allow,Deny Deny from all /Files the above code prevents all *.inc files from being served via HTTP. Changing \.inc$ to \.mp3$ would refuse serving of all MP3 files. I'm NOT an apache geek at all, but my guess is that Files ~ * Order Allow,Deny Deny from all /Files Will refuse all files within the dir you place the .htaccess file. 3. you need a script which checks for a validated user, offers a range of files that can be downloaded, then when you click on one, check your a valid users, sets the correct mime-type, and parses the file through the php script to your browser. All of this is available in the Zend article I posted: http://www.zend.com/zend/trick/tricks-august-2001.php So, now you should have everything you need. Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: SeparatingWords
Just to make a fool of myself, I'd explode the string, parse each item and implode. I'm sure it can be done through some regexp wizardry as well - probably matching something along the lines of (^\ [A-Z]) but I'm way too retarded regexp-wise. BTW, any good online tutorials? I read through PHP's reference docs (which are probably excellent if you already know what it's all about), but only reached a limited understanding of how to approach problems... Bogdan Dl Neil wrote: Philip, What about SoftwareVersion Thingy? Won't that end up as Software Version Thingy - with two spaces before the T? Can the RegEx be 'turned off' if the u/case letter is already preceded by a space? (sorry, may not be Hessu's requirement = my curiosity) Regards, =dn This works. $word = SoftwareVersionThingy; $word = ereg_replace(([A-Z]), \\1, $word); $word = ltrim($word); -philip On Thu, 22 Aug 2002, Hessu wrote: Hi, I have strings like FileName, SoftwareVersion etc. How can I add space between words? Somehow with preg_replace perhaps? First letter of each word is capitalized. -Hessu- -- 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] Web Site
On Wednesday, August 21, 2002 6:41 PM Peter Goggin wrote 2. I need to set up credit card payments. Has anyone any experience with PayPal? Are there any other providers I should consider. Nothing but good to say about PayPal Roger -- 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] Image library
So hash them into groups of 1000 images 1-1000 1001 - 2000 2001 - 3000 etc etc, and just name the files 1.gif, 2.jpeg, etc etc Justin French on 22/08/02 12:41 AM, Scott Houseman ([EMAIL PROTECTED]) wrote: Hi there. So what you are suggesting is using an AUTO_INCREMENT field, possibly the image's Primary Key as an identifier for that image file., which is fine by me, but surely one should store files across directories, as 1 images in a single directory might slow down access to those images in the filesystem, or not so? Thanks for your input. Regards -Scott -Original Message- From: DL Neil [mailto:[EMAIL PROTECTED]] Sent: 21 August 2002 04:31 To: [EMAIL PROTECTED]; Bogdan Stancescu Subject: Re: [PHP] Image library Scott (confirming Bogdan), Libraries of all types have had this concern for years - even though books are uniquely identified by ISBN, that is still not good enough for library purposes (eg multiple copies of a single title). So they, exactly as Bogdan suggests, use an Accession number sequence - which can be implemented very neatly in MySQL (from PHP) as an AUTO_INCREMENT field. Regards, =dn I've seen this kind of random approach several times and I keep wondering why not counting the files instead. Yes, it may take a little longer when uploading but I personally think the safety of the approach is worth the insignificant speed sacrifice. Bogdan Scott Houseman wrote: Hi all. This confirms what I suspected. The hash algrithm: I have a directory structure: dirs 0 - f, and within each of these, the same dir structure 0 - f. When an image gets uploaded into the library, do an md5sum of the file, take the first 2 chars of that hash and there's your path. e.g $PICDBPATH.'/a/7/a7b8be10b0e69fe3decaa538f1febe84' I'm not sure what the mathematical randomness of this is, but I'm sure it's pretty random, and the chances of collision should be virtually null, the only time you should overwrite a file is if you upload the exact same file(?) Is there a better way of doing this? Cheers -Scott -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: 21 August 2002 03:25 To: [EMAIL PROTECTED]; PHP General Subject: Re: [PHP] Image library on 21/08/02 9:45 PM, Scott Houseman ([EMAIL PROTECTED]) wrote: Which way would be the most efficient/fastest to access images from an image library. A) Store image files in a hash directory structure AND storing each file's information in a mysql table OR B) Storing image information in mysql table AND storing the image in a BLOB field in that table. From all accounts I've read on this list, a database is not usually faster than a filesystem. And for large amounts of files, like 1000's, a hash will speed it up more. The way I see it, considerations to be taken into acount: - Is it quicker/better to retrieve image from table then stream out to browser OR simply direct the browser to the file? i.e IMG SRC=/imagelib/image.php?iImageID=10 OR IMG SRC=/imagelib/5/f/10 - Will a database OR filesystem be more scalable i.e. which wil perform better when there are 1 images in the libary? Filesystem should be quicker. You need to think about how you hash the files up for the most even spread of files in each directory I guess. 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Further Security Clarifications [was: Simple Security Clarifcation]
Thanks again Bob, First off, the site is still being debugged off-line, and part of the problem, as you suggested is my confusion over UNIX SERVER and the Apache Server. OK. Got that. What I'm trying to do: Any file that utilizes $_SESSION variables accessed through username/password validation is accessed via https. This includes the original signup screen, logins, etc. The only place for http files are static files that display non-sensitive info, and that do not require db access. If you are trying to hide scripts with important information (ie, passwords) then running a secure server will not work. They will STILL be available from the internet, just at https://mywebsite/myfilewithapassword.php. If the user is not logged in, they get an error message, and can go no further since $_SESSION['authenticate'] must match their username/password. All I'm trying to do is to provide an extra layer of security by shoving all sensitive files into the 'secure' directory, outside of the DOCUMENT_ROOT (but I have no idea what 'doc_root' in PHP is for??). From what I'm trying to accomplish, do I really need to bother setting the 'secure' directory outside of the document_root? Wouldn't the setup I've done so far suffice? At any rate, I've tried just setting : https://localhost/secure/test.php -- it still gives a 404 Tia, Andre On Wednesday 21 August 2002 10:12 pm, Bob Irwin wrote: Thanks Bob, Got a 404: File not Found. Checked the ssl_error_log as suggested, and found a rather interesting entry: No such file: /var/www/html/var/www/secure/test.php Ahhh - ok - I thought you were including them internally from PHP. You are actually linking to the file being SERVED by the web server in HTML. IN this case, all you need to do is reference to it as https://secureserveraddress/filename.php First of all, we need to understand this. We have two seperate servers here, the unix server that apache is running on and the apache server (this runs PHP, the secure server etc) itself. So... your normal website (served by the apache server) is at http://mywebsite.com/files.php BUT 'files.php' is located ON THE UNIX SERVER as /var/www/html/files.php The /var/www/html/ is the UNIX path to the file. The users who are using your APACHE server to get file do not see this in anyway. All they see is what is in the root directory, ie, /var/www/html from http://mywebsite.com/, this is exactly the same for the secure server, except the served files are encrypted. Success in this depends on what you are trying to do. Are you trying to secure files that contain information like your database passwords? Or are you just trying to run PHP scripts that produce HTML on a secure server (so that you can take credit card details from the remote users?). If you are trying to hide scripts with important information (ie, passwords) then running a secure server will not work. They will STILL be available from the internet, just at https://mywebsite/myfilewithapassword.php. This is not easily explained and I don't want to spend time going into it if its not what you're after, but if this is what you are doing, let me know and I'll help out. If you are just trying to encrypted the data from the server to the user, then you are doing the right thing, you just need to lose the /var/www/secure/ in the https:// address. Obviously it's goes to DOCUMENT_ROOT (pre-pending the/var/www/html) and adds what I've asked for. So, how do I tell it where to look, and not the default setting? How am I including them? Well, most of the action occurs from the menu so it's: a href=https://localhost/var/www/secure/test.php;Testing for Bugs/a (I've also tried /secure/test.php Any ideas what I'm messing up? Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mime types?
Generally looking your browser preferences is a great help. For IE mac it's known as helper applications, and lists what IE should do with each mime type. Justin French on 22/08/02 7:17 AM, Wm ([EMAIL PROTECTED]) wrote: Is there a resource somewhere that would show what the various MIME types are? For a file upload page, I want to include .TIF, .AI, .PSD, etc., in addition to the standard GIF and JPG types... Thanx, Wm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Site
Just for the record, I'm sure you can Google out quite a few nasty comments on PayPal - I remember reading some along the lines of dear all, I know it was much easier for you to send money via PayPal, I know that giving up on using it will considerably decrease my income, but after my [...] experience I want to have nothing to do with them anymore. Never used PayPal myself, and problems are inherent for such a large system, so don't take this as an anti-PayPal message - just try searching for some user comments before starting to use it. Bogdan Roger Lewis wrote: On Wednesday, August 21, 2002 6:41 PM Peter Goggin wrote 2. I need to set up credit card payments. Has anyone any experience with PayPal? Are there any other providers I should consider. Nothing but good to say about PayPal Roger -- 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] webhosting - OT
Hi guys, I know this is off topic but any help appreciated. I have a high speed cable connection...(I get around 100k a second on downloads) and I own a 2 domains that are not hosted...coz I cant afford hosting...is there any way I can host these 2 domains from my comp? if you can tell me how or just point me in the general direction with a url or two I would appreciate it... I tried google but either I was using the wrong keywords or the answers were too high funda for me :-) Kindly help,thanks in advance, Cheers, -Ryan.
Re: [PHP] Web Site
on 22/08/02 11:41 AM, Peter Goggin ([EMAIL PROTECTED]) wrote: I am setting up a web site which will be hosted on my own equipmet at home, located in Melbourne, Australia I would like some general advice on two questions. 1. What sort of permanent interconnect should I look at (Cable is not available in my area). Is DSL suitable? Are there any good providers in the area? DSL is a cheap option, although you have limited bandwidth and file transfers. It would be a good first step. 2. I need to set up credit card payments. Has anyone any experience with PayPal? Are there any other providers I should consider. It sounds like you're NOT a sys admin type, so DON'T think about storing credit card #'s on your own server yet -- you'd need a lot of security and system admin experience before going there! PayPal Authorize.net Depends on what you want to sell (intellectual property or physical items) Not really the place to ask this... look for e-commerce type sites and articles... liek the ones on ecommercebase.com Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] webhosting - OT
You basicaly need to have the domains point to IP address within your box. This is done via a domain name server (DNS). I used to use bpc-users.org for this, but now my ISP kindly hosts xx.indent.com.au as my office server. In other words, you need someone with a DNS to point your websites to your box. You can get hosting from like US$5/month. Why bother with all this though? Justin on 22/08/02 12:42 PM, Ryan A ([EMAIL PROTECTED]) wrote: Hi guys, I know this is off topic but any help appreciated. I have a high speed cable connection...(I get around 100k a second on downloads) and I own a 2 domains that are not hosted...coz I cant afford hosting...is there any way I can host these 2 domains from my comp? if you can tell me how or just point me in the general direction with a url or two I would appreciate it... I tried google but either I was using the wrong keywords or the answers were too high funda for me :-) Kindly help,thanks in advance, Cheers, -Ryan. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] anyone...?
Hi, im trying to do this the most automate as possible... i want this scripts to make the input as the user ask, for example 3 then, each input must have a different name, i've tried with the for control structure but can't get to the point. then the fields are created in a db... anyone? ? require(conexion.php); $query=mysql_query(Select * from empresas_dpto order by id desc); $form = input type=\text\ name=\duh\ | ; if ($tipo==crear) { // si la cantidad de campos requeridos es mayor a 40 entonces da error // if ($crear_empresas 40) { ? table width=100% border=0 cellspacing=1 cellpadding=1 align=center tr td div align=centerfont face=Verdana, Arial, Helvetica, sans-serif size=3 color=#FFbLa Empresa no puede tener maacute;s de 60 Departamentos Haga click a href=javascript:history.back()aqui/a para volver/b/font/div /td /tr /table ? } ? table width=100% border=0 cellspacing=1 cellpadding=1 tr td div align=centerfont size=3 color=#FF face=Verdana, Arial, Helvetica, sans-serifbRecuerde que los campos no pueden contener espacios a la hora de crear los departamentos /b /font/div /td /tr /tablebr ? echo str_repeat($form, $crear_empresas); } else { ? form name=x method=post action=aempresas.php?tipo=crear input type=text name=crear_empresas value= input type=submit name=Submit value=Elaborar Planillas /form ? } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] connecting to db
Hi, Just setting up a new db at a new domain and the connection script does not work. I've always been able to connect to a db using the following: ?php // Connect to the database server $dbcnx = mysql_connect(localhost, username, password); if (!$dbcnx) { echo( PUnable to connect to the . database server at this time./P ); exit(); } The host support suggests the following: Root as the mysql user and localhost as the server, unless you selected remote mysql connections from the web control panel. BTW: I DID select remote mysql. Should I unselect it? FMI (forgive my ignorance): What connection script should I use? Thanks So Much in Advance, Jim Long -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Image library
That was my original idea - and to take things to extremes, you might even want to recurse directories: using only a couple of recursiveness levels (1-1000/1-1000/1-1000.jpg) would ensure 1 bil. files without getting more than 1000 in any singe directory. The really nice thing about this approach is that you can start with a single level and in the unlikely event you get more than 1 mil. (you wish! :)) then you can add another in no time, with a down time of probably ten minutes. In a slightly different train of thoughts, since this approach is so flexible, I'd recommend going for 500 files per directory - that's a limit which guarantees no slowdown. (And yes, I've read Jay's argument, but I have heard so many counter-arguments throughout time that I personally prefer to stay on the safe side - it's no big deal after all). Just my 2c, obviously. Bogdan Justin French wrote: So hash them into groups of 1000 images 1-1000 1001 - 2000 2001 - 3000 etc etc, and just name the files 1.gif, 2.jpeg, etc etc Justin French on 22/08/02 12:41 AM, Scott Houseman ([EMAIL PROTECTED]) wrote: Hi there. So what you are suggesting is using an AUTO_INCREMENT field, possibly the image's Primary Key as an identifier for that image file., which is fine by me, but surely one should store files across directories, as 1 images in a single directory might slow down access to those images in the filesystem, or not so? Thanks for your input. Regards -Scott -Original Message- From: DL Neil [mailto:[EMAIL PROTECTED]] Sent: 21 August 2002 04:31 To: [EMAIL PROTECTED]; Bogdan Stancescu Subject: Re: [PHP] Image library Scott (confirming Bogdan), Libraries of all types have had this concern for years - even though books are uniquely identified by ISBN, that is still not good enough for library purposes (eg multiple copies of a single title). So they, exactly as Bogdan suggests, use an Accession number sequence - which can be implemented very neatly in MySQL (from PHP) as an AUTO_INCREMENT field. Regards, =dn I've seen this kind of random approach several times and I keep wondering why not counting the files instead. Yes, it may take a little longer when uploading but I personally think the safety of the approach is worth the insignificant speed sacrifice. Bogdan Scott Houseman wrote: Hi all. This confirms what I suspected. The hash algrithm: I have a directory structure: dirs 0 - f, and within each of these, the same dir structure 0 - f. When an image gets uploaded into the library, do an md5sum of the file, take the first 2 chars of that hash and there's your path. e.g $PICDBPATH.'/a/7/a7b8be10b0e69fe3decaa538f1febe84' I'm not sure what the mathematical randomness of this is, but I'm sure it's pretty random, and the chances of collision should be virtually null, the only time you should overwrite a file is if you upload the exact same file(?) Is there a better way of doing this? Cheers -Scott -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: 21 August 2002 03:25 To: [EMAIL PROTECTED]; PHP General Subject: Re: [PHP] Image library on 21/08/02 9:45 PM, Scott Houseman ([EMAIL PROTECTED]) wrote: Which way would be the most efficient/fastest to access images from an image library. A) Store image files in a hash directory structure AND storing each file's information in a mysql table OR B) Storing image information in mysql table AND storing the image in a BLOB field in that table. From all accounts I've read on this list, a database is not usually faster than a filesystem. And for large amounts of files, like 1000's, a hash will speed it up more. The way I see it, considerations to be taken into acount: - Is it quicker/better to retrieve image from table then stream out to browser OR simply direct the browser to the file? i.e IMG SRC=/imagelib/image.php?iImageID=10 OR IMG SRC=/imagelib/5/f/10 - Will a database OR filesystem be more scalable i.e. which wil perform better when there are 1 images in the libary? Filesystem should be quicker. You need to think about how you hash the files up for the most even spread of files in each directory I guess. 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] inserting info into db
maybe yuou could try passing the variables into an input hidden field, so you know the answer wont be uncomplete, and you insert all of them in the last page. Flavio Bastos Amiel Rick Widmer [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... At 01:56 PM 7/29/02 +, Tyler Durdin wrote: I have a DB that will take answers to an 82 question survey, but i have the survey divided into 4 html pages(forms) of 20 or so question per page. The people taking the survey are not required to fill out every question on the survey. i was wondering how i can insert the data into the db this way. For example, the first html page goes to question #24 the next starts at 25 an goes to 47. How can i enter 25 to 47 into the db and keep it all in numerical order when 1-24 are entered first? One more question, does anyone have any recommendations on how i can make it so the users can take page one of the survey and then come back and finish pages 2 (or something similar to this where they finish one of the pages and come back to finish the others later) later? Thanks in advance. If I was doing it, I would probably INSERT a mostly empty record in the database when they start the survey. It would just have the info to identify the person. Then on each page of the survey you can UPDATE the fields for that page. If you want to allow them to make changes it should be pretty easy. Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] directory help
On Thursday 22 August 2002 10:12, Randy Johnson wrote: I need some help, I need to go through a number of directories and rename each of the files like this img001 img002 img003 do dir 1 would have img001 img002 img003 directory 2 might have img004 img005 and directory 3 would have img006 img007 img008 Where is your question? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* According to the obituary notices, a mean and unimportant person never dies. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How Do You Protect Individual Files
Justin, Thanks again. I've been doing some more research on .htaccess. The problem I see is that it is high maintenance, i.e. I've already got a MySQL table of users with username and password. To use .htaccess, you have to have a htpasswd file containing duplicate usernames and passwords, and this would have to be in sync with the MySQL table. I have found that there is an Apache module, mod_auth_mysql, that allows .htaccess to access a MySQL database for the information it needs. This module is available at http://www.diegonet.com/support/mod_auth_mysql.shtml. Problem is you have to install the mod and recompile Apache, I think. And I don't know how to do that yet. However, if everything works in accordance with my interpretation, you should be able to put an .htascess file into the directory you wish to protect and Mod_auth_mysql will communicate with the database to authenticate the users. Roger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Site
On Thursday 22 August 2002 10:42, Bogdan Stancescu wrote: Just for the record, I'm sure you can Google out quite a few nasty comments on PayPal - I remember reading some along the lines of dear all, I know it was much easier for you to send money via PayPal, I know that giving up on using it will considerably decrease my income, but after my [...] experience I want to have nothing to do with them anymore. Never used PayPal myself, and problems are inherent for such a large system, so don't take this as an anti-PayPal message - just try searching for some user comments before starting to use it. IIRC there seems to have been a period a while back when PayPal were 'over-reacting' to fraud and innocent users got caught up in the cross-fire. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Luke, I'm yer father, eh. Come over to the dark side, you hoser. -- Dave Thomas, Strange Brew */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Site
On Thursday 22 August 2002 10:44, Justin French wrote: on 22/08/02 11:41 AM, Peter Goggin ([EMAIL PROTECTED]) wrote: I am setting up a web site which will be hosted on my own equipmet at home, located in Melbourne, Australia I would like some general advice on two questions. 1. What sort of permanent interconnect should I look at (Cable is not available in my area). Is DSL suitable? Are there any good providers in the area? DSL is a cheap option, although you have limited bandwidth and file transfers. It would be a good first step. Do they give you a permanent IP address? If not, you're going to have to subscribe to some dynamic IP service so people can actually get to your site. But quite frankly running a commercial website (I assume so because you'll be accepting CC payments) using dynamic IP feels a bit dodgy to me. Surely a commercial operation can afford the USD 10-20/month for a decent web host? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* A new koan: If you have some ice cream, I will give it to you. If you have no ice cream, I will take it away from you. It is an ice cream koan. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How Do You Protect Individual Files
on 22/08/02 1:10 PM, Roger Lewis ([EMAIL PROTECTED]) wrote: Justin, Thanks again. I've been doing some more research on .htaccess. The problem I see is that it is high maintenance, i.e. I've already got a MySQL table of users with username and password. To use .htaccess, you have to have a htpasswd file containing duplicate usernames and passwords, and this would have to be in sync with the MySQL table. NO. All the .htaccess file would do in this case is prevent the files from being served over http AT ALL. Instead, the files are served THROUGH a PHP script which checks for authenticated user first. I have found that there is an Apache module, mod_auth_mysql, that allows .htaccess to access a MySQL database for the information it needs. This module is available at http://www.diegonet.com/support/mod_auth_mysql.shtml. Problem is you have to install the mod and recompile Apache, I think. And I don't know how to do that yet. However, if everything works in accordance with my interpretation, you should be able to put an .htascess file into the directory you wish to protect and Mod_auth_mysql will communicate with the database to authenticate the users. You don't need anything more that a standard Apache, PHP and MySQL install. Read my last email again, and again, and again. It (hopefully) clearly sets out what you need, and how each part interacts. I don't know how to be much clearer, without doing it for you (which I can do, at a cost :)) Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Site
on 22/08/02 1:18 PM, Jason Wong ([EMAIL PROTECTED]) wrote: DSL is a cheap option, although you have limited bandwidth and file transfers. It would be a good first step. Do they give you a permanent IP address? If not, you're going to have to subscribe to some dynamic IP service so people can actually get to your site. But quite frankly running a commercial website (I assume so because you'll be accepting CC payments) using dynamic IP feels a bit dodgy to me. Surely a commercial operation can afford the USD 10-20/month for a decent web host? Exactly!!! Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dumb question
Hey guys, got a basic question for you... ? function getvar() { $vari = bollocks; } getvar(); echo $vari; ? How do I make that function return the variable? Thanks, Liam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dumb question
You need to declare $vari as a global variable. eg; ? function getvar() { global $vari; $vari = bollocks; } getvar(); echo $vari; ? Best Regards Bob Irwin Server Admin Web Programmer Planet Netcom - Original Message - From: Liam MacKenzie [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 22, 2002 1:27 PM Subject: [PHP] Dumb question Hey guys, got a basic question for you... ? function getvar() { $vari = bollocks; } getvar(); echo $vari; ? How do I make that function return the variable? Thanks, Liam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] UPS Ship Rates avail? XML?
On 21 Aug 2002 at 17:55, Shane wrote: Anyone know if there is a place I can query US shipping rates from say UPS or FedEx? Possibly through Amazon's API? I'm surprised on one has sold access to these. Back in the days when I did ecommerce:) I had carts that would use something like curl I guess and parse the remote files to get rates but I setup tables in mysql with data you can get from the UPS and from FedEx. UPS will send you a floppy disk (what they did to me) and you can reorganize or use the data structure as is (oh forgot, that was the USPS that did that). UPS: http://www.ups.com/using/software/currentrates/rates_in_us.html#zones USPS http://postcalc.usps.gov/Zonecharts/ Not too helpful but they'll sell you (about US$35.00 I think) a floppy with a matrix of all that stuff or you can just get the data for your shipping point of origin(s) Try this: http://postcalc.usps.gov/ FEDEX http://www.fedex.com/servlet/RateFinderServlet?orig_country=USlanguage= english has a link to download rates: http://www.fedex.com/us/rates/downloads/?link=2 The problem with putting these rates in a database is that they will change and how will you know? I think Amazon has done a real good thing here that might wake up some other companies. All this stuff was available years ago. Who's working at these big companies. Here is a site with lots of shipping info: http://shipping.langenberg.com/ Peter -- http://www.coremodules.com/ PETER J. SCHOENSTER (901)-652-2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help w/IMAP
Sorry all, I can't type. The reference should be imap_header() and also, here's a snip of the code I'm using: SNIP $mbox = imap_open({localhost:143},user,pass) or die(can't connect: .imap_last_error()); for($i=1; $i = 5; $i++) { $msg_header = imap_header($mbox,$i); print tr\n; print td . $i . /td\n; print td align=right . $msg_header-Size . /td\n; print td . $msg_header-udate . /td\n; print td . $msg_header-date . /td\n; print td . $msg_header-Date . /td\n; print td . $msg_header-MailDate . /td\n; print /tr\n; } SNIP On Wed, 2002-08-21 at 20:42, David Christensen wrote: I'm having a weird problem with the certain date fields using the imap_head() object in PHP4. Sorry about the long lines, but I wanted to get all the fields for imap_header() in so you could see what I mean. Index Size udate dateDate MailDate 0 2365 1023729291 Fri, 5 Apr 2002 08:30:42 -0800 Fri, 5 Apr 2002 08:30:42 -0800 10-Jun-2002 10:14:51 -0700 1 1611 1023729291 14 Apr 2002 23:33:02 - 14 Apr 2002 23:33:02 - 10-Jun-2002 10:14:51 -0700 2 2582 1023729291 Wed, 17 Apr 2002 11:55:26 -0500 Wed, 17 Apr 2002 11:55:26 -0500 10-Jun-2002 10:14:51 -0700 3 1745 1023729291 Thu, 18 Apr 2002 11:43:30 GMT Thu, 18 Apr 2002 11:43:30 GMT 10-Jun-2002 10:14:51 -0700 4 2322 1023729290 Wed, 1 May 2002 15:21:02 +1000 Wed, 1 May 2002 15:21:02 +1000 10-Jun-2002 10:14:50 -0700 The udate are all the same but one and they don't match what the real date of the email head says. They do however, match the MailDate field. Here's the phpinfo() IMAP Supportenabled IMAP c-Client Version4.1 Apache-AdvancedExtranetServer/1.3.23 PHP Version 4.1.2 Any help is greatly appreciated! Dave Christensen -- 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
[Fwd: Re: [PHP] Dumb question]
---BeginMessage--- ? function getvar() { $vari = bollocks; # this $vari is local to function } $vari = getvar(); # this $vari is in global space echo $vari ? On Wed, 2002-08-21 at 20:35, Bob Irwin wrote: You need to declare $vari as a global variable. eg; ? function getvar() { global $vari; $vari = bollocks; } getvar(); echo $vari; ? Best Regards Bob Irwin Server Admin Web Programmer Planet Netcom - Original Message - From: Liam MacKenzie [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 22, 2002 1:27 PM Subject: [PHP] Dumb question Hey guys, got a basic question for you... ? function getvar() { $vari = bollocks; } getvar(); echo $vari; ? How do I make that function return the variable? Thanks, Liam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: connecting to db
$dbhost = ''; // MySQL server hostname $dbuser = ''; // MySQL username $dbpass = ''; // MySQL password $dbname = ''; // MySQL database name mysql_connect($dbhost, $dbuser) mysql_select_db($dbname) or $failed = Could not connect to database.; Jim Long [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, Just setting up a new db at a new domain and the connection script does not work. I've always been able to connect to a db using the following: ?php // Connect to the database server $dbcnx = @mysql_connect(localhost, username, password); if (!$dbcnx) { echo( PUnable to connect to the . database server at this time./P ); exit(); } The host support suggests the following: Root as the mysql user and localhost as the server, unless you selected remote mysql connections from the web control panel. BTW: I DID select remote mysql. Should I unselect it? FMI (forgive my ignorance): What connection script should I use? Thanks So Much in Advance, Jim Long -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Dumb question
In article 000901c2498b$ce972950$0e00a8c0@luke, [EMAIL PROTECTED] says... Hey guys, got a basic question for you... ? function getvar() { $vari = bollocks; } getvar(); echo $vari; ? How do I make that function return the variable? Thanks, Liam Strangely, by using return. function getvar() { $vari = bollocks; return $vari; } $answer = getvar(); echo $answer; ? -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Web Site
I think DSL is better than cable if you can't get a T3 line. If you want a site hosted at your home, i strongly suggest Apache(www.apache.org). Great sever tool :) Or PHP-Triad(www.phpgeek.com not sure if thats the site or not, sorry). Sorry i have no PayPal account so i can't answer that one ;) -Sami Peter Goggin [EMAIL PROTECTED] wrote in message 00a101c2497c$f8e51410$030a@petergnt1">news:00a101c2497c$f8e51410$030a@petergnt1... I am setting up a web site which will be hosted on my own equipmet at home, located in Melbourne, Australia I would like some general advice on two questions. 1. What sort of permanent interconnect should I look at (Cable is not available in my area). Is DSL suitable? Are there any good providers in the area? 2. I need to set up credit card payments. Has anyone any experience with PayPal? Are there any other providers I should consider. I don't know if this is the correct list for the questions, but if not perhaps someone could point me to where I can get some advice. Regards Peter Goggin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Passing variables between servers
Why not share a session DB across both servers? Since your users disable cookies you'll have a url that looks like this anyway: http://www.myPHPserver.com/index.php?sid=12345 if you wanted to maintain session state so, when redirecting to the ASP server do: header('location: http://www.myASPserver.com/default.asp?sid=12345') then have default.asp open the DB that has the sessions for the PHP server through ODBC or ADO or whatever and match the session id pulling out the stored info for that session. -GED -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Determining if a variable is blank.
I have a simplistic forum, and I am trying to write some code to determine if the message box actually contains information, because if it is blank I obviously don't want to post it to the database. The message box has the name of 'reply'. Here is the code I'm trying to use, but its not working: $reply2 = str_replace( ,,$reply); if(empty($reply2)){ // echo some error message to the user that they can't post a blank message } else{ // post the message } This however didn't work for me. So I had the thought that maybe the variable $reply2 isn't set because it is blank. So I tried this: $reply2 = str_replace( ,,$reply); if(empty($reply2) || !isset($reply2)){ // echo an error message } else{ // post the message. } I've tried different variations on this same idea, but somehow none of them are working. Can anyone give me any suggestions or insight? Jason Cathcart Check Out My Site: http://www.biohazardous.org
Re: [PHP] Determining if a variable is blank.
Use trim() instead of that str_replace and then an if(empty()) On Wed, 21 Aug 2002, Jason wrote: I have a simplistic forum, and I am trying to write some code to determine if the message box actually contains information, because if it is blank I obviously don't want to post it to the database. The message box has the name of 'reply'. Here is the code I'm trying to use, but its not working: $reply2 = str_replace( ,,$reply); if(empty($reply2)){ // echo some error message to the user that they can't post a blank message } else{ // post the message } This however didn't work for me. So I had the thought that maybe the variable $reply2 isn't set because it is blank. So I tried this: $reply2 = str_replace( ,,$reply); if(empty($reply2) || !isset($reply2)){ // echo an error message } else{ // post the message. } I've tried different variations on this same idea, but somehow none of them are working. Can anyone give me any suggestions or insight? Jason Cathcart Check Out My Site: http://www.biohazardous.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] variable variables i think...
Hi all, Having trouble with the logic behind this. I have a dynamic SKU, and a dynamic size_range array. Examples: $sku = '44044'; $size_range = array('S', 'M', 'L'); Which I use to build a pull down select box: SELECT name=myselect ? foreach($sizes as $k = $v) { echo OPTION value=\$v\$v/OPTION; } ? /SELECT Note, the select's name is just a string now, not an array. Sinxe there are many SKU's on the page, What I'd like to do is dynamically generate this name, so that each SKU is part of an array. Eg: $selected_size['44044'] = 'M'; $selected_size['44045'] = 'S'; $selected_size['44046'] = 'L'; etc etc This will make processing the data HEAPS easier. So I need to dynamically generate the SELECT's name: SELECT name=selected_size['?=$sku?'] Easy. BUT, since this form may be spat back out to the user if fields were left blank, etc etc, I like to do something like: SELECT name=myselect ? foreach($sizes as $k = $v) { $myselect = $_POST['myselect']; if($myselect == $v) { $sel = selected; } else { $sel = ; } echo OPTION value=\{$v}\{$sel}{$v}/OPTION; } ? /SELECT Which ensures that any values they did select will still be selected when they get given the form again to make changes. Trouble is, with a dynamically assigned SELECT name, I have no idea how to test for an existing value. I thought it'd be something like: SELECT name=myselect['?=$sku?'] ? foreach($sizes as $k = $v) { $myselect[$sku] = $_POST['myselect'][$sku]; if($myselect[$sku] == $v) { $sel = selected; } else { $sel = ; } echo OPTION value=\{$v}\{$sel}{$v}/OPTION; } ? /SELECT But this isn't working. My guess is that I need variable variables, or some other way of referencing the select's name. Any ideas welcome. Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php