Re: [PHP] compiling on freebsd
what are you using for your flags when you do ./configure normal should be ./configure --with-apxs=/usr/local/apache/bin/apxs Things like that. if you ran ./configure nothing will compile the libphp4 for you. there is a Install file which will walk you thru the setup also on the manual on php.net under installation there is a freebsd section. Christopher Riordan http://www.hal-9000.net - Original Message - From: Larry Brown [EMAIL PROTECTED] To: PHP List [EMAIL PROTECTED] Sent: Thursday, April 25, 2002 1:30 AM Subject: RE: [PHP] compiling on freebsd I don't mean to be rude but as I mentioned in my post After running ./configure make and make install Please review my post for the actual problem. Larry S. Brown MCSE Dimension Networks, Inc. Member ICCA (727) 723-8388 -Original Message- From: Evan Nemerson [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 1:25 AM To: Larry Brown; [EMAIL PROTECTED] Subject: Re: [PHP] compiling on freebsd ./configure make make install On Wednesday 24 April 2002 22:08 pm, you wrote: I am trying to get php installed and working on a freebsd server and I'm used to using linux where it hasn't failed me before. After running ./configure make and make install there is no libphp4.so anywhere on the server. I ran just ./configure and make and then checked the current directories for the file with no positive results. Larry S. Brown MCSE Dimension Networks, Inc. Member ICCA (727) 723-8388 -- Common sense is not so common. Voltaire -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] alternatives to mail()
Just to flesh it out a little more Split the address up and get the domain name (the part after the @). Do a DNS lookup on that domain name for an MX record. If that fails, look for an A record. If that fails, give up. If you got an address, open a socket connection to that address, port 25. Wait for a line beginning with 2 Send HELO\n Wait for a line beginning with 250 Send MAIL FROM:[EMAIL PROTECTED]\n Wait for a line beginning with 250 Send RCPT TO:[EMAIL PROTECTED]\n Wait for a line beginning with 250 Send DATA\n Wait for a line beginning with 3 Send your entire message, including headers. Send a blank line containing only a period followed by \n Wait for a line beginning with 250 Send QUIT\n Close connection. miguel On Wed, 24 Apr 2002, Evan Nemerson wrote: php.net/fsockopen php.net/sockets Have fun ; On Wednesday 24 April 2002 22:14 pm, you wrote: The commercial server where my pages are hosted is having trouble with the lastest version of PHP and as a result the mail() function is not working. E-mailing from PHP is critical for my postcard and other functions on my site. (I might as well shut four of my sites without e-mail.) Is there a fall-back option from PHP to send mail when the mail() function is not working? John Hughes __ Do You Yahoo!? Yahoo! Games - play chess, backgammon, pool and more http://games.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] alternatives to mail()
I would think even if your host can't get the mail function in PHP to work, they probably have a functioning SMTP server you can use, in which case this class should do the trick for you: http://www.phpclasses.org/browse.html/package/264.html Let me know if you want a hosting provider that provides PHP working with the mail function! :) HTH, Peter Janett New Media One Web Services New Upgrades Are Now Live!!! Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1 Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25, Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43 PostgreSQL coming soon! http://www.newmediaone.net [EMAIL PROTECTED] (303)828-9882 - Original Message - From: Miguel Cruz [EMAIL PROTECTED] To: John Hughes [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, April 25, 2002 1:06 AM Subject: Re: [PHP] alternatives to mail() Just to flesh it out a little more Split the address up and get the domain name (the part after the @). Do a DNS lookup on that domain name for an MX record. If that fails, look for an A record. If that fails, give up. If you got an address, open a socket connection to that address, port 25. Wait for a line beginning with 2 Send HELO\n Wait for a line beginning with 250 Send MAIL FROM:[EMAIL PROTECTED]\n Wait for a line beginning with 250 Send RCPT TO:[EMAIL PROTECTED]\n Wait for a line beginning with 250 Send DATA\n Wait for a line beginning with 3 Send your entire message, including headers. Send a blank line containing only a period followed by \n Wait for a line beginning with 250 Send QUIT\n Close connection. miguel On Wed, 24 Apr 2002, Evan Nemerson wrote: php.net/fsockopen php.net/sockets Have fun ; On Wednesday 24 April 2002 22:14 pm, you wrote: The commercial server where my pages are hosted is having trouble with the lastest version of PHP and as a result the mail() function is not working. E-mailing from PHP is critical for my postcard and other functions on my site. (I might as well shut four of my sites without e-mail.) Is there a fall-back option from PHP to send mail when the mail() function is not working? John Hughes __ Do You Yahoo!? Yahoo! Games - play chess, backgammon, pool and more http://games.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Getting page with fopen
Hello! I'm trying to find out on which rank my side is at google automatically. I'm trying the following code, but I get a strange error: $Url = http://www.google.de/search?q=MySearchWord;; // Gives Warning: No error on line [where fopen is] $Url = http://www.google.de/;; // Works for ($i = 0; $i 100; $i += 10) { $fp = fopen($Url, r); while($fp !feof($fp)) { $sLine .= fgets($fp, 4096); } ... do some further things with $sLine fclose($fp); } How can I get more information about the error occuring? Warning: No error is not much information... Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting page with fopen
On Thursday 25 April 2002 16:39, Martin Thoma wrote: Hello! I'm trying to find out on which rank my side is at google automatically. I'm trying the following code, but I get a strange error: $Url = http://www.google.de/search?q=MySearchWord;; // Gives Warning: No error on line [where fopen is] $Url = http://www.google.de/;; // Works for ($i = 0; $i 100; $i += 10) { $fp = fopen($Url, r); while($fp !feof($fp)) { $sLine .= fgets($fp, 4096); } ... do some further things with $sLine fclose($fp); } How can I get more information about the error occuring? Warning: No error is not much information... Google is probably trying to send you a cookie in which case you cannot use fopen. You need to use curl or snoopy(?). -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* When the wind is great, bow before it; when the wind is heavy, yield to it. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting page with fopen
Google is probably trying to send you a cookie in which case you cannot use fopen. You need to use curl or snoopy(?). Thanx, that could be the problem. Unfortunatly, curl is not compiled in my php-version, and what is snoopy?! ;-) Any other ideas/examples? Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Solved Getting page with fopen
Ah, it works with fsockopen: $fp = fsockopen (www.google.com, 80, $errno, $errstr, 30); if (!$fp) { print Fehler: $errstr ($errno)\n; } else { fputs ($fp, GET / HTTP/1.0\r\nHost: $Url\r\n\r\n); while (!feof($fp)) { $sLine .= fgets ($fp, 4096); } } fclose ($fp); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Unlucky Situation Involving CURL
I'm developing a website that has the unlucky situation of being situated on a host that does not have CURL installed on it. This is basically what I'm trying to do: $ch = curl_init(); /// initialize a cURL session curl_setopt ($ch, CURLOPT_URL,https://www.ups.com/ups.app/xml/Rate;); /// set the post-to url (do not include the ?query+string here!) curl_setopt ($ch, CURLOPT_HEADER, 0); /// Header control curl_setopt($ch, CURLOPT_POST, 1); /// tell it to make a POST, not a GET curl_setopt($ch, CURLOPT_POSTFIELDS, $y); /// put the query string here starting with ? curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); /// This allows the output to be set into a variable $xyz $xyz = curl_exec ($ch); /// execute the curl session and return the output to a variable $xyz curl_close ($ch); /// close the curl session Basically what this will do is send an XML file to UPS, to get shipping rates which are returned as an XML file from UPS. The script has to sit and wait for an answer from the UPS servers. Does anybody know of a way of doing this without using CURL? Jason Cathcart
[PHP] Problem with Apache/SSL/Perl/PHP + LDAP
Hi All, I have searched all over the web for an answer to this, but I can't seem to find one :( I have a custom Apache installation with mod_ssl, mod_perl mod_php and Chili!Soft's mod_casp. When I originally compiled this, I didn't need LDAP support from php, so it wasn't compiled into it. Now I need LDAP support, I have tried re-compiling and am having problems. When I compile with --with-ldap everytime I start Apache, it fails and reports this error in error_log : Syntax error on line 1158 of /usr/local/apache/conf/httpd.conf: Invalid command 'SSLEngine', perhaps mis-spelled or defined by a module not included in the server configuration If I compile without --with-ldap then Apache works with no problems. Does anyone have an idea what I am doing wrong? Is this a common problem? Does anyone know what I can do to fix it? I have tried using PHP 4.2.0, but this produces the same problem... I have included my compile options below : OpenSSL (v 0.9.6b) # cd /usr/src/openssl-0.9.6b/ # sh config no-idea no-threads -fPIC # make # make test mod_ssl (v2.8.5-1.3.22) # cd ../mod_ssl-2.8.5-1.3.22/ # ./configure --with-apache=/usr/src/apache_1.3.22 mod_perl (v1.26) # cd ../mod_perl-1.26/ # perl Makefile.PL \ EVERYTHING=1 \ APACHE_SRC=../apache_1.3.22/src \ USE_APACI=1 \ PREP_HTTPD=1 \ DO_HTTPD=1 Apache (v1.3.22) # cd ../apache_1.3.22/ # SSL_BASE=/usr/src/openssl-0.9.6b \ ./configure \ --prefix=/usr/local/apache/ \ --enable-module=env \ --enable-module=setenvif \ --enable-module=mime \ --enable-module=mime_magic \ --enable-module=negotiation \ --enable-module=alias \ --enable-module=userdir \ --enable-module=dir \ --enable-module=autoindex \ --enable-module=access \ --enable-module=auth \ --enable-module=asis \ --enable-module=include \ --enable-module=cgi \ --enable-module=actions \ --enable-module=status \ --enable-module=info \ --enable-module=log_config \ --enable-module=imap \ --activate-module=src/modules/perl/libperl.a \ --add-module=mod_frontpage.c \ --enable-module=ssl \ --enable-shared=max \ --disable-shared=perl # make # make certificate # make install PHP # cd php # ./configure \ --with-apxs=/usr/local/apache/bin/apxs \ --with-mysql=/usr/local/mysql --with-ldap # make # make install # cp php.ini-dist /usr/local/lib/php.ini -- Thanks Andrew McCall Internet System Administrator I.C.T. Division Oldham MBC Civic Centre West Street Oldham OL1 1UU Tel : 0161 911 3990 Fax : 0161 911 3998 Email : [EMAIL PROTECTED] ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.oldham.gov.uk ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting page with fopen
At 25.04.2002 11:01, you wrote: Google is probably trying to send you a cookie in which case you cannot use fopen. You need to use curl or snoopy(?). Thanx, that could be the problem. Unfortunatly, curl is not compiled in my php-version, and what is snoopy?! ;-) Any other ideas/examples? Martin snoopy is a class which lets you fetch pages from the web, like you want to do. It supports cookies,https and some other stuff useful for fetching pages from the web. Look at sourceforge to get the latest release. This is one of my favours ;-) Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Predefined variables in PHP 4.2 vs. older version
http://www.php.net/manual/en/language.variables.predefined.php says: -- In PHP 4.2.0 and later, the default set of predefined variables which are available in the global scope has changed. Individual input and server variables are by default no longer placed directly into the global scope; rather, they are placed into the following superglobal arrays. You can still force the old behaviour by setting register_globals to 'On' in your php.ini file. -- Changing php.ini is not an option in most virtual servers. Is there a way to reliably detect PHP version and have $PHP_SELF replaced with $_SERVER['PHP_SELF'] when executed in 4.2 or newer? This way I would avoid putting out separate versions for PHP 4.2 or newer. Thanks, Pekka http://photography-on-the.net/ee/ - Pekka Saarinen http://photography-on-the.net -
RE: [PHP] Parse Error - Help? (AGAIN)
-Original Message- From: Jason Soza [mailto:[EMAIL PROTECTED]] Sent: 25 April 2002 05:06 Yike, now I wish I hadn't found it: [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Wrong datatype for second argument in call to in_array in beta_up.asp on line 61 57 function ext_valid ($filename) { 58 59 $extget = substr( strrchr($filename, .), 1); 60 61 $found = in_array($extget, $extval); 62 63 if ( $found ) { 64echo pfont color='red'center 65 . $message[invext]./font/center/p; 66 67$rc = 2; 68 } 69 } $extval is undefined on line 61 -- it's neither a parameter to the function nor a variable defined in the function. If you are intending to refer to the $extval defined in the global scope, you need to global it in the function: 57 function ext_valid ($filename) { 58 59 global $extval; etc. [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Undefined variable: upload_path in beta_up.php on line 73 Same. [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Undefined variable: timestamp in beta_up.php on line 73 Same. ... and, I'd guess, same for most of the others. Try globalling all the global variables you're using in functions, or passing them as parameters, and then try again. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Predefined variables in PHP 4.2 vs. older version
-Original Message- From: Pekka Saarinen [mailto:[EMAIL PROTECTED]] Sent: 25 April 2002 11:05 Is there a way to reliably detect PHP version and have $PHP_SELF replaced with $_SERVER['PHP_SELF'] when executed in 4.2 or newer? What about: if (isset($_SERVER)) $PHP_SELF = $_SERVER['PHP_SELF']; Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sorry, this is relate to subscription problem but cant solve it
Hello, sorry this off-topic msg but I don't know how to solve subscription problem to this list. Due yahoo email changes (no more pop services), I am trying to subscribe this list using alternate email address ([EMAIL PROTECTED]) but receive = Hi. This is the qmail-send program at pb1.pair.com. I'm afraid I wasn't able to deliver your message to the following addresses. This is a permanent error; I've given up. Sorry it didn't work out. [EMAIL PROTECTED]: ezmlm-manage: fatal: I don't accept messages at this address (inlocal and/or inhost don't match) (#5.1.1) = Does anybody know the reason for this one? Thanks Mig (please cc to [EMAIL PROTECTED] ) ___ Yahoo! Empregos O trabalho dos seus sonhos pode estar aqui. Cadastre-se hoje mesmo no Yahoo! Empregos e tenha acesso a milhares de vagas abertas! http://br.empregos.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Displaying dates
How can i display a dynamic page showing last month and next month and the month before eg this moth is ?php echo date(j-M-Y H:i); ? how do i add 1 to the month or -1 to the month? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: searching terms non adjacent
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... What's the best programming method to use to search terms that are non adjacent? What exactly do you mean? Are you looking at a SQL query, or... -- 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] Need help with File Upload
hi there, i´m sorry to post that stupid message, but i really need help in finding the solution to a maybe small problem. I´m trying to do a simple file upload (jpeg) with the copy function. the destination directory is set to chmod 0777, the files are copied to this directory (with the correct extension .jpg), but if i try to open them, the files seem to be corrupt. (the filesize seems to be o.k.). i tried several upload-scripts to test the situation, but the result is everytime the same. on my test-server, i´m running Yellow Dog Linux (PPC) with PHP4.0.4pl1. I tried the uploads from different browsers. Can anybody pls help me find the bug ?? thanx best regards, walter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Need help with File Upload
have you included the MAX_FILE_SIZE hidden field? If yes try increasng the value to above the image size Walter Enzenhofer [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... hi there, i´m sorry to post that stupid message, but i really need help in finding the solution to a maybe small problem. I´m trying to do a simple file upload (jpeg) with the copy function. the destination directory is set to chmod 0777, the files are copied to this directory (with the correct extension .jpg), but if i try to open them, the files seem to be corrupt. (the filesize seems to be o.k.). i tried several upload-scripts to test the situation, but the result is everytime the same. on my test-server, i´m running Yellow Dog Linux (PPC) with PHP4.0.4pl1. I tried the uploads from different browsers. Can anybody pls help me find the bug ?? thanx best regards, walter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session.save_path in php.ini
Hi, Having some issues with the session.save_path value in php.ini Whatever I change this value to it always ends up trying to save the temporary session info in /tmp (the default setting in php.ini). I can overide the value by setting a new path in the actual php script using session_save_path(my/path/here) but if I don't specify a path like this it always attempts to save in /tmp (c:\tmp\) even though the value in the php.ini file says otherwise Why is this happening ? HELP! Cheers. Tim Loram LaTiS Centre University of Exeter Queens Building Queens Drive Exeter EX4 4QH Tel: (01392) 263721 http://latis.ex.ac.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Displaying dates
I strongly recommend reading the date section of the manual... it takes all of 5 minutes, and you would have come across strtodate(): http://www.php.net/manual/en/function.strtotime.php ... which can accept almost any English date/time phrase (like next month), and convert it to a Unix time stamp... combined with date()'s ability to accept a given timestamp (as well as the current time), you get exactly what you want in three lines :) ? $today = date(j-M-Y H:i); $next_month = date(j-M-Y H:i,strtotime(next month)); $last_month = date(j-M-Y H:i,strtotime(last month)); echo Last Month: $last_month BR; echo Today: $today BR; echo Next Month: $next_month BR; ? It gets a little more complex when you're not dealing with the current server time I think... but that wasn't your question. Justin French Creative Director http://Indent.com.au on 25/04/02 8:46 PM, Craig ([EMAIL PROTECTED]) wrote: How can i display a dynamic page showing last month and next month and the month before eg this moth is ?php echo date(j-M-Y H:i); ? how do i add 1 to the month or -1 to the month? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session.save_path in php.ini
Which php.ini file u r changing? Are u refering php.ini which is in C:\Windows directory? - Original Message - From: Tim Loram [EMAIL PROTECTED] Date: Thursday, April 25, 2002 4:56 pm Subject: [PHP] Session.save_path in php.ini Hi, Having some issues with the session.save_path value in php.ini Whatever I change this value to it always ends up trying to save the temporary session info in /tmp (the default setting in php.ini). I can overide the value by setting a new path in the actual php script using session_save_path(my/path/here) but if I don't specify a path like this it always attempts to save in /tmp (c:\tmp\) even though the value in the php.ini file says otherwise Why is this happening ? HELP! Cheers. Tim Loram LaTiS Centre University of Exeter Queens Building Queens Drive Exeter EX4 4QH Tel: (01392) 263721 http://latis.ex.ac.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php **Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Displaying dates
At 25.04.2002 11:46, you wrote: How can i display a dynamic page showing last month and next month and the month before eg this moth is ?php echo date(j-M-Y H:i); ? how do i add 1 to the month or -1 to the month? Several methods mktime() where you put last month(s) via (date(m) -1) getting the actual day of the month, calculating its seconds +1 substracting this from the actual time(). Vice versa for adding one month. but I think mktime makes it easier. Any other suggestions ? Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Displaying dates
[EMAIL PROTECTED] (Craig) wrote: How can i display a dynamic page showing last month and next month and the month before eg this moth is ?php echo date(j-M-Y H:i); ? how do i add 1 to the month or -1 to the month? last month: date(j-M-Y H:i, mktime(0,0,0,date(m)-1, date(d), date(Y))); next month: date(j-M-Y H:i, mktime(0,0,0,date(m)+1, date(d), date(Y))); -- Henrik Hansen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] External interaction with php app
I need an external polling application that needs to feed data into a database. The database interface is web driven through php. The problem with php is that it cannot spawn itself to multiple threads - this is a requirement of my poller to reduce the poll time. Perl works perfectly for this, but I do not want to re-invent all database abstraction in perl. So is it practical, secure, the right thing to have the poller in perl posting XML data to a php web page which then feeds data into the database? Any other suggestions? Please copy my e-mail too. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Won't save session ids?
Hi people, I have a problem with my PHP scripts. I hope someone can help me? I run PHP 4.0.6, Redhat 7.1 When i tries to set a session and then redirect to the next page, the sessions is empty? Someone know how to solve this problem? The script looks like this: session_start(); session_register(accountsession); session_register(accountemail); $HTTP_SESSION_VARS[accountsession] = $session; $HTTP_SESSION_VARS[accountemail] = $email; header(Location: ./main.php); //The session and email variabel is from a output from a mysql query!! And this works fine! The mainpage tries to get the sessions. session_start(); echo Email:.$HTTP_SESSION_VARS[accountemail].br.$HTTP_SESSION_VARS[accountsession]; But i just get a Email: without any content? Please help me? Someone know whats wrong? Best Regards, Johan Holst Nielsen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SSL_SESSION_ID detecting client renegotiate
Hello, I am considering using SSL_SESSION_IDs as part of my authentication/session management scheme. (Using Apache, mod_ssl, PHP 4.1.2) However, the fact that for example Internet Explorer forces renogiate of the SSL session (every 2 minutes) causes problems to the session management. Is there any way to know (interact with apache mod_ssl) when the renogiation is done. By example, the goal would be to know within PHP if the newly renegotiated SSL_SESSION_ID 123671253761253765123765312 is continuation to the previous SSL_SESSION_ID for the logged-in user or to notice if the SSL session is comptely fresh and new and does not have anything to do with previous session. If I understood the SSL documentation correctly, this should be possible as I understood that there is some inheritance in the renogotiation. Or am I completely lost here and the SSL session is built from scratch upon renogitation. If this little :) problem could be avoided, this would provide a pretty trustable add-on to authentication and session management. Any input? -- Jussi Kallioniemi [EMAIL PROTECTED] http://www.cyberian.org/ PGP http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0xF462C77A -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: -- I N C L U D E -- O R -- F O P E N -- ?
To: Philip, Ninety-Nine Ways To Die and Maxim, Thank you very much guys for all your nice explanations on the INCLUDE vs FOPEN stuff. I'll let you know how I done with this. Should be in a week or so.;-) Again... Thanks! Long live this No Gates community! Best regards, Yves -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions and Load Balancing
Dear group, My hosting provider is using Load Balancing (4 servers, Apache 1.13.20 / PHP 4.1.2). I started the developing of a site with the idea of using sessions. Can I continue using sessions when I point the session_save_path to a directory on my domein? Or do I run into problems? I thought that the SID returned to every browser (client), so when I store the session on my domein, every server can find the ID, right? Please respond to my emailaddress directly ([EMAIL PROTECTED]). Thanks in advance! Maurice Uijlenbroek
Re: [PHP] Displaying dates
that wasn't the question you asked :) there's been some nice answers for +/- 1 month already, so i won't bother echoing it again :) justin french on 25/04/02 10:21 PM, Craig Keightley ([EMAIL PROTECTED]) wrote: thanks, i already looked into this but does it also work with month -2, -3 etc? - Original Message - From: Justin French [EMAIL PROTECTED] To: Craig [EMAIL PROTECTED] Sent: Thursday, April 25, 2002 1:07 PM Subject: Re: [PHP] Displaying dates I strongly recommend reading the date section of the manual... it takes all of 5 minutes, and you would have come across strtodate(): http://www.php.net/manual/en/function.strtotime.php ... which can accept almost any English date/time phrase (like next month), and convert it to a Unix time stamp... combined with date()'s ability to accept a given timestamp (as well as the current time), you get exactly what you want in three lines :) ? $today = date(j-M-Y H:i); $next_month = date(j-M-Y H:i,strtotime(next month)); $last_month = date(j-M-Y H:i,strtotime(last month)); echo Last Month: $last_month BR; echo Today: $today BR; echo Next Month: $next_month BR; ? It gets a little more complex when you're not dealing with the current server time I think... but that wasn't your question. Justin French Creative Director http://Indent.com.au on 25/04/02 8:46 PM, Craig ([EMAIL PROTECTED]) wrote: How can i display a dynamic page showing last month and next month and the month before eg this moth is ?php echo date(j-M-Y H:i); ? how do i add 1 to the month or -1 to the month? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Newbie Book Database Question
Howdy, I have been developing with ColdFusion for nearly five years and want to learn PHP. For someone who has never done anything with PHP before, what *one* book would you recommend as a good primer to get started learning PHP? Also, do most PHPers use MySQL as your database when building dynamic web sites, or do you prefer alternative databases like Postgres? From what I have seen from afar, MySQL seems to be the dominant one, but I have read that Postgres is more robust. Thanks in advance and cheers from San Antonio, Chris Montgomery[EMAIL PROTECTED] Airtight Web Services http://www.airtightweb.com Web Development, Web Project Management, Software Sales 210-490-3249/888-745-7603 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie Book Database Question
Try PHP and MySQL Web Development, by Luke Welling and Laura Thompson; only one thing, maybe you'll have troubles with the form variables, put this code at the beginning of all book examples foreach (array_merge($_POST,$_GET) as $key=$val) { global $$key; $$key=$val; } Code made by Alok K. Dhir ;-) At 08:02 25/04/2002 -0500, you wrote: Howdy, I have been developing with ColdFusion for nearly five years and want to learn PHP. For someone who has never done anything with PHP before, what *one* book would you recommend as a good primer to get started learning PHP? Also, do most PHPers use MySQL as your database when building dynamic web sites, or do you prefer alternative databases like Postgres? From what I have seen from afar, MySQL seems to be the dominant one, but I have read that Postgres is more robust. Thanks in advance and cheers from San Antonio, Chris Montgomery[EMAIL PROTECTED] Airtight Web Services http://www.airtightweb.com Web Development, Web Project Management, Software Sales 210-490-3249/888-745-7603 -- 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] Newbie Book Database Question
Professional PHP Programming from WROX publishing is a good book too. I use php and MySQL. -Steve. -Original Message- From: Chris Montgomery [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 9:02 AM To: [EMAIL PROTECTED] Subject: [PHP] Newbie Book Database Question Howdy, I have been developing with ColdFusion for nearly five years and want to learn PHP. For someone who has never done anything with PHP before, what *one* book would you recommend as a good primer to get started learning PHP? Also, do most PHPers use MySQL as your database when building dynamic web sites, or do you prefer alternative databases like Postgres? From what I have seen from afar, MySQL seems to be the dominant one, but I have read that Postgres is more robust. Thanks in advance and cheers from San Antonio, Chris Montgomery[EMAIL PROTECTED] Airtight Web Services http://www.airtightweb.com Web Development, Web Project Management, Software Sales 210-490-3249/888-745-7603 -- 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] Newbie Book Database Question
I recommend The Manual. www.php.net/manual/en/ Honestly it's the best book you can read in the beginning. There are tons of examples and comments and you'll know exactly what's going on. No, you don't have to read every function, but at least read the first page for each category, that'll give you an idea of where to look when you have questions. After you've read that, then start on some tutorials. I've never touched a book for PHP. You don't need it with all of the free resources online. As for databases, yeah, MySQL is generally more popular because it's easy to use and is available on almost any platform. I've never seen a windows binary for PGSQL, although you can compile it yourself. PG is more robust and implements more features, but for most websites, these are features you'll never need. My $0.02 ---John Holmes... - Original Message - From: Chris Montgomery [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 25, 2002 9:02 AM Subject: [PHP] Newbie Book Database Question Howdy, I have been developing with ColdFusion for nearly five years and want to learn PHP. For someone who has never done anything with PHP before, what *one* book would you recommend as a good primer to get started learning PHP? Also, do most PHPers use MySQL as your database when building dynamic web sites, or do you prefer alternative databases like Postgres? From what I have seen from afar, MySQL seems to be the dominant one, but I have read that Postgres is more robust. Thanks in advance and cheers from San Antonio, Chris Montgomery[EMAIL PROTECTED] Airtight Web Services http://www.airtightweb.com Web Development, Web Project Management, Software Sales 210-490-3249/888-745-7603 -- 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] Newbie Book Database Question
I started with PHP bible by Converse/Park on IDGbooks. Never needed anything more; used the manual and the web afterwards; for reference and tips. Another nice book is Wrox' professional PHP programming. All the best, Eivind -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error - Help? (AGAIN)
I don't have your original code (which, btw, you shoudn't ever post that much code without explicitly saying what the error was, what line it was one, highlighting that line, and saying what you've done so far), but these errors are caused by not giving a default value to a variable, basically. If you have something like this: if($id = 5) { //whatever } and $id hasn't been assigned a value, then you'll get that warning. In previous versions of PHP, you wouldn't get the warning, you'd just get FALSE. So, before you test the value of a variable, or echo the value out, make sure you've assigned it something. if(!isset($id)) { $id = 0; } Hopefully that's not too confusingit's hard to explain. ---John Holmes... - Original Message - From: Jason Soza [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 25, 2002 12:06 AM Subject: RE: [PHP] Parse Error - Help? (AGAIN) Yike, now I wish I hadn't found it: [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Wrong datatype for second argument in call to in_array in beta_up.asp on line 61 [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Undefined variable: upload_path in beta_up.php on line 73 [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Undefined variable: timestamp in beta_up.php on line 73 [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Undefined variable: id in beta_up.php on line 73 [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Undefined variable: HTTP_POST_FILES in beta_up.php on line 78 [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Undefined variable: upload_path in beta_up.php on line 79 [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Undefined variable: timestamp in beta_up.php on line 79 [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Undefined variable: id in beta_up.php on line 79 [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Undefined variable: message in beta_up.php on line 83 [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Undefined variable: filename3 in beta_up.php on line 177 [Wed Apr 24 19:42:18 2002] [error] PHP Warning: Undefined variable: filename4 in beta_up.php on line 178 What more do I have to do to define variables? I name what each variable is with normal conventions - what would cause the above error messages? I think the one that's most disturbing is the in_array() warning, need that to work! Again, any help would be greatly appreciated! Jason -Original Message- From: Jason Soza [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 7:56 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Parse Error - Help? Found it - just added another curly brace to the end of the code and it worked, so I searched up from there and found: function ext_valid ($filename) { $extget = substr( strrchr($filename, .), 1); $found = in_array($extget, $extval); if ( $found ) { echo pfont color='red'center . $message[invext]./font/center/p; $rc = 2; } This function should have another curly brace at the end. Aha! Thanks for your help! Jason -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 7:22 PM To: Jason Soza; [EMAIL PROTECTED] Subject: Re: [PHP] Parse Error - Help? Copy and paste the parse error into your e-mail. Also, try placing another } at the end of the code. If you're missing a closing bracket somewhere, that will take care of it. Tyler Longren Captain Jack Communications www.captainjack.com [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] what to do when i want to stop ob_gzhandler()
HI all if i automatically start ob_start('ob_gzhandler') but need to disable it afterwards, because i'm sending to a java applet that crashes when receiving gz content. how do i do it? if i call ob_end_clean apache goes amok and dows strange things ( allocating lots of memory and stop working for a few seconds ) is there another way to return to normal output? Sebastian
[PHP] basename unix/windows
I'm running php on linux and wish to use basename() to get the file name from a windows path. basename() on our linux/php box can't seem to cope with the use of backslash (\) in the Windows paths I'm feeding it. In other words: basename(/usr/blah/doh/yuck/wow/abigfile.html) resolves to : abigfile.html but basename(adirectory\onawindowsbox\abigfile.html) does not resovle to abigfile.html. Does anybody have a workaround for this? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] basename unix/windows
ROBERT MCPEAK wrote: basename(/usr/blah/doh/yuck/wow/abigfile.html) resolves to : abigfile.html but basename(adirectory\onawindowsbox\abigfile.html) does not resovle to abigfile.html. Does anybody have a workaround for this? What about str_replace()? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] basename unix/windows
Replace the \ with / using str_replace or some such function before using basename. Windows will handle either kind of path. Linux does not know the \ as a file path separator. It only knows / Matt Friedman Web Applications Developer www.SpryNewMedia.com -Original Message- From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]] Sent: Thursday April 25, 2002 9:41 AM To: [EMAIL PROTECTED] Subject: [PHP] basename unix/windows I'm running php on linux and wish to use basename() to get the file name from a windows path. basename() on our linux/php box can't seem to cope with the use of backslash (\) in the Windows paths I'm feeding it. In other words: basename(/usr/blah/doh/yuck/wow/abigfile.html) resolves to : abigfile.html but basename(adirectory\onawindowsbox\abigfile.html) does not resovle to abigfile.html. Does anybody have a workaround for this? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] basename unix/windows
ROBERT MCPEAK [EMAIL PROTECTED] wrote: In other words: basename(/usr/blah/doh/yuck/wow/abigfile.html) resolves to : abigfile.html but basename(adirectory\onawindowsbox\abigfile.html) does not resovle to abigfile.html. Does anybody have a workaround for this? Convert all \ to / before calling basename. -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie Book Database Question
On Thursday, April 25, 2002, at 09:20 AM, David Garcia Aristegui wrote: Try PHP and MySQL Web Development, by Luke Welling and Laura Thompson; only one thing, maybe you'll have troubles with the form variables, put this code at the beginning of all book examples foreach (array_merge($_POST,$_GET) as $key=$val) { global $$key; $$key=$val; } Code made by Alok K. Dhir ;-) The above is a creative way around using superglobals, but I recommend that you start learning PHP using them. An excellent, if somewhat easy, challenge will be to take any of the PHP books (every single one I've seen has used the deprecated register_globals=on method), use it to learn PHP, and simultaneously use the appropriate superglobal prefix for the variables. Thus, when the PHP book discusses making a GET method form or including vars on the querystring in a href attribute, make sure that in the receiving script you use $_GET['varname'] instead of $varname (as the book will no doubt use). Same for $_COOKIE, $_SERVER, $_SESSION, $_SERVER (read the man page for this one), and $_POST. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie Book Database Question
I have done php only and not cold fusion. Just out of curiosity, why are you trying to do php? Isn't Coldfusion good enough? Denis - Original Message - From: David Garcia Aristegui [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 25, 2002 9:20 PM Subject: Re: [PHP] Newbie Book Database Question Try PHP and MySQL Web Development, by Luke Welling and Laura Thompson; only one thing, maybe you'll have troubles with the form variables, put this code at the beginning of all book examples foreach (array_merge($_POST,$_GET) as $key=$val) { global $$key; $$key=$val; } Code made by Alok K. Dhir ;-) At 08:02 25/04/2002 -0500, you wrote: Howdy, I have been developing with ColdFusion for nearly five years and want to learn PHP. For someone who has never done anything with PHP before, what *one* book would you recommend as a good primer to get started learning PHP? Also, do most PHPers use MySQL as your database when building dynamic web sites, or do you prefer alternative databases like Postgres? From what I have seen from afar, MySQL seems to be the dominant one, but I have read that Postgres is more robust. Thanks in advance and cheers from San Antonio, Chris Montgomery[EMAIL PROTECTED] Airtight Web Services http://www.airtightweb.com Web Development, Web Project Management, Software Sales 210-490-3249/888-745-7603 -- 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] basename unix/windows
On Thursday, April 25, 2002, at 09:54 AM, Matt Friedman wrote: Replace the \ with / using str_replace or some such function before using basename. Windows will handle either kind of path. Linux does not know the \ as a file path separator. It only knows / Just make sure that you never need to use this particular code on a Unix-style path with an escaped character or space, such as this: /home/eprice/includes/php\ scripts/script.php Of course, it's very rare to see the above, but should be a consideration. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sorry, this is relate to subscription problem but cant solve it
On Thursday 25 April 2002 18:13, M VM wrote: Hello, sorry this off-topic msg but I don't know how to solve subscription problem to this list. Due yahoo email changes (no more pop services), I am trying to subscribe this list using alternate email address ([EMAIL PROTECTED]) but receive = Hi. This is the qmail-send program at pb1.pair.com. I'm afraid I wasn't able to deliver your message to the following addresses. This is a permanent error; I've given up. Sorry it didn't work out. [EMAIL PROTECTED]: ezmlm-manage: fatal: I don't accept messages at this address (inlocal and/or inhost don't match) (#5.1.1) = Does anybody know the reason for this one? You're trying to post to the list before subscribing. Can I ask how did you originally subscribe to the list when using yahoo? Just follow the same procedure. www.php.net if you've forgotten. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unlucky Situation Involving CURL
On Thursday 25 April 2002 17:23, Jason wrote: I'm developing a website that has the unlucky situation of being situated on a host that does not have CURL installed on it. [snip] Does anybody know of a way of doing this without using CURL? Try snoopy. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Clear the laundromat!! This whirl-o-matic just had a nuclear meltdown!! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Newbie Book Database Question
First, I want to thank everyone for their quick responses. Good list here. Second, yes ColdFusion is good enough. I am just interested in broadening my skill set and learning something new. :) Chris Montgomery[EMAIL PROTECTED] Airtight Web Services http://www.airtightweb.com Web Development, Web Project Management, Software Sales 210-490-3249/888-745-7603 -Original Message- From: Denis L. Menezes [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 9:02 AM To: [EMAIL PROTECTED]; David Garcia Aristegui Subject: Re: [PHP] Newbie Book Database Question I have done php only and not cold fusion. Just out of curiosity, why are you trying to do php? Isn't Coldfusion good enough? Denis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] New Variables
Hi, is there somewhere a spot where the rational for the new variables of PHP4.2 is described? I can not figure out yet the why of all the trouble the developers took - obviously they would not have done it if there was'nt an urgent reason for it. Thanks Nico -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New Variables
On Thursday, April 25, 2002, at 10:06 AM, Nico van der Dussen wrote: is there somewhere a spot where the rational for the new variables of PHP4.2 is described? I can not figure out yet the why of all the trouble the developers took - obviously they would not have done it if there was'nt an urgent reason for it. As Kirk Johnson told me when I asked the same question a few months back: Give this a read first, then come back and ask if you still have questions. http://www.securereality.com.au/studyinscarlet.txt Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New Variables
You are better off reading the Security chapter in the PHP documentation. That study-in-scarlet document is right on some points, but ill-informed and misleading on others. -Rasmus On Thu, 25 Apr 2002, Erik Price wrote: On Thursday, April 25, 2002, at 10:06 AM, Nico van der Dussen wrote: is there somewhere a spot where the rational for the new variables of PHP4.2 is described? I can not figure out yet the why of all the trouble the developers took - obviously they would not have done it if there was'nt an urgent reason for it. As Kirk Johnson told me when I asked the same question a few months back: Give this a read first, then come back and ask if you still have questions. http://www.securereality.com.au/studyinscarlet.txt Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [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] using transparent images in a style
Hi. I'm trying to make lines based on dots and dashes and I need the colors in the middle to be transparent. This is all done within a class, that's why there are $this-s all over. $t = ImageColorAllocate($this-im,1,1,1); $this-trans = ImageColorTransparent($this-im,$t); $this-style = array($this-color,$this-trans,$this-color,$this-trans,$this-trans,$this -trans,$this-trans,$this-trans); ImageSetStyle($this-im, $this-style); //these are all defined and it is drawing the line, just not doing the transparencies ImageLine($this-im,($widthPoint+(($indexstart)*$this-xscale)),$starty,($wi dthPoint+(($indexend)*$this-xscale)), $endy, IMG_COLOR_STYLED); I got this code out of the manual and I also tried using IMG_COLOR_TRANSPARENT instead of $this-trans in the style array. Not only do I not get any form of a dotted or dashed line (I added all those transparents so I could see openings in the line) but the line color changed from a tealish green to a sick green. I'm using ImageCreate instead of ImageCreateTrueColor. Has anyone run into similar problems? Thanks! -Natalie Natalie S. Leotta Information Management Services, Inc. (301) 680-9770 [EMAIL PROTECTED]
[PHP] libxslt exslt documentation
hi, I would like to know if there is a documentation on the use of exslt/domxslt functions. i am using php 4.2.0 . alex __ Do You Yahoo!? Yahoo! Games - play chess, backgammon, pool and more http://games.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Structuring script execution
Hi, A page is loaded from two different places. 1st call: a href=cribsheet.html?action=* 2nd call: a href=cribsheet.html?action=*download=txt Inside cribsheet.html: if ( $action == '*') { if ( isset( $download ) { downloadFile( $download ); } echo 'html'; echo 'head'; ... echo '/body '; echo '/html'; } function downloadFile( $type ) { header ... $fp = fopen( $txtfile, r ); fpassthru( $fp ); exit; /* need exit else the rest of the script is output as well */ } On the first call everything is fine. On the 2nd call (of course) the script stops execution. even sending header( Location: otherfile.html) won't work 'cos I get a msg saying headers already sent. I *think* my problem is working out how to structure which file contains what but for the life of me I can't figure it out - just go round in circles. Donna -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Transforming data problem
Hi, All! I have the following problem. Let's suppose I have the following tab-delimited data file: data2.txt: === user1web12002-03-25 14:43:17 user1web22002-03-25 14:43:20 user2web22002-03-25 14:50:02 user2web22002-03-25 14:55:00 user1web12002-03-25 14:45:00 user3web22002-03-26 16:20:00 user3web32002-03-26 16:21:17 user4web12002-03-26 18:45:23 user4web32002-03-26 18:50:00 user4web12002-03-26 19:01:00 user4web22002-03-26 19:20:20 Now... I would like to get a matrix where in cells are counts of users which has been on the both websites. Like this: web1web2web3 web1421 web2242 web3122 That means: 4 diferent users were on web1 2 users were on web1 AND web2,... and so on. Now... how to do that? There are actually three problems, which are described in http://www.ljudmila.org/matej/count/pajek.phps... the first one is solved, the second and third not... This can be found as second problem. Can anyone help me? Thanks bye, Matej -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session Registering
Im using session in my form, there are 6 pages to the form, It all works fine, until You work your way back through the form, to ammend the filled in details. e.g - If I go to page 1, and fill out my name, and post to the next page, heres the code Im using: PHP: form method=post action=page2.php input type=text name=firstname value=?=$_SESSION['firstname'];? /form Its registered on the top of page2 with the following code: PHP: session_start(); $_SESSION['firstname']=$_POST['firstname']; That works fine, I have a link on all my pages that links back to the previous page e.g a href=page1.phpGo Back/a If I go back to the first page, from the second page the fields are populated fine, but If i continue onto page3.php then go back page1.php is no longer populated!! Any Ideas why this is happening?? and If so a remedy, Is it a code issue or a conf Issue?? Thanks C -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions not staying a session...
I am storing session information by using $_SESSION[privs] and it works for the first screen but when I click on the next link it doesn't seem to carry over. Do I need to declare session start with this method? Do I need to make it global? Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sessions not staying a session...
You should use session_start(); on every page that u want to pass session information.. Craig Jeff Lewis [EMAIL PROTECTED] wrote in message 00d601c1ec72$072a63d0$76a1a8c0@LEWISJCIT">news:00d601c1ec72$072a63d0$76a1a8c0@LEWISJCIT... I am storing session information by using $_SESSION[privs] and it works for the first screen but when I click on the next link it doesn't seem to carry over. Do I need to declare session start with this method? Do I need to make it global? Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Sessions not staying a session...
Curious, does anyone know if the $_SESSION[privs] technique bypasses important session management features implemented in session_register(variable) ?? Warren Vail Tools, Metrics Quality Processes (415) 667-7814 Pager (877) 774-9891 215 Fremont 02-658 -Original Message- From: Craig Donnelly [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 9:05 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: Sessions not staying a session... You should use session_start(); on every page that u want to pass session information.. Craig Jeff Lewis [EMAIL PROTECTED] wrote in message 00d601c1ec72$072a63d0$76a1a8c0@LEWISJCIT">news:00d601c1ec72$072a63d0$76a1a8c0@LEWISJCIT... I am storing session information by using $_SESSION[privs] and it works for the first screen but when I click on the next link it doesn't seem to carry over. Do I need to declare session start with this method? Do I need to make it global? Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions and Load Balancing
We use sessions on one of our extremely large (read: may load balanced servers). Our solution is to store session data in the database. See the following: http://www.php.net/session-set-save-handler David Piasecki -Original Message- From: Uijlenbroek, Maurice [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 5:43 AM To: '[EMAIL PROTECTED]' Subject: [PHP] Sessions and Load Balancing Dear group, My hosting provider is using Load Balancing (4 servers, Apache 1.13.20 / PHP 4.1.2). I started the developing of a site with the idea of using sessions. Can I continue using sessions when I point the session_save_path to a directory on my domein? Or do I run into problems? I thought that the SID returned to every browser (client), so when I store the session on my domein, every server can find the ID, right? Please respond to my emailaddress directly ([EMAIL PROTECTED]). Thanks in advance! Maurice Uijlenbroek -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Session Registering
I think you have to populate the data in your pages not to wait the browser to do the job. Cause sometimes work and some time not. Craig Donnelly wrote: Im using session in my form, there are 6 pages to the form, It all works fine, until You work your way back through the form, to ammend the filled in details. e.g - If I go to page 1, and fill out my name, and post to the next page, heres the code Im using: PHP: form method=post action=page2.php input type=text name=firstname value=?=$_SESSION['firstname'];? /form Its registered on the top of page2 with the following code: PHP: session_start(); $_SESSION['firstname']=$_POST['firstname']; That works fine, I have a link on all my pages that links back to the previous page e.g a href=page1.phpGo Back/a If I go back to the first page, from the second page the fields are populated fine, but If i continue onto page3.php then go back page1.php is no longer populated!! Any Ideas why this is happening?? and If so a remedy, Is it a code issue or a conf Issue?? Thanks C -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to make array_search start from 0?
Hi there, I am passing an array through the URL with a ',' inbetween: var=php,mysql,super Parsing is done with: explode (',',$var). This gives me an array starting with 0 Later on I have to search for lets say php with array_search. Unfortunatelly array_search requires an array starting with 1. So php is not found. Does anybody know a workaround for this? Thanx, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error - Help? (AGAIN)
Sorry for the length of the code, but I felt I described the problem, (parse error, last line) and if I hadn't posted the entire code I probably would've been asked to. This list can be a little confusing for a newbie: just a couple days ago I read someone saying too much information is better than not enough and now I'm getting that I posted too much. I'm still learning! :) What does the ! in if(!isset($id)) { $id = 0; } do? I think I get what this bit does in general: checks if $id has been assigned anything, if it's empty it gets assigned 0. Correct? Then I can use if($id) statements later on without having PHP return Undefined Variable errors. Right? Thanks for your help, I'll work on my PHP listetiquette. Jason Soza - Original Message - From: 1LT John W. Holmes [EMAIL PROTECTED] Date: Thursday, April 25, 2002 5:35 am Subject: Re: [PHP] Parse Error - Help? (AGAIN) I don't have your original code (which, btw, you shoudn't ever post that much code without explicitly saying what the error was, what line it was one, highlighting that line, and saying what you've done so far), but these errors are caused by not giving a default value to a variable, basically. If you have something like this: if($id = 5) { //whatever } and $id hasn't been assigned a value, then you'll get that warning. In previous versions of PHP, you wouldn't get the warning, you'd just get FALSE. So, before you test the value of a variable, or echo the value out, make sure you've assigned it something. if(!isset($id)) { $id = 0; } Hopefully that's not too confusingit's hard to explain. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] using transparent images in a style
More info in case this helps: I tried taking out the transparencies and changing the $this-trans to $this-black and I'm still getting a solid line of the wrong color green (the correct green is in a different place, so it's obvious this is wrong). Do you think that if I included the picture as a .bmp it would help? -Original Message- From: Leotta, Natalie (NCI/IMS) Sent: Thursday, April 25, 2002 10:41 AM To: [EMAIL PROTECTED] Subject: [PHP] using transparent images in a style Hi. I'm trying to make lines based on dots and dashes and I need the colors in the middle to be transparent. This is all done within a class, that's why there are $this-s all over. $t = ImageColorAllocate($this-im,1,1,1); $this-trans = ImageColorTransparent($this-im,$t); $this-style = array($this-color,$this-trans,$this-color,$this-trans,$this-trans,$this -trans,$this-trans,$this-trans); ImageSetStyle($this-im, $this-style); //these are all defined and it is drawing the line, just not doing the transparencies ImageLine($this-im,($widthPoint+(($indexstart)*$this-xscale)),$starty,($wi dthPoint+(($indexend)*$this-xscale)), $endy, IMG_COLOR_STYLED); I got this code out of the manual and I also tried using IMG_COLOR_TRANSPARENT instead of $this-trans in the style array. Not only do I not get any form of a dotted or dashed line (I added all those transparents so I could see openings in the line) but the line color changed from a tealish green to a sick green. I'm using ImageCreate instead of ImageCreateTrueColor. Has anyone run into similar problems? Thanks! -Natalie Natalie S. Leotta Information Management Services, Inc. (301) 680-9770 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to make array_search start from 0?
Just looking at the manual here and it explains quite specifically that array_search() is meant to be used with associative arrays, not indexed arrays. I think the best way to do what you want is to do is to set up a loop and test each index against eregi(); If true then you know your index. -Kevin - Original Message - From: andy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 25, 2002 10:30 AM Subject: [PHP] how to make array_search start from 0? Hi there, I am passing an array through the URL with a ',' inbetween: var=php,mysql,super Parsing is done with: explode (',',$var). This gives me an array starting with 0 Later on I have to search for lets say php with array_search. Unfortunatelly array_search requires an array starting with 1. So php is not found. Does anybody know a workaround for this? Thanx, Andy -- 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] Structuring script execution
On Thursday 25 April 2002 22:48, Donna Robinson wrote: On the first call everything is fine. On the 2nd call (of course) the script stops execution. even sending header( Location: otherfile.html) won't work 'cos I get a msg saying headers already sent. Read the manual entry for header(). Or search archives for headers already sent. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* I am not now, nor have I ever been, a member of the demigodic party. -- Dennis Ritchie */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Sessions not staying a session...
I was under the assumption that it did...I have aded session_start and it still doesn't work. Jeff - Original Message - From: Vail, Warren [EMAIL PROTECTED] To: 'Craig Donnelly' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, April 25, 2002 12:04 PM Subject: RE: [PHP] Re: Sessions not staying a session... Curious, does anyone know if the $_SESSION[privs] technique bypasses important session management features implemented in session_register(variable) ?? Warren Vail Tools, Metrics Quality Processes (415) 667-7814 Pager (877) 774-9891 215 Fremont 02-658 -Original Message- From: Craig Donnelly [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 9:05 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: Sessions not staying a session... You should use session_start(); on every page that u want to pass session information.. Craig Jeff Lewis [EMAIL PROTECTED] wrote in message 00d601c1ec72$072a63d0$76a1a8c0@LEWISJCIT">news:00d601c1ec72$072a63d0$76a1a8c0@LEWISJCIT... I am storing session information by using $_SESSION[privs] and it works for the first screen but when I click on the next link it doesn't seem to carry over. Do I need to declare session start with this method? Do I need to make it global? Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Parse Error - Help? (AGAIN)
What does the ! in if(!isset($id)) { $id = 0; } do? It checks for the false return. If isset($id) returns false then the 'if' statement with (!) returns you true, and, as you just guessed, it will assign a (0) to $id. this bit does in general: checks if $id has been assigned anything, if it's empty it gets assigned 0. Correct? Then I can use if($id) statements later on without having PHP return Undefined Variable errors. Right? To stop receiving the messages from undefined variables add this at top of your files: error_reporting(55); Thanks for your help, I'll work on my PHP listetiquette. Jason Soza Sincerely, Maxim Maletsky Founder, Chief Developer www.PHPBeginner.com // where PHP Begins - Original Message - From: 1LT John W. Holmes [EMAIL PROTECTED] Date: Thursday, April 25, 2002 5:35 am Subject: Re: [PHP] Parse Error - Help? (AGAIN) I don't have your original code (which, btw, you shoudn't ever post that much code without explicitly saying what the error was, what line it was one, highlighting that line, and saying what you've done so far), but these errors are caused by not giving a default value to a variable, basically. If you have something like this: if($id = 5) { //whatever } and $id hasn't been assigned a value, then you'll get that warning. In previous versions of PHP, you wouldn't get the warning, you'd just get FALSE. So, before you test the value of a variable, or echo the value out, make sure you've assigned it something. if(!isset($id)) { $id = 0; } Hopefully that's not too confusingit's hard to explain. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to make array_search start from 0?
If the key is 0, array_search will return 0, it does not start at 1. $arr = array('apple','banana','cranberry'); $key = array_search('apple', $arr); print $key; // 0 If 'apple' was not found, $key would then equal to boolean false. Be sure to use === false to check failure because 0 == false. For example: $fruit = array('apple','banana','cranberry'); $findme = 'apple'; if (($key = array_search($findme, $fruit)) !== false) { print Key ($key) was found from value $findme; } else { print Sorry, $findme was not found in array \$fruit; } Again, remember, 0 == false. == !=, === !==. So, 0 !== false. Wow that sounds confusing. :) Also consider the sexy array_keys() function. Regards, Philip Olson p.s. http://uk.php.net/manual/en/language.operators.comparison.php p.s.s. also take into account extra whitespace (trim), and potential issues with case sensitivity (strtolower). On Thu, 25 Apr 2002, andy wrote: Hi there, I am passing an array through the URL with a ',' inbetween: var=php,mysql,super Parsing is done with: explode (',',$var). This gives me an array starting with 0 Later on I have to search for lets say php with array_search. Unfortunatelly array_search requires an array starting with 1. So php is not found. Does anybody know a workaround for this? Thanx, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] how to make array_search start from 0?
-Original Message- From: Kevin Stone [mailto:[EMAIL PROTECTED]] Sent: 25 April 2002 18:02 Just looking at the manual here and it explains quite specifically that array_search() is meant to be used with associative arrays, not indexed arrays. No it doesn't. How on earth did you read that into it? Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Parse Error - Help? (AGAIN)
To stop receiving the messages from undefined variables add this at top of your files: error_reporting(55); Or better yet, keep as you're doing and develop with E_ALL and fix those E_NOTICE errors correctly! ;) Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Unexpected OOP behavior
I noticed a behavior of my PHP class (4.1.1) which I found very unexpected and also undocumented. I defined a class constructor, and this constructor was automatically called *again* on my instantiated object when the script ended! This runs counter to 1. what one would expect a constructor to do 2. what the PHP docs say, which is that any clean up of a class object must be handled explicitly Can anyone verify/explain this behavior? Thanks Rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error - Help? (AGAIN)
I'll second that one... always better to code with register_globals = Off and E_ALL reporting level IMHO. # Nathan - Original Message - From: Philip Olson [EMAIL PROTECTED] To: Maxim Maletsky (PHPBeginner.com) [EMAIL PROTECTED] To stop receiving the messages from undefined variables add this at top of your files: error_reporting(55); Or better yet, keep as you're doing and develop with E_ALL and fix those E_NOTICE errors correctly! ;) Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to make array_search start from 0?
On Friday 26 April 2002 00:30, andy wrote: Hi there, I am passing an array through the URL with a ',' inbetween: var=php,mysql,super Parsing is done with: explode (',',$var). This gives me an array starting with 0 Later on I have to search for lets say php with array_search. Unfortunatelly array_search requires an array starting with 1. So php is not found. Haven't used this function before, but where does it say anything about requiring an array starting with 1? Did you try it anyway? Does anybody know a workaround for this? You can do: $my_array = array_flip($my_array) $key = $my_array['search_item']; -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Conversion, fastidious Goddess, loves blood better than brick, and feasts most subtly on the human will. -- Virginia Woolf, Mrs. Dalloway */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to make array_search start from 0?
Doh! My apologies you're absolutely right. I just tested it. - $search = 'bar'; //$myarray = array ('hello' = 'world', 'language' = 'php', 'foo' = 'bar'); $myarray = array ('world', 'php', 'bar'); $result = array_search($search, $myarray); echo $result; - Using the associative array array_search() returns 'foo' and using the indexed array it returns '2'. So it works with both array types and does not require an array starting at index 1. Live and learn. :) -Kevin - Original Message - From: Ford, Mike [LSS] [EMAIL PROTECTED] To: 'Kevin Stone' [EMAIL PROTECTED]; PHP-general [EMAIL PROTECTED] Sent: Thursday, April 25, 2002 11:12 AM Subject: RE: [PHP] how to make array_search start from 0? -Original Message- From: Kevin Stone [mailto:[EMAIL PROTECTED]] Sent: 25 April 2002 18:02 Just looking at the manual here and it explains quite specifically that array_search() is meant to be used with associative arrays, not indexed arrays. No it doesn't. How on earth did you read that into it? Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error - Help? (AGAIN)
Yeah, I think I'd rather fix the errors rather than just not see them. I'd still know they were there and it'd bug me! Thanks everyone for your help! Jason Soza - Original Message - From: Nathan [EMAIL PROTECTED] Date: Thursday, April 25, 2002 9:14 am Subject: Re: [PHP] Parse Error - Help? (AGAIN) I'll second that one... always better to code with register_globals = Off and E_ALL reporting level IMHO. # Nathan - Original Message - From: Philip Olson [EMAIL PROTECTED] To: Maxim Maletsky (PHPBeginner.com) [EMAIL PROTECTED] To stop receiving the messages from undefined variables add this at top of your files: error_reporting(55); Or better yet, keep as you're doing and develop with E_ALL and fix those E_NOTICE errors correctly! ;) Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error - Help? (AGAIN)
I guess I missed the last line part, my bad. Yes, you've got the idea for isset(). ! means NOT. So isset($id) will check to see if $id is set, it doesn't care what the value is. !isset($id) will see if $id is NOT set. A variable can be set and have an empty value, or be false, null, etc. The idea behind undefined variable is that you must assign a default value to to the variable before you print it out or use it in a comparison. You can adjust your error_reporting() so you don't get these errors, but it's better to leave it on and make your code work. You can see they are just warnings, and your code will still work. It's an easy way to find typo'd variable names. Also, when register_globals is ON, you might use $id and expect the value to be passed through the URL. By getting this warning when you check $id, you should realize that the variable needs to be validated, because it can be anything coming through the URL. Hope that helps. ---John Holmes... - Original Message - From: Jason Soza [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 25, 2002 12:33 PM Subject: Re: [PHP] Parse Error - Help? (AGAIN) Sorry for the length of the code, but I felt I described the problem, (parse error, last line) and if I hadn't posted the entire code I probably would've been asked to. This list can be a little confusing for a newbie: just a couple days ago I read someone saying too much information is better than not enough and now I'm getting that I posted too much. I'm still learning! :) What does the ! in if(!isset($id)) { $id = 0; } do? I think I get what this bit does in general: checks if $id has been assigned anything, if it's empty it gets assigned 0. Correct? Then I can use if($id) statements later on without having PHP return Undefined Variable errors. Right? Thanks for your help, I'll work on my PHP listetiquette. Jason Soza - Original Message - From: 1LT John W. Holmes [EMAIL PROTECTED] Date: Thursday, April 25, 2002 5:35 am Subject: Re: [PHP] Parse Error - Help? (AGAIN) I don't have your original code (which, btw, you shoudn't ever post that much code without explicitly saying what the error was, what line it was one, highlighting that line, and saying what you've done so far), but these errors are caused by not giving a default value to a variable, basically. If you have something like this: if($id = 5) { //whatever } and $id hasn't been assigned a value, then you'll get that warning. In previous versions of PHP, you wouldn't get the warning, you'd just get FALSE. So, before you test the value of a variable, or echo the value out, make sure you've assigned it something. if(!isset($id)) { $id = 0; } Hopefully that's not too confusingit's hard to explain. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] how to make array_search start from 0?
-Original Message- From: andy [mailto:[EMAIL PROTECTED]] Sent: 25 April 2002 17:30 I am passing an array through the URL with a ',' inbetween: var=php,mysql,super Parsing is done with: explode (',',$var). This gives me an array starting with 0 Later on I have to search for lets say php with array_search. Unfortunatelly array_search requires an array starting with 1. No, it doesn't. The key here is in the big warning at the bottom of the manual entry for array_search (http://www.php.net/array_search), which says: == Warning This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE, such as 0 or . Please read the section on Booleans for more information. Use the === operator for testing the return value of this function. == So, if what you search for is at key 0, array_search will return zero, which evaluates to FALSE if you do an == (or !=) test on it. Unfortunately, the return value for not found changed for version 4.2.0 -- it used to be NULL, but is now FALSE, so you will have to write your test accordingly. Something like this should do it: Versions prior to 4.2.0: $i = array_search('abc', $arr); if (!isnull($i)): // 'abc' was found endif; 4.2.0 and up: $i = array_search('abc', $arr); if ($i!==FALSE): // 'abc' was found endif; Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] operating system type
Does anybody know if there is a way for php to get the operating system type from a linux box? I know how to get the kernel version, but not the operating version/type. example. RedHat Linux 6.1 or 6.2 or 7.1, etc Thank You Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error - Help? (AGAIN)
To stop receiving the messages from undefined variables add this at top of your files: error_reporting(55); Or better yet, keep as you're doing and develop with E_ALL and fix those E_NOTICE errors correctly! ;) Well said...don't hide and ignore the warnings...fix them. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to make array_search start from 0?
I can see what u are saying. Its all about the === Anyhow.. this thing does not work in a loop. I guess this is my prob. There might be something wrong with the boolean. I tryed it with different settings, but still wrong: Here is what I mean: $fruit = array('apple','banana','cranberry'); $findme = array('apple', 'notlisted'); foreach($findme AS $value){ if (($key = array_search($value, $fruit)) !== false) { print Key ($key) was found from value $valuebr; } else { print Sorry, $value was not found in array \$fruitbr; } } Replys: Key (0) was found from value apple Key () was found from value notlisted So there must be still something wron in th stmt. Thanx for your help, Andy Philip Olson [EMAIL PROTECTED] schrieb im Newsbeitrag Pine.BSF.4.10.10204251646060.3971-10@localhost">news:Pine.BSF.4.10.10204251646060.3971-10@localhost... If the key is 0, array_search will return 0, it does not start at 1. $arr = array('apple','banana','cranberry'); $key = array_search('apple', $arr); print $key; // 0 If 'apple' was not found, $key would then equal to boolean false. Be sure to use === false to check failure because 0 == false. For example: $fruit = array('apple','banana','cranberry'); $findme = 'apple'; if (($key = array_search($findme, $fruit)) !== false) { print Key ($key) was found from value $findme; } else { print Sorry, $findme was not found in array \$fruit; } Again, remember, 0 == false. == !=, === !==. So, 0 !== false. Wow that sounds confusing. :) Also consider the sexy array_keys() function. Regards, Philip Olson p.s. http://uk.php.net/manual/en/language.operators.comparison.php p.s.s. also take into account extra whitespace (trim), and potential issues with case sensitivity (strtolower). On Thu, 25 Apr 2002, andy wrote: Hi there, I am passing an array through the URL with a ',' inbetween: var=php,mysql,super Parsing is done with: explode (',',$var). This gives me an array starting with 0 Later on I have to search for lets say php with array_search. Unfortunatelly array_search requires an array starting with 1. So php is not found. Does anybody know a workaround for this? Thanx, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to make array_search start from 0?
I can see what u are saying. Its all about the === Anyhow.. this thing does not work in a loop. I guess this is my prob. There might be something wrong with the boolean. I tryed it with different settings, but still wrong: Here is what I mean: $fruit = array('apple','banana','cranberry'); $findme = array('apple', 'notlisted'); foreach($findme AS $value){ if (($key = array_search($value, $fruit)) !== false) { print Key ($key) was found from value $valuebr; } else { print Sorry, $value was not found in array \$fruitbr; } } Replys: Key (0) was found from value apple Key () was found from value notlisted So there must be still something wron in th stmt. Thanx for your help, Andy Philip Olson [EMAIL PROTECTED] schrieb im Newsbeitrag Pine.BSF.4.10.10204251646060.3971-10@localhost">news:Pine.BSF.4.10.10204251646060.3971-10@localhost... If the key is 0, array_search will return 0, it does not start at 1. $arr = array('apple','banana','cranberry'); $key = array_search('apple', $arr); print $key; // 0 If 'apple' was not found, $key would then equal to boolean false. Be sure to use === false to check failure because 0 == false. For example: $fruit = array('apple','banana','cranberry'); $findme = 'apple'; if (($key = array_search($findme, $fruit)) !== false) { print Key ($key) was found from value $findme; } else { print Sorry, $findme was not found in array \$fruit; } Again, remember, 0 == false. == !=, === !==. So, 0 !== false. Wow that sounds confusing. :) Also consider the sexy array_keys() function. Regards, Philip Olson p.s. http://uk.php.net/manual/en/language.operators.comparison.php p.s.s. also take into account extra whitespace (trim), and potential issues with case sensitivity (strtolower). On Thu, 25 Apr 2002, andy wrote: Hi there, I am passing an array through the URL with a ',' inbetween: var=php,mysql,super Parsing is done with: explode (',',$var). This gives me an array starting with 0 Later on I have to search for lets say php with array_search. Unfortunatelly array_search requires an array starting with 1. So php is not found. Does anybody know a workaround for this? Thanx, Andy -- 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] operating system type
Look at a phpinfo() page...seems like there should be something that says this. Looked for you...$HTTP_ENV_VARS[OSTYPE] or $_ENV[OSTYPE] should work for you. ---John Holmes... - Original Message - From: Steve Buehler [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 25, 2002 1:31 PM Subject: [PHP] operating system type Does anybody know if there is a way for php to get the operating system type from a linux box? I know how to get the kernel version, but not the operating version/type. example. RedHat Linux 6.1 or 6.2 or 7.1, etc Thank You Steve -- 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] Array wildcard?
Is there some array wildcard I can use? In other words, I have an array. Is there any wildcard function/character that will let me test to see if a string matches anything in that array? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array wildcard?
On Thu, 25 Apr 2002, Leif K-Brooks wrote: Is there some array wildcard I can use? In other words, I have an array. Is there any wildcard function/character that will let me test to see if a string matches anything in that array? Thanks http://php.net/in_array ? miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] operating system type
Thanks, but those just say Linux. I was looking for what version. Like RedHat 7.0. Thanks Steve At 12:51 PM 4/25/2002, you wrote: Look at a phpinfo() page...seems like there should be something that says this. Looked for you...$HTTP_ENV_VARS[OSTYPE] or $_ENV[OSTYPE] should work for you. ---John Holmes... - Original Message - From: Steve Buehler [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 25, 2002 1:31 PM Subject: [PHP] operating system type Does anybody know if there is a way for php to get the operating system type from a linux box? I know how to get the kernel version, but not the operating version/type. example. RedHat Linux 6.1 or 6.2 or 7.1, etc Thank You Steve -- 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] operating system type
On Thu, 25 Apr 2002, Steve Buehler wrote: Does anybody know if there is a way for php to get the operating system type from a linux box? I know how to get the kernel version, but not the operating version/type. example. RedHat Linux 6.1 or 6.2 or 7.1, etc That's probably pretty tricky. What is a Redhat installation? What is it after half the files have been gutted and replaced with packages from elsewhere or source-built binaries? Once /etc/issue gets changed, there's nothing that conclusively identifies the machine as RedHat except for an arbitrary assortment of files and directories that may or may not be intact. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to make array_search start from 0?
Well this seems to work for me just fine. ? $fruit = array('apple','banana','cranberry'); $findme = array('banana', 'cranberry', 'apple'); for ($i=0; $icount($findme); $i++) { $result = array_search($findme[$i], $fruit); if ($result !== false) { print Key ($result) was found for value $findme[$i]br; } else { print Sorry, could not find $findme[$i].br; } } ? This code outputs: Key (1) was found for value banana Key (2) was found for value cranberry Key (0) was found for value apple -Kevin - Original Message - From: andy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 25, 2002 11:39 AM Subject: Re: [PHP] how to make array_search start from 0? I can see what u are saying. Its all about the === Anyhow.. this thing does not work in a loop. I guess this is my prob. There might be something wrong with the boolean. I tryed it with different settings, but still wrong: Here is what I mean: $fruit = array('apple','banana','cranberry'); $findme = array('apple', 'notlisted'); foreach($findme AS $value){ if (($key = array_search($value, $fruit)) !== false) { print Key ($key) was found from value $valuebr; } else { print Sorry, $value was not found in array \$fruitbr; } } Replys: Key (0) was found from value apple Key () was found from value notlisted So there must be still something wron in th stmt. Thanx for your help, Andy Philip Olson [EMAIL PROTECTED] schrieb im Newsbeitrag Pine.BSF.4.10.10204251646060.3971-10@localhost">news:Pine.BSF.4.10.10204251646060.3971-10@localhost... If the key is 0, array_search will return 0, it does not start at 1. $arr = array('apple','banana','cranberry'); $key = array_search('apple', $arr); print $key; // 0 If 'apple' was not found, $key would then equal to boolean false. Be sure to use === false to check failure because 0 == false. For example: $fruit = array('apple','banana','cranberry'); $findme = 'apple'; if (($key = array_search($findme, $fruit)) !== false) { print Key ($key) was found from value $findme; } else { print Sorry, $findme was not found in array \$fruit; } Again, remember, 0 == false. == !=, === !==. So, 0 !== false. Wow that sounds confusing. :) Also consider the sexy array_keys() function. Regards, Philip Olson p.s. http://uk.php.net/manual/en/language.operators.comparison.php p.s.s. also take into account extra whitespace (trim), and potential issues with case sensitivity (strtolower). On Thu, 25 Apr 2002, andy wrote: Hi there, I am passing an array through the URL with a ',' inbetween: var=php,mysql,super Parsing is done with: explode (',',$var). This gives me an array starting with 0 Later on I have to search for lets say php with array_search. Unfortunatelly array_search requires an array starting with 1. So php is not found. Does anybody know a workaround for this? Thanx, Andy -- 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] authorization headers
does anybody know how to pass the correct username and password as a header to a directory with an .htaccess file. i tried header(Authorization: Basic username:password); like that and also where the username:password was base 64 encoded and it isn't working. thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session_cache_expire()
session_cache_expire() How does this function work? I keep getting and error saying the function is undefined... , I'm using version 4.1.2, which session support built in. According to the documentation this function exist, however looking at the source (session.c, php_session.h) It doesn't appear to be defined... hence the error I am getting. Anyone have any insight on this - or on how to use this function? Pierre Arsenault - Computing Services Dept. Mount Allison University (506) 364 -2474 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] DOM XML
Hello, I have been recently doing experiments with the DOM XML function and I am (not surprisingly) having some problems with it. When I try to run the code below, I get an error saying I am trying to use and endefined function. To me it seems that the DOM XML extension is working fine, because I get no error from xmldoc(), but I am still not sure what the problem is. I am running PHP 4.2 Code: ?php $str = ?XML version=\1.0\?menameAnyname/name/me; $dom = xmldoc($str); $root = $domxml_root($dom); echo $root-name; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array wildcard?
on 4/25/02 1:58 PM, Miguel Cruz at [EMAIL PROTECTED] wrote: On Thu, 25 Apr 2002, Leif K-Brooks wrote: Is there some array wildcard I can use? In other words, I have an array. Is there any wildcard function/character that will let me test to see if a string matches anything in that array? Thanks http://php.net/in_array ? miguel One more question. Is there any way to use this with part of a string? Example: function checkfruitlove($string){ $fruitarray = array(apples,oranges); if($string == I love .in_array($fruitarray).!){ $return = I do too!; }else{ $return = I don't!; } return $return; } $answer = chechfruitlove(I love apples!); //returns I do too! $answer = chechfruitlove(I love oranges!); //returns I do too! $answer = chechfruitlove(I love pears!); //returns I don't!
[PHP] array_search
thats why you do not have a key which is not found. Try to replace $findme withthis: $findme = array('banana', 'cranberry', 'not in there'); Will return: Key () was found for value not in there So there is a bug.. but well hidden :-( Von: Kevin Stone [EMAIL PROTECTED] An: PHP-general [EMAIL PROTECTED] Betreff: Re: [PHP] how to make array_search start from 0? Datum: Donnerstag, 25. April 2002 20:07 Well this seems to work for me just fine. ? $fruit = array('apple','banana','cranberry'); $findme = array('banana', 'cranberry', 'apple'); for ($i=0; $icount($findme); $i++) { $result = array_search($findme[$i], $fruit); if ($result !== false) { print Key ($result) was found for value $findme[$i]br; } else { print Sorry, could not find $findme[$i].br; } } ? This code outputs: Key (1) was found for value banana Key (2) was found for value cranberry Key (0) was found for value apple -Kevin - Original Message - From: andy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 25, 2002 11:39 AM Subject: Re: [PHP] how to make array_search start from 0? I can see what u are saying. Its all about the === Anyhow.. this thing does not work in a loop. I guess this is my prob. There might be something wrong with the boolean. I tryed it with different settings, but still wrong: Here is what I mean: $fruit = array('apple','banana','cranberry'); $findme = array('apple', 'notlisted'); foreach($findme AS $value){ if (($key = array_search($value, $fruit)) !== false) { print Key ($key) was found from value $valuebr; } else { print Sorry, $value was not found in array \$fruitbr; } } Replys: Key (0) was found from value apple Key () was found from value notlisted So there must be still something wron in th stmt. Thanx for your help, Andy Philip Olson [EMAIL PROTECTED] schrieb im Newsbeitrag Pine.BSF.4.10.10204251646060.3971-10@localhost">news:Pine.BSF.4.10.10204251646060.3971-10@localhost... If the key is 0, array_search will return 0, it does not start at 1. $arr = array('apple','banana','cranberry'); $key = array_search('apple', $arr); print $key; // 0 If 'apple' was not found, $key would then equal to boolean false. Be sure to use === false to check failure because 0 == false. For example: $fruit = array('apple','banana','cranberry'); $findme = 'apple'; if (($key = array_search($findme, $fruit)) !== false) { print Key ($key) was found from value $findme; } else { print Sorry, $findme was not found in array \$fruit; } Again, remember, 0 == false. == !=, === !==. So, 0 !== false. Wow that sounds confusing. :) Also consider the sexy array_keys() function. Regards, Philip Olson p.s. http://uk.php.net/manual/en/language.operators.comparison.php p.s.s. also take into account extra whitespace (trim), and potential issues with case sensitivity (strtolower). On Thu, 25 Apr 2002, andy wrote: Hi there, I am passing an array through the URL with a ',' inbetween: var=php,mysql,super Parsing is done with: explode (',',$var). This gives me an array starting with 0 Later on I have to search for lets say php with array_search. Unfortunatelly array_search requires an array starting with 1. So php is not found. Does anybody know a workaround for this? Thanx, Andy -- 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] operating system type
I am running php version 4.06 Steve At 01:05 PM 4/25/2002, Nathan wrote: What version of PHP? - Original Message - From: mailto:[EMAIL PROTECTED]Steve Buehler To: mailto:[EMAIL PROTECTED]Nathan Sent: Thursday, April 25, 2002 12:00 PM Subject: Re: [PHP] operating system type Yes, I can get it from the /etc/issue file. I don't have an _ENV[MACHTYPE] listed when doing an phpinfo() Thanks Steve At 12:48 PM 4/25/2002, you wrote: phpinfo() is telling me this... _ENV[MACHTYPE] i386-redhat-linux-gnu It doesn't give the version though. The System section info would be great, but I don't know that you can access that. - Original Message - From: Steve Buehler mailto:[EMAIL PROTECTED][EMAIL PROTECTED] To: mailto:[EMAIL PROTECTED][EMAIL PROTECTED] Sent: Thursday, April 25, 2002 11:31 AM Subject: [PHP] operating system type Does anybody know if there is a way for php to get the operating system type from a linux box? I know how to get the kernel version, but not the operating version/type. example. RedHat Linux 6.1 or 6.2 or 7.1, etc Thank You Steve -- PHP General Mailing List (http://www.php.net/http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phphttp://www.php.net/unsub.php
Re: [PHP] operating system type
Good points. I guess i will just have to hope that the /etc/issue file is correct. Thanks Steve At 01:02 PM 4/25/2002, you wrote: On Thu, 25 Apr 2002, Steve Buehler wrote: Does anybody know if there is a way for php to get the operating system type from a linux box? I know how to get the kernel version, but not the operating version/type. example. RedHat Linux 6.1 or 6.2 or 7.1, etc That's probably pretty tricky. What is a Redhat installation? What is it after half the files have been gutted and replaced with packages from elsewhere or source-built binaries? Once /etc/issue gets changed, there's nothing that conclusively identifies the machine as RedHat except for an arbitrary assortment of files and directories that may or may not be intact. miguel -- 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: Newbie Book Database Question
Hello, Chris Montgomery wrote: Howdy, I have been developing with ColdFusion for nearly five years and want to learn PHP. For someone who has never done anything with PHP before, what *one* book would you recommend as a good primer to get started learning PHP? Also, do most PHPers use MySQL as your database when building dynamic web sites, or do you prefer alternative databases like Postgres? From what I have seen from afar, MySQL seems to be the dominant one, but I have read that Postgres is more robust. You may like this book: http://www.phpclasses.org/products.html/id/0957921802.html Also take a look at the reviewed books in this page: http://www.phpclasses.org/products.html Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Parse Error - Help? (AGAIN)
You know, I once said the same: better fix the notices and keep the code clean. But as I've done several performance tests I came to a conclusion that there's no much difference debugging the code yourself or let PHP doing it. Often predefining manually a variable resulted to me being even more 'expensive' then when PHP debugs it. I think it is wise using this feature of PHP. The only reason not to is for having the full control of your code. Just my 2 Eurocents Sincerely, Maxim Maletsky Founder, Chief Developer www.PHPBeginner.com // where PHP Begins -Original Message- From: Nathan [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 7:15 PM To: PHP Subject: Re: [PHP] Parse Error - Help? (AGAIN) I'll second that one... always better to code with register_globals = Off and E_ALL reporting level IMHO. # Nathan - Original Message - From: Philip Olson [EMAIL PROTECTED] To: Maxim Maletsky (PHPBeginner.com) [EMAIL PROTECTED] To stop receiving the messages from undefined variables add this at top of your files: error_reporting(55); Or better yet, keep as you're doing and develop with E_ALL and fix those E_NOTICE errors correctly! ;) Regards, Philip Olson -- 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] PHP Security Leak
I'm wondering if anyone has any ideas on how to make a login site more secure. Since I'm not really sure if I've explained myself well enough and don't really know how else to say it, I'll just give examples and then you guys can follow suit and mention some oversights: I have a regular logon: username and password. What it does is, when the user types in a name and pword, it forwards to another PHP page (a 'middleman' page that is there just to compare usernames and pwords), validates by checking the SQL database, then header forwards to the login page. A cookie is created, and voila, you're allowed into what we'll call the 'account pages'. Now, here's my 'security' (notice the quotes): 1. You can't log in when the URL includes a username and/or a password (so that no one can make direct links). 2. Same with an account page: you're redirected to the login page if you include a username and pword when linking to an account page. 3. The 'middleman' page also has this protection: you cna't directly link to it with a username and pword in the URL. Basically, users can't get into anything when they include a username and pword in the URL. 4. Obviously, you don't get access if your username and password don't match anything in the database (thought I'd mention it even though it goes without saying). 5. You can't login from a page that isn't on the server. Is there any validation or security holes that I'm overlooking? __ Do You Yahoo!? Yahoo! Games - play chess, backgammon, pool and more http://games.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] using html select as array
Hi list, In my system I have multiples choices of language that user selects using drop down menus. So I've named this dropdows language[] and grab it as php array, and with looo i insert it into mysql as registers. But now i need to put a text field that the user can type any language that is not in the dropdown. my question is how can i know when this was typed when i do the select to update the user itens. I mean, when i select and populate your preferences to update, how can i know that this info is from the input text??? Thank's Rodrigo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Newbie Book Database Question
Hello, Chris Montgomery wrote: Howdy, I have been developing with ColdFusion for nearly five years and want to learn PHP. For someone who has never done anything with PHP before, what *one* book would you recommend as a good primer to get started learning PHP? Professional PHP Programming is a good one. Kind of outdated but gives you an idea about the language. For all the rest search the web. Also, do most PHPers use MySQL as your database when building dynamic web sites, or do you prefer alternative databases like Postgres? From what I have seen from afar, MySQL seems to be the dominant one, but I have read that Postgres is more robust. That is right. MySQL is good enough for many needs, but postgreSQL is much more. It is more stable, robust, quick and has way more features. From both DBs pgSQL is closer to Oracle than what mySQL is. You may like this book: http://www.phpclasses.org/products.html/id/0957921802.html Also take a look at the reviewed books in this page: http://www.phpclasses.org/products.html Regards, Manuel Lemos Sincerely, Maxim Maletsky Founder, Chief Developer www.PHPBeginner.com // where PHP Begins -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Security Leak
-Original Message- From: Liam Gibbs [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 8:20 PM To: [EMAIL PROTECTED] Subject: [PHP] PHP Security Leak I'm wondering if anyone has any ideas on how to make a login site more secure. Since I'm not really sure if I've explained myself well enough and don't really know how else to say it, I'll just give examples and then you guys can follow suit and mention some oversights: I have a regular logon: username and password. What it does is, when the user types in a name and pword, it forwards to another PHP page (a 'middleman' page that is there just to compare usernames and pwords), validates by checking the SQL database, then header forwards to the login page. A cookie is created, and voila, you're allowed into what we'll call the 'account pages'. Now, here's my 'security' (notice the quotes): 1. You can't log in when the URL includes a username and/or a password (so that no one can make direct links). 2. Same with an account page: you're redirected to the login page if you include a username and pword when linking to an account page. 3. The 'middleman' page also has this protection: you cna't directly link to it with a username and pword in the URL. Basically, users can't get into anything when they include a username and pword in the URL. 4. Obviously, you don't get access if your username and password don't match anything in the database (thought I'd mention it even though it goes without saying). 5. You can't login from a page that isn't on the server. Is there any validation or security holes that I'm overlooking? at least this two: 1. Use SSL 2. Store passwords MD5 encrypted in the DB Sincerely, Maxim Maletsky Founder, Chief Developer www.PHPBeginner.com // where PHP Begins __ Do You Yahoo!? Yahoo! Games - play chess, backgammon, pool and more http://games.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error - Help? (AGAIN)
I would agree that performance-wise, there may be little difference in how fast a script runs. And for pre-defining variables, sure you can get away without doing that and php will happily help you out. However, I find it easier to debug my code knowing whether or not I remembered to assign a value to my variable and where the heck it got assigned from. :-) I would also like to point out that the combo of not registering globals and having all errors reported will ensure you get the right data type when using the same variable names for _POST, _SESSION, et cetera data. I had a few scripts that behaved differently than I though because I was looking for the value of $foo and not realizing that my $foo was grabbing my session data instead of what I thought I was assigning it to. I changed my php.ini and now I tear out far less hair this way ;-) # Nathan - Original Message - From: Maxim Maletsky (PHPBeginner.com) [EMAIL PROTECTED] To: 'Nathan' [EMAIL PROTECTED]; 'PHP' [EMAIL PROTECTED] Sent: Thursday, April 25, 2002 12:18 PM Subject: RE: [PHP] Parse Error - Help? (AGAIN) You know, I once said the same: better fix the notices and keep the code clean. But as I've done several performance tests I came to a conclusion that there's no much difference debugging the code yourself or let PHP doing it. Often predefining manually a variable resulted to me being even more 'expensive' then when PHP debugs it. I think it is wise using this feature of PHP. The only reason not to is for having the full control of your code. Just my 2 Eurocents Sincerely, Maxim Maletsky Founder, Chief Developer www.PHPBeginner.com // where PHP Begins -Original Message- From: Nathan [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 7:15 PM To: PHP Subject: Re: [PHP] Parse Error - Help? (AGAIN) I'll second that one... always better to code with register_globals = Off and E_ALL reporting level IMHO. # Nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php