Re: [PHP] Unix passwd file
I found this code in a web (or somthink like this), but can remever where to give the credits, sorry. include_once('/etc/php/bases.php'); function autentifica($user,$pass) { global $db1Host, $db1User, $db1Pass; $auth = false; mysql_connect($db1Host,$db1User,$db1Pass) or die ('Unable to connect to server.'); // Select database on MySQL server mysql_select_db('mysql') or die ('Unable to select database.'); // Formulate the query $sql = "SELECT user FROM user WHERE User='$user' && password=PASSWORD('$pass')"; // Execute the query and put results in $result $result = mysql_query($sql) or die ('Unable to execute query.'); // Get number of rows in $result. $num = mysql_numrows( $result ); if ($num != 0) { // A matching row was found - the user is authenticated. $auth = true; } return $auth; } Josep R. Raurell En/na Scott ha escrit: >I apologize if this is might be OT. I have 5,000+ users in a unix passwd >file that I would like to move to a MySQL table to build a login system >with php. I could then use this table for Postfix and Radius. I know >about the getpwent in perl, but does anyone know if I populate a MySQL >table with the login/password can php then use that encrypted password to >validate users? > >TIA > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] apache security
Hello. I think nobody had send this warnig to the list. Sorry if you already nows. This text is from the apache web: SECURITY ADVISORY Versions of the Apache web server up to and including 1.3.24 and 2.0 up to and including 2.0.36 contain a bug in the routines which deal with invalid requests which are encoded using chunked encoding. This bug can be triggered remotely by sending a carefully crafted invalid request. This functionality is enabled by default. In most cases the outcome of the invalid request is that the child process dealing with the request will terminate. At the least, this could help a remote attacker launch a denial of service attack as the parent process will eventually have to replace the terminated child process, and starting new children uses non-trivial amounts of resources. We were also notified today by ISS that they had published the same issue which has forced the early release of this advisory. Please note that the patch provided by ISS does not correct this vulnerability. The Apache Software Foundation has released versions 1.3.26 and 2.0.39 to address and fix this issue. These version are available for download; see below. Josep R. Raurell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help me please! :)
This work for me: liv_1 liv_2 liv_3 liv_n To get the value i work in this way... $liv= $_REQUEST['liv']; $n = 50; for ($i=1; $i<=$n;i++){ ... echo $liv[$i]; Josep R. Raurell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: the ?PHPSESSID=spoofme 'bug'
If you destroy the session (for exaple with a logoff button) this dosen work. Josep R. Raurell Giancarlo Pinerolo wrote: >Giancarlo Pinerolo wrote: > >>I myself wrote: >> >>>Can I tell you more than what the subject says? >>>proceeding: >>>Close the browser, clean all your cookies, and open any page with that >>>?PHPSESSID=spoofme appended. >>>And see what happens. >>> > >spoofme is not the exact term. > >?PHPSESSID=hijackme should be more appropriate, but I avoided it for >well known 'historical' reasons :-| > >G > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] pdf with POST
Hello. I do a pdf with a lot of variables from a form, with a GET method. After make the pdf (in the same script) I sent the headers and the user can see the document in your browser: $data = $albara->retorna(); $len=strlen($data); header("Content-Type: application/pdf"); header("Content-Length: $len"); header("Content-Disposition: inline; filename=$fileName"); header("Pragma: no-cache"); header("Expires: 0"); print $data; $albara->deleteDoc(); This work OK. But I want use POST because there are so much variables in the URL, whit post the result is a blank scrren (the pdf never apears). Somebody nows if is posible (with another headers or with other solution) to use a POST method to get a pdf made on the fly ? Thanks. Josep. R. Raurell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] cross db
And what about pearDB ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] db2 connect speed problem
Hello. I connected a php linux server with db2 connect personal edititon with an as400 v4r4. The connexion works ok, but all the querys have a delay. I think is the cost of a new connexion on the a400. - Somebody nows a solution ? - Somebody have a similar situacion and works faster ? Thanks Josep R. Raurell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Rebuilding PHP4 with IBM DB2 Support Causes Apache to Die Upon Restart
I think --with--ibm-db2 only works as statically linked with apache, no as module. And do you have the db2 connect librarys instaled in the system ? I copy here an article that works for my, I dont remenber where I see, maybe in faqs.com: - Sep 21st, 2000 13:04 Remo Ronchitelli The connection from a Linux Web Server equipped with Apache and PHP 4 to an IBM AS/400 (OS400 and DB2/400) system is possible and works fine. The same connection works with IBM mainframes equipped with OS/390, MVS/ESA, VM/ESA, VSE/ESA and IBM DB2. The only strict requirement is the version of OS400 operating system: it must be V4R2 with native TCP/IP support. The following is the hierarchical list of Software Layers used in the test. ++Linux RedHat 6.1 --(Korn Shell pdksh rpm package required) ++Apache Web Server 1.3.12 ++PHP 4.0.2 statically linked to Apache -- with-ibm-db2 option enabled ++IBM DB2Connect Personal Edition for Linux -- V7.1 free from somewhere in ibm.com The IBM DB2 UDB DB2Connect Personal Edition installation is performed via Korn shell script "db2setup". Use all the features you can select, and installl: DB2 Administration Client DB2 Connect Personal Edition Db2 Application Development Client The DB2 instance created on Linux is: "db2inst1" and password "ibmdb2" (defaulted). After this you can install PHP 4 --with-ibm-db2 option enabled. You get some weak compilation warnings but don't worry (it would be better they missed). For PHP it looks exactly like you had installed IBM DB2 UDB Personal Edition (the whole DB2 engine "without" DB2Connect). On the AS/400 side you have to start "drda" tcp servers at port "446" (defaulted). On the AS/400 side you need also authorized userid and password. Along with IBM DB2Connect you get full HTML documentation (useful and clear). Now return to Linux: login as "db2inst1" password "ibmdb2" and type: "db2" (DB2 command line processor). This is the necessary to inform DB2Connect about the reality of DB2400 DataBase on the AS/400. Thatis: 1. 'catalog tcpip node YOUR_FREE_NODE_NAME remote TCP_IP_ADDRESS_OF_AS400 server 446 remote_instance AS400_SYSTEM_NAME system YOUR_FREE_SYSTEM_NAME ostype OS400' (446 is the default port number of drda server) (ostype must be "OS400") 2. 'catalog dcs database YOUR_DB_NAME as DB2400_REAL_NAME' (DB400_REAL_NAME is the cataloged name of DB2 system in the AS/400 or the RDBNAME of AS/400) 3. 'catalog database YOUR_DB_NAME as PHP_DB_NAME at node YOUR_FREE_NODE_NAME authentication DCS' (if you choose authentication "SERVER" it doesn't work). 4. 'connect to PHP_DB_NAME user AS400_USERID using AS400_PASSWORD' 5. (Caution to escape double quotes!) 'bind \"[EMAIL PROTECTED] BLOCKING ALL SQLERROR CONTINUE MESSAGES DDCS400.MGS GRANT PUBLIC\" ' 6. 'connect reset' 7. 'terminate' (quit from DB2 Command Line Processor). You can now access DB2/400 from a PHP script enabled with: 'putenv ("LD_LIBRARY_PATH=/home/db2inst1/sqqlib/lib:$LD_LIBRARY_PATH"); ' 'putenv ("DB2INSTANCE=db2inst1"); ' 'odbc_connect(PHP_DB_NAME, AS400_USERID, AS400_PASSWORD);' Warning: The Table name referenced in your PHP script must be qualified with the "collection" or "library" name of AS/400 DB2 system. Example: "SELECT * FROM AS400LIB.TABLE" The default would be "SELECT * FROM DB2INST1.TABLE" (surely wrong). Take your fun with AS/400 or Mainframe system! Remo Ronchitelli [EMAIL PROTECTED] Josep R. Raurell Quoting Derek Battams <[EMAIL PROTECTED]>: > Currently I have Apache and PHP4 (using the Apache module for PHP4) working > just fine on my server. However, the RPMs I installed for mod_php4 didn't > include IBM DB2 support. So I took the source RPM and modified it by > simply > adding the following line to the spec file: > > --with-ibm-db2 > > I appended this to the CFLAGS parameter in the spec file. I then rebuilt > the RPMs and everything built fine. I then installed them and that was > fine. However, when I try to restart Apache nothing happens. It just > exits > immediately with nothing written to any logs. If I remove the > '--with-ibm-db2' flag from the spec file, rebuild the RPMs, then reinstall > them without DB2 support then Apache restarts fine and operates with no > problems. DB2 is installed, configured, and running on the server. I've > spent numerous hours (on the weekend none the less) trying to figure this > out, but with no luck. Any help would be greatly appreciated. > > Thanks, > > Derek > > > > -- > 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] Solution: ImagePng: No PNG support in this PHP build
Quoting Jason Wong <[EMAIL PROTECTED]>: > - Whenever I recompile PHP, I always start with a clean extract from the > source tarball. > > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Ok this is solve the problem. I did a "make clean", but is not very clean :-(. The answer is delete the source and extract again. A lot of tanks to Jason Wong, today my php support png. Josep R. Raurell Responsable d'inforamtica d' AKO Electomecanica Estudinat d' Ingenieria Tecnica Informatica de GestiĆ³ a la UOC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ImagePng: No PNG support in this PHP build
Hello. I alwais get this message, i try with the gd and libpng librarys from the SuSE 7.0, and after uninstalling with the sources librarys. (gd works ok) The result is the same: ImagePng: No PNG support in this PHP build This is my last configure setting: './configure' '--prefix=/usr/local/intranet/php' '--exec- prefix=/usr/local/intranet/php' '--with- apache=/usr/local/src_intranet/apache_1.3.22' '--with-gettext' '--with- mysql=/usr/local/mysql' '--with-imap' '--with-ibm- db2=/usr/IBMdb2/7.1/include' '--with-pdflib=/usr/local/pdflib4' '--with-zlib' '- -with-png-dir=/usr/local' '--with-gd=/usr/local' It seems a problem that other people had, but I can't found the sollution in the forums. Help please. Josep R. Raurell. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Text editor for linux
Quoting Torkil Johnsen <[EMAIL PROTECTED]>: > Anyone know of a good text editor for linux, WITH syntax highlighting for > php/html + other languages? > > - TOrkil > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > jedit www.jedit.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP+MYSQL unable to select database
I can't select a database from a php script. I've set privileges in both the user and the data base tables and I've done FLUSH PRIVILEGES; WHY? JOSEP. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP+MYSQL: unable to select database even FLUSH PRIVILEGES
I've did: FLUSH PRIVILEGES but nothing changes. Josep. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP+MYSQL: unable to select database
I get: unable to select database when I visit my guestbook.php The user trying it is set in the mysql.user (without any perms) and in the mysql.db (with all perms). Do I have to set all perms to this user in the mysql.user table? Josep -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Access denied for user
I get the following message when trying to view a php page Warning: Access denied for user: 'jupshoes@localhost' (Using password: YES) in /home/jupshoes/public_html/guest/index.php on line 27 Unable to connect to SQL server What is going wrong Josep -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] newbie: which packages are needed?
Which packages do I need to set a web server with PHP and MYSQL support? I guess: apache server php4 apache module mysql module for php4 Josep -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] undefined function: mysql_pconnect()
Debian 2.2 + PHP4 apache module + mysql Trying my first php program (guestbook) I get: Fatal error: Call to undefined function: mysql_pconnect() in /home/jupshoes/public_html/guest/index.php on line 27 thanks Josep. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Again: [PHP] NEXT Page and BACK Page
> Use a LIMIT clause. See > http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#SEL ECT > > -Rasmus And for a db that not have limit (like ibm db2) Josep. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] how to limit the files returned
Hi. I want use in IBM DB2 the SELECT . LIMIT, as I can do in mySQL. How -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php still not working
If you d'ont compile as a module, you must copile and install apache again. > >> Trying a re-post from yesterday... >> >> My setup is as follows: >> >> RH Linux 7.0 >> PHP 4.0.5 >> Apache 1.3.20 >> >> I've either added or uncommented the following lines from httpd.conf: >> >> AddType application/x-httpd-php .php >> AddType application/x-httpd-php-source .phps >> >> and to mime.types: >> >> application/x-httpd-php php phtml pht >> >> Adding a LoadModule won't work because I didn't compile as a module. >> >> I've seen some posts about AddHandler for PHP3, so I tried adding the >> following to the .conf file: >> >> AddHandler php-script .php >> >> having no idea whether this syntax was correct or not since the only >> example I found >> in the archuves refered to v. 3. >> >> So I still get the html/php code showing up in my browser with no >> interpretation by PHP. >> Any suggestions (with the exception of "Hey, maybe you should stick with >> Windows") >> are greatly appreciated. >> >> TIA >> >> Brent >> >> >> >> >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> To contact the list administrators, e-mail: [EMAIL PROTECTED] >> >> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]