Re: [PHP] is_uploaded_file() emulation?
What about: ENV[USER] or ENV[USERNAME] (see phpinfo())... Greets, Edward - Original Message - From: Bogdan Stancescu [EMAIL PROTECTED] To: Martin Towell [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; Stewart Gateley [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, February 27, 2002 12:37 AM Subject: Re: [PHP] is_uploaded_file() emulation? Yeah, that's what I looked at before posting - but there's a catch: Returns the user ID of the **current script**, or *FALSE* on error. :-( Bogdan Martin Towell wrote: try: http://www.php.net/manual/en/function.getmyuid.php -Original Message- From: Bogdan Stancescu [mailto:[EMAIL PROTECTED] ] Sent: Wednesday, February 27, 2002 10:33 AM To: Stewart Gateley Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] is_uploaded_file() emulation? Thank you - but that wasn't the question - as you can see, I started the second paragraph with a reference to that function - my problem is what I compare the result to - i.e. how do I find out *my* UID, not the file's. Mr. Kelly's solution should work, but it's rather absurd (from a PHP point of view) to have to create a file just to find out what my uid is... I'm sure there should be a more reasonable method - but I don't know it. Hoping somebody does... ;-) Thanks! Bogdan Stewart Gateley wrote: $owner = fileowner ($file); returns a string containing the owner or false. see http://www.php.net/manual/en/ref.filesystem.php -- Stewart --- Bogdan Stancescu [EMAIL PROTECTED] wrote: Hello all! How do I find out if a file was actually uploaded /without/ using is_uploaded_file()? My first though is that I should use fileowner() on the file and see if it's the same as the user who runs PHP (Apache) - but how do I find that out? I don't want to use exec(id -u) either because the syntax may be different for distinct systems and I'd like to avoid system calls if possible. I'm open to any suggestions to solve the original problem - not necessarily using UID's. Thanks! Bogdan -- PHP General Mailing List ( http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Greetings - Send FREE e-cards for every occasion! http://greetings.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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Writing to files
I know I can do this with sessions, reason I am asking is webserver should not be able to create file (for security reasons), I would of maybe thought php could create a file as a different user. php is not always used by the box owner. I find it strange that such a option Is only available if you run the box or the webserver is run as that user. Sessions and such need configurations that need to be configured by the server admin Ect I was hoping there was a way that didn't rely on a special configuration And stayed in the users directory --- Chris Kay, Eleet Internet Services [EMAIL PROTECTED] --- -Original Message- From: Warren Vail [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 27 February 2002 6:51 PM To: Chris Kay Subject: RE: [PHP] Writing to files Suggest you understand how session management works. Whether you store in a file or database, the entries are removed if the user fails to return after a limit amount of time, and are kept in a separate table in the database. You can post the results to your actual data tables when you are completed. If you don't want to store the data in files, or in a database, what did you have in mind? There is no rule that says you can only store permanent data in a data base. -Original Message- From: Chris Kay [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 26, 2002 11:43 PM To: 'Warren Vail'; [EMAIL PROTECTED] Subject:RE: [PHP] Writing to files The data will be stored in mysql, but I don't wish to store in sql untill its completed. In case a user leave the application before completing it. --- Chris Kay, Eleet Internet Services [EMAIL PROTECTED] --- -Original Message- From: Warren Vail [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 27 February 2002 6:37 PM To: Chris Kay; [EMAIL PROTECTED] Subject: RE: [PHP] Writing to files What you are describing is exactly how session management works, storing things in a file in the /tmp directory. Perhaps you could consider using the session save handler functions to store the session data in your protected database (MySQL?). Warren Vail -Original Message- From: Chris Kay [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 26, 2002 11:19 PM To: [EMAIL PROTECTED] Subject:[PHP] Writing to files Question I have is, Anyway know of a better way to store temp information? I have a problem that a script I use, uses many pages and after each page the information from the form Is stored and the next page is shown ect It uses more than 20 variables so I can not store the data in cookies. I could store the data in a temp file created but problem is that the webserver would need to create The file which is a security risk (I would like to find another way other than this). I don't really want to use sessions but if it's the last resort I guess I will have to. Other than the above any one have a better soluition? Running php 4.1.1 on RH7.2 --- Chris Kay, Eleet Internet Services [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] GD fonts and ImageLoadFont
Hello, I've been trying to figure out how to properly convert a bdf font into a GD font for use with ImageLoadFont. The conversion goes without a problem, and I can load and use the font, but for some reason, all the characters look as though they have a space inserted between them. So, instead of the number 20, I get something that looks like 2 0. Instead of Hello, I get something that looks like H e l l o. I've seen suggestions to use the php commands that use truetype instead of GD fonts, but we're working with a hosting company who does not have freetype installed (much less current versions of gdlib and php). Is there something I can do to get the GD fonts to space properly? Thanks, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Writing to files
Not sure I understand how you concluded that web server should not create files, it certainly should not be able to create files on client machines without permission of user (which it cannot do). Users should not be able to upload files to the server without the permission of the web application, but if a web application performs the upload and controls where the file goes and what is in the file, that would be safe. If the web application completely controls where temporary files go and what goes in them (variables) then how is that unsafe? On the subject of using the database, check out which environment variables that actually control session management (you can do this by running the phpinfo() function. There are two major configuration options which you have full control over; 1. If the sys admin controls the default configuration of where to write the session data (usually points to /tmp directory), then the session_set_save_handler function is your way to override those parameters. 2. In fact if you read the routine that performs garbage collection (deletes expired session data) session management will pass to that routine the parameter that controls the default lifetime from the sysadmin's setup data, which you as the writer of the routine are free to ignore and use your own. Only caveat is you need to include these routines in every page that records data to a session (no big deal). I wish you luck on this, you seem to have been advised on some rules, by people who didn't know what they were talking about, or perhaps you understood their recommendations out of context, and that makes it hard for you. I really think session management is the way to resolve your problem. It would be interesting for you to get a couple of opinions on the subject of creating files on a server. You could create routines that would write to physical files in these save_handler functions and put them in your user directory if you like, but I would not mix these files in the same directory as your application code, perhaps a sub directory. I would be willing to bet there are log files that are updated on your server every time someone accesses one of your web pages. Good luck, Warren Vail -Original Message- From: Chris Kay [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 12:36 AM To: 'Warren Vail' Cc: [EMAIL PROTECTED] Subject:RE: [PHP] Writing to files I know I can do this with sessions, reason I am asking is webserver should not be able to create file (for security reasons), I would of maybe thought php could create a file as a different user. php is not always used by the box owner. I find it strange that such a option Is only available if you run the box or the webserver is run as that user. Sessions and such need configurations that need to be configured by the server admin Ect I was hoping there was a way that didn't rely on a special configuration And stayed in the users directory --- Chris Kay, Eleet Internet Services [EMAIL PROTECTED] --- -Original Message- From: Warren Vail [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 27 February 2002 6:51 PM To: Chris Kay Subject: RE: [PHP] Writing to files Suggest you understand how session management works. Whether you store in a file or database, the entries are removed if the user fails to return after a limit amount of time, and are kept in a separate table in the database. You can post the results to your actual data tables when you are completed. If you don't want to store the data in files, or in a database, what did you have in mind? There is no rule that says you can only store permanent data in a data base. -Original Message- From: Chris Kay [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 26, 2002 11:43 PM To: 'Warren Vail'; [EMAIL PROTECTED] Subject:RE: [PHP] Writing to files The data will be stored in mysql, but I don't wish to store in sql untill its completed. In case a user leave the application before completing it. --- Chris Kay, Eleet Internet Services [EMAIL PROTECTED] --- -Original Message- From: Warren Vail [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 27 February 2002 6:37 PM To: Chris Kay; [EMAIL PROTECTED] Subject: RE: [PHP] Writing to files What you are describing is exactly how session management works, storing things in a file in the /tmp directory. Perhaps you could consider using the session save handler functions to store the session data in your protected database (MySQL?). Warren Vail -Original Message- From: Chris Kay [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 26, 2002 11:19 PM To: [EMAIL PROTECTED] Subject:[PHP] Writing to files Question I have is, Anyway know of a better way to store temp information? I have a problem that a script I use, uses many pages and after each page the information from the form Is stored and the next page is shown ect It uses more than 20
[PHP] RE: Sessions and switching between php and htm documents
I haven't experienced this myself, but I'd have thought that if you're propagating the session via the URL rather than a cookie then it won't get added if the page isn't parsed. If it's not passed on just once it's lost. Tim Ward Internet chess www.chessish.com http://www.chessish.com -- From: Dave [SMTP:[EMAIL PROTECTED]] Sent: 27 February 2002 04:37 To: [EMAIL PROTECTED] Subject: Sessions and switching between php and htm documents login.htm form submits information login.php session_start(); $HTTP_SESSION_VARS[username]=$formUserName; header(Location: displaypage.htm); displaypage.htm show some static stuff links to formpage.htm formpage.htm form submits information to form.php form.php session_start(); echo $HTTP_SESSION_VARS[username]; - has no value Does the chain of pages have to be continually PHP pages to allow the transition of the session variables? if not, any ideas on why we are losing session variables? Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql php - while loops
After the loop has finished executing add another line if ($i % $cols != $cols-1) { print /tr; } Otherwise once the loop has finished if not EXACLTY $i % $cols == $cols-1 then there would be no /tr after the last row which could cause display problems in the user agent (other than the fact that its putting out incorrect html) =S. On Wed, 27 Feb 2002, Martin Towell wrote: with a bit of cheating... use a table... (nb: this code not tested, but logic has) table ? $results = mysql_query(SELECT ID, date, appleprice, orangeprice, pearprice FROM fruits); $i = 0; $cols = 4 while ($data = mysql_fetch_array($results)) { if ($i % $cols == 0) echo tr ? td?=$data[date]? - ?=$data[appleprice]?br ?=$data[orangeprice]? - ?=$data[pearprice]?/td ? if ($i % $cols == $cols-1) echo /tr; $i++; } ? /table -Original Message- From: Craig Westerman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 11:43 AM To: php-general-list Subject: [PHP] mysql php - while loops The following lists 12 items from a fruits table. $results = mysql_query(SELECT ID, date, appleprice, orangeprice, pearprice FROM fruits); while ($data = mysql_fetch_array($results)) { ? p?=$data[date]? - ?=$data[appleprice]? - ?=$data[orangeprice]? - ?=$data[pearprice]?/p ? } How would I modify the loop to display 4 items then a row of fruit images then 4 more items then another row of different fruit images and then finally finish the loop displaying the final 4 items? Thanks Craig [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unable to display images on browser
try using gd if you have = 1.8.3 then you will have to use ImagePng() and Content-type: image/png instead of ImageGif() to export the image. header (Content-type: image/gif); $im = ImageCreateFromString ($fileContent); ImageGif ($im); =S. On Tue, 26 Feb 2002, Narvaez, Teresa wrote: Hello, I do not understand why I can't display images retrieved from MySQL on my browser(IE 4.0). When I retrieve the image from MYSQL I set the Header function to change the type of content(image/gif) I am sending to the browser. However, the browser displays an box with an X in it. I would greatly appretiate any ideas/help. Here is the piece of code: Thanks in advance! -Teresa ? Code to connect and selected DB not included - $dbQuery = Select PicNum, size, type, description, Image; $dbQuery .= FROM Images WHERE PicNum = $fileId; $result = mysql_query($dbQuery) or die (Could not get file list: . mysql_error() ); echo Sent Query successfullybr; if ( mysql_num_rows($result) == 1) { $fileType = @mysql_result($result,0, type); $fileContent = @mysql_result($result, 0, Image); $filedesc = @mysql_result($result,0, description); $filenum = @mysql_result($result,0, PicNum); // Header(Content-type: $fileType); Header(Content-type: image/gif); echo $fileContent; } else { echo Record does not exist; } // else ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cool PHP sites
On Tue, 26 Feb 2002 10:07:55 -0900 Chris Lott [EMAIL PROTECTED] wrote: It strikes me that my students really don't have a good grasp of what PHP is capable of doing, since they are getting bogged down in learning the minutiae of the language itself. So (quickly if possible-- I'd like to demo some sites tonight) what are some examples of cool and publically accessible sites that use PHP? I'm looking for sites that demonstrate what PHP can do, examples of big name sites using PHP, etc. I can explain how the back end technology is working if I have some good sites to use as a framework. I'd like to keep them excited about the potential, you know? Hi Chris, To mention some, freshmeat, and easyDNS. You can try the case studies on: http://www.zend.com/zend/cs/ --bk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help me
- Original Message - From: hugh danaher [EMAIL PROTECTED] To: Michele Salerno [EMAIL PROTECTED]; php [EMAIL PROTECTED] Sent: Tuesday, February 26, 2002 10:38 PM Subject: Re: [PHP] Help me Michele, Please show some lines of code in your next message so we can better understand your problem. Hugh Tanks, i have non problem with newsgroup. Send e-mail in mailing list = send post in newsgroup!:-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Crontab
This is why I love lists. I was going to have to do something similar this week and was planning on using perl, never thought about running php from the command line. Thanks, =S. On Wed, 27 Feb 2002, Sven Jacobs wrote: I've use a script that I put in my cron.weekly to execute a php script and it works fine :-) #! /bin/sh #Run Report Generation Script /usr/bin/php4 /usr/share/netsaint/genmonrep.scp.php Kind Regards Sven -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: mercredi 27 février 2002 8:04 To: [EMAIL PROTECTED] Subject: Re: [PHP] Crontab On Wednesday 27 February 2002 13:11, Uma Shankari T. wrote: Hello, I need to run one php script using crontab.I am having this doubt.If the phpscript run in the command prompt then only we can run the script using crontab...please tell me how do i go about with this.. You can have crontab run lynx/links to access your php page. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: Help with showing tables in DB
Have you tried any diagnostic to find out what fields are being returned by the query, something like: If ($result = mysql_query(show tables)) { while ($row = mysql_fetch_array($result)) { foreach($row as $fieldname=$value) echo($fieldname=$valuebr); } } I think you'll find the field you want is something like Tables_in_dbname. Tim Ward www.chessish.com http://www.chessish.com -- From: Ron Clark [SMTP:[EMAIL PROTECTED]] Sent: 26 February 2002 21:02 To: [EMAIL PROTECTED] Subject: Help with showing tables in DB -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Consider the following: mysql_select_db($db_name); $result = mysql_query(show tables); while ($rows = mysql_fetch_object($result)) { echo $rows; } So why does this not return the Table names? I have even tried echo rows-Table and echo rows-Tables to no avail. So how do I fix this? Thanks in advance, Ron C. -BEGIN PGP SIGNATURE- Version: PGP 7.1 iQA/AwUBPHv32kSpEYIqgLQzEQISfQCeLVinx7oQc4Gmudv1MJbb17dGCPoAnA7S yRR86rJUwHsXGJlU0yVckVyK =2bva -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FW: C++ compilation ...
Hy ! Is it possible to compile personnal module in C++ ?? When I use the g++ (C++) compiler, the following message appear in my PHP page : Invalid library (maybe not a PHP library) I need to compile my module with a C++ compiler because it use a C++ library (OmniORB). Help me :o) Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php on PWS win Me
- Original Message - From: Sanj [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, February 26, 2002 8:54 PM Subject: [PHP] php on PWS win Me Hi, Currently running Win Me with pws, want to run php purely for testing. Have just installed apace http://127.0.0.1 but need to turn off pws to make this work, I have downloaded the following binaries from php.net: PHP 4.1.1 zip package [4,953Kb] - 03 January 2002 and PHP 4.1.1 installer [909Kb] - 03 January 2002 Bit unsure what to do now, can someone walk me thru the next steps. Install Apache+php+MySQL. The my down experience the versions for Windows don't beautifuldiferent is version with Linux, plus complete and plus difficulty. Exuse me for error in english...:-°°(( Michele -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Unable to display images on browser
Well, you probably need to do something like this: file1.php (where you want to display an image) img src=getimage.php?fileId=42 end file1 getimage.php (the ? needs to be on the first line in the file) ? Code to connect and selected DB not included - $dbQuery = Select PicNum, size, type, description, Image; $dbQuery .= FROM Images WHERE PicNum = $fileId; $result = mysql_query($dbQuery) or die (Could not get file list: . mysql_error() ); if ( mysql_num_rows($result) == 1) { $fileType = @mysql_result($result,0, type); $fileContent = @mysql_result($result, 0, Image); $filedesc = @mysql_result($result,0, description); $filenum = @mysql_result($result,0, PicNum); // Header(Content-type: $fileType); header (Content-type: image/gif); $im = ImageCreateFromString ($fileContent); ImageGif ($im); } else { //Insert code to display error.gif } // else ? ---end getimage.php Good Luck /Joakim -Original Message- From: Narvaez, Teresa [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 2:08 AM To: 'Dean Householder'; [EMAIL PROTECTED] Subject: [PHP] Unable to display images on browser Hello, I do not understand why I can't display images retrieved from MySQL on my browser(IE 4.0). When I retrieve the image from MYSQL I set the Header function to change the type of content(image/gif) I am sending to the browser. However, the browser displays an box with an X in it. I would greatly appretiate any ideas/help. Here is the piece of code: Thanks in advance! -Teresa ? Code to connect and selected DB not included - $dbQuery = Select PicNum, size, type, description, Image; $dbQuery .= FROM Images WHERE PicNum = $fileId; $result = mysql_query($dbQuery) or die (Could not get file list: . mysql_error() ); echo Sent Query successfullybr; if ( mysql_num_rows($result) == 1) { $fileType = @mysql_result($result,0, type); $fileContent = @mysql_result($result, 0, Image); $filedesc = @mysql_result($result,0, description); $filenum = @mysql_result($result,0, PicNum); // Header(Content-type: $fileType); Header(Content-type: image/gif); echo $fileContent; } else { echo Record does not exist; } // else ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Correct header to force name to store of download file with IE and Netscape
Hi I have big problem with headers which I send to www browser: IE 5.5 and Netscape 6.2. On my web site I have PHP script to download huge text files to client side. The text file is compressed by gzip program before it will be downloaded to client. My problem is how to send to www browser correct headers to download gziped file for example text.gz and force www browser to store this file with name text.gz. I tested sending headers like below, but it work only with IE 5.5. Using Netscape 6.2 downloaded file should be stored as text.gz but is stored as name of the PHP script. There is PHP code with headers I send to www browser: header( 'Content-Encoding: zip'); header( 'Content-Length: ' . $file_size ); header( 'Content-Location: ' . $file_gz ); header( 'Content-Type: application/octet-stream' ); header( 'Content-Type: application/zip' ); //header( 'Location: ' . $file_gz ); header( 'Content-Disposition: filename=' . $short_file_gz ); Thank You for any suggestions. Krzysiek -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cool PHP sites
Chris, This might be a bit late but a couple of graphioc designers I work with use a forum on Flash at http://www.were-here.com. The forums themselves, judging from the filenames, are done with PHP and are quite attractive in terms of presentation and are clearly well used. Hope this is of use, Michael Egan Chris Lott wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 It strikes me that my students really don't have a good grasp of what PHP is capable of doing, since they are getting bogged down in learning the minutiae of the language itself. So (quickly if possible-- I'd like to demo some sites tonight) what are some examples of cool and publically accessible sites that use PHP? I'm looking for sites that demonstrate what PHP can do, examples of big name sites using PHP, etc. I can explain how the back end technology is working if I have some good sites to use as a framework. I'd like to keep them excited about the potential, you know? c -BEGIN PGP SIGNATURE- Version: 6.5.8ckt - KeyID: 0x51046CFD - http://www.chrislott.org/geek/pgp/ iQA/AwUBPHvc/daLYehRBGz9EQI9KwCgu7SKkrKqmcQ7zf+lAZBwKgvAlWcAmwQ7 xCs+oCAo6Hn5UkHuDmR4ZzlT =koDz -END PGP SIGNATURE- -- 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] Test - don't read just delete
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Changed localhost?
All of a sudden Apache is nor running correctly under Windows 98. It appears that somehow localhost was changed from 127.0.0.1 to something else. Does the fact that I now have a 24/7cable connection to the Net cause the problem? Thanks! Anthony Rodriguez ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cool PHP sites
http://www.superpages.com/ -- the US national telephone directory from Verizon -- appears to use php. The extension is .phtml ... - Original Message - From: Chris Lott [EMAIL PROTECTED] minutiae of the language itself. So (quickly if possible-- I'd like to demo some sites tonight) what are some examples of cool and publically accessible sites that use PHP? I'm looking for sites that demonstrate what PHP can do, examples of big name sites using PHP, etc. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to get the calender
Hi, I want to get the calender displayed beside the input box. If user select a particular date from the calender after selection it should display the date in the input box along with the time stamp. Any help will be appreciated. Thanks in advance. -Balaji- **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
[PHP] maximum string length
What is the maximum number of characters a variable of type string can hold ?? Is there a restriction ?? $x = adfafasfadfaf what is the max number of characters $x can hold ?? __ Do You Yahoo!? Yahoo! Greetings - Send FREE e-cards for every occasion! http://greetings.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sending mail using a password
Greetings, My SMTP server requests I use a password for every time I send(not IP based). How is it possible to let PHP to use password authentication when mail is sent. Thank you, Svavar Luthersson
RE: [PHP] RE: Sessions and switching between php and htm documents
Not passing via URL currently... using track_vars Dave -Original Message- From: Tim Ward [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 4:16 AM To: [EMAIL PROTECTED]; Dave Subject: [PHP] RE: Sessions and switching between php and htm documents I haven't experienced this myself, but I'd have thought that if you're propagating the session via the URL rather than a cookie then it won't get added if the page isn't parsed. If it's not passed on just once it's lost. Tim Ward Internet chess www.chessish.com http://www.chessish.com -- From: Dave [SMTP:[EMAIL PROTECTED]] Sent: 27 February 2002 04:37 To: [EMAIL PROTECTED] Subject: Sessions and switching between php and htm documents login.htm form submits information login.php session_start(); $HTTP_SESSION_VARS[username]=$formUserName; header(Location: displaypage.htm); displaypage.htm show some static stuff links to formpage.htm formpage.htm form submits information to form.php form.php session_start(); echo $HTTP_SESSION_VARS[username]; - has no value Does the chain of pages have to be continually PHP pages to allow the transition of the session variables? if not, any ideas on why we are losing session variables? Dave -- 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-gtk
Try the php-gtk list. [EMAIL PROTECTED] I use this list all the time and they are great at answering questions... Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Leif K-Brooks [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 26, 2002 7:38 PM To: [EMAIL PROTECTED] Subject: [PHP] Php-gtk I read the tutorial for it on the php-gtk site, but I didn't see a thing about how to run it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] SQL and PHP (socket vs TCP)
What exactly are your trying to do. TCP connections use sockets to connect. Sockets are how you connect... Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Uros Gruber [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 1:08 AM To: [EMAIL PROTECTED] Subject: [PHP] SQL and PHP (socket vs TCP) Hi! Yesterday i noticed some strange thing with connection PHP to postgreSQL. I have some script to tell me how long does it take to generate some page. And i noticed that this time is longer if i connect to socket. Isn't this a little strange. I know that connection to socket must be quicker that on IP. Is there something that i don't know. -- TIA, Uros -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] compiling with all options
hy all, is there an easy way to compile php with all possible extension and feature options, as far as they don't crash when used together, and, even better as far as the libs are available on the system? tia, henning -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php-gtk
hy leif Leif K-Brooks wrote: I read the tutorial for it on the php-gtk site, but I didn't see a thing about how to run it? this is not the list to discuss this, please subscribe to php-gtk-general. btw, afaik in the introduction part of the manual installation and tunning are described. please post further questions on the other list, there are lotta people who help very quick, henning -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions and switching between php and htm documents
tested the $HTTP_SESSION_VARS prior to sending, set just fine. changed the next page to php and tested for the session var... nothing. [in login.php] ? session_start(); # database check in here if(match){ $HTTP_SESSION_VARS[UserID_session]=$txtUserID; #from form field for user $HTTP_SESSION_VARS[UserNum_session]=$databaseresult; # from database result for user number header(Location: successlogin.php); # or .htm - changed this to test if var was being passed exit; }else{ header(Location: wrongpassword.htm); exit; } ? [in successlogin.php] ? echo $HTTP_SESSION_VARS[SellerID_session]; ? if I check session_id() - it is the same in both pages. Variables just aren't getting stored/retrieved. ideas? as an aside, how do you destroy/start a new session with new session id? or do you just destroy the variables then use the same session id for the new session? Dave Did you test and make sure the variable is set? login.php session_start(); $HTTP_SESSION_VARS[username]=$formUserName; echo $HTTP_SESSION_VARS[username] header(Location: displaypage.htm); Also, for grins ang giggles, make the middle page in the chain a HP, start the session and test for the variable. If it does not work then the problem is not the middle page being html. Subject: [PHP] Sessions and switching between php and htm documents login.htm form submits information login.php session_start(); $HTTP_SESSION_VARS[username]=$formUserName; header(Location: displaypage.htm); displaypage.htm show some static stuff links to formpage.htm formpage.htm form submits information to form.php form.php session_start(); echo $HTTP_SESSION_VARS[username]; - has no value -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] load extern module
Hi, all! I try load big extern library. How can I do it : compile with PHP-libraries or at runtime? What I need to do? Olga, olga tonkonog entwicklung / development caatoosee search technology gmbh gropiusstr. 9 d - 31137 hildesheim fon +49 (0) 5121-99866 16 fax +49 (0) 5121-99866 01 mailto: [EMAIL PROTECTED] http://www.caatoosee.com/cst/ -- get what you want Hinweis: Besuchen Sie uns auf der CeBIT 2002 vom 13.3.- 20.3. in Hannover! Weitere Informationen finden Sie auf unserer Website! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Security Patch 4.0.6
Hey there I installed the diff patch for 4.0.6 on my source and recompiled it. How can I be sure the patch has been installed correctly? Anyone that has an exploit or something I can test against it to see if the hole is closed? Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions not working between documents (was: Sessions and switching between php and htm documents)
further to this... --enable-track-vars --enable-trans-sid are both set in the build... using mod_php register globals is on -Original Message- From: Dave [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 8:47 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP] Sessions and switching between php and htm documents tested the $HTTP_SESSION_VARS prior to sending, set just fine. changed the next page to php and tested for the session var... nothing. [in login.php] ? session_start(); # database check in here if(match){ $HTTP_SESSION_VARS[UserID_session]=$txtUserID; #from form field for user $HTTP_SESSION_VARS[UserNum_session]=$databaseresult; # from database result for user number header(Location: successlogin.php); # or .htm - changed this to test if var was being passed exit; }else{ header(Location: wrongpassword.htm); exit; } ? [in successlogin.php] ? echo $HTTP_SESSION_VARS[SellerID_session]; ? if I check session_id() - it is the same in both pages. Variables just aren't getting stored/retrieved. ideas? as an aside, how do you destroy/start a new session with new session id? or do you just destroy the variables then use the same session id for the new session? Dave Did you test and make sure the variable is set? login.php session_start(); $HTTP_SESSION_VARS[username]=$formUserName; echo $HTTP_SESSION_VARS[username] header(Location: displaypage.htm); Also, for grins ang giggles, make the middle page in the chain a HP, start the session and test for the variable. If it does not work then the problem is not the middle page being html. Subject: [PHP] Sessions and switching between php and htm documents login.htm form submits information login.php session_start(); $HTTP_SESSION_VARS[username]=$formUserName; header(Location: displaypage.htm); displaypage.htm show some static stuff links to formpage.htm formpage.htm form submits information to form.php form.php session_start(); echo $HTTP_SESSION_VARS[username]; - has no value -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML
I can't really get you, but I have done similar programs in php/xml I think if I could see the code or if I know the ultimate goal of you, I could able to solve the problem. On Tue, 26 Feb 2002, Tom Holton wrote: Hello, I have come across a strange error when using the XML parsing functions. Instead of printing the xml to the screen, like the functions do, I decided to put these into arrays. It all seems to be working normally, except for the data part (this is the non-xml data). I can verify that the data is being stored in an array when the XML is being printed to my browser window. But when i then print this array out AFTER the xml has been printed, the array is empty! (yet it contains the same number of array elements as it should, they are all just blank now) I cannot find anything related to this nor can I determine why. I am perfectly willing to send the PHP code to anyone who would like to see this strange behavior. you know, i am just trying to put XML into variables rather than printing to the screen... perhaps someone knows of a better way? Anyone have any ideaS? thanks in advance! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php [EMAIL PROTECTED] --- We must use time wisely and forever realize that the time is always ripe to do right. -- Nelson Mandela --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: Sessions not working between documents (was: Sessions and switching between php and htm documents)
When you check your info page, do sessions automatically start? If not, make sure you do a session_start(); in there somewhere before you start checking things. Not sure why (lost in the annuls of time) but I always manually start/stop my sessions. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Dave [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 8:10 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Sessions not working between documents (was: Sessions and switching between php and htm documents) further to this... --enable-track-vars --enable-trans-sid are both set in the build... using mod_php register globals is on -Original Message- From: Dave [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 8:47 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP] Sessions and switching between php and htm documents tested the $HTTP_SESSION_VARS prior to sending, set just fine. changed the next page to php and tested for the session var... nothing. [in login.php] ? session_start(); # database check in here if(match){ $HTTP_SESSION_VARS[UserID_session]=$txtUserID; #from form field for user $HTTP_SESSION_VARS[UserNum_session]=$databaseresult; # from database result for user number header(Location: successlogin.php); # or .htm - changed this to test if var was being passed exit; }else{ header(Location: wrongpassword.htm); exit; } ? [in successlogin.php] ? echo $HTTP_SESSION_VARS[SellerID_session]; ? if I check session_id() - it is the same in both pages. Variables just aren't getting stored/retrieved. ideas? as an aside, how do you destroy/start a new session with new session id? or do you just destroy the variables then use the same session id for the new session? Dave Did you test and make sure the variable is set? login.php session_start(); $HTTP_SESSION_VARS[username]=$formUserName; echo $HTTP_SESSION_VARS[username] header(Location: displaypage.htm); Also, for grins ang giggles, make the middle page in the chain a HP, start the session and test for the variable. If it does not work then the problem is not the middle page being html. Subject: [PHP] Sessions and switching between php and htm documents login.htm form submits information login.php session_start(); $HTTP_SESSION_VARS[username]=$formUserName; header(Location: displaypage.htm); displaypage.htm show some static stuff links to formpage.htm formpage.htm form submits information to form.php form.php session_start(); echo $HTTP_SESSION_VARS[username]; - has no value -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mailing Files
Sven, Is it possible to mail files with the mail() commando? Or can it be done on a other way? You're talking about 'attachments' aren't you? Yes it is! Recommend you visit http://phpguru.org/ and pickup the SMTP and MIME classes there (including sample code which shows how to attach files to msgs using PHP). Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] textarea
Hi, I've got a strange HTML problem... When I have a textarea, and put a large text in it, the submit button isn't working if the text is very long, but it is working till a certain amount of characters (didn't check out which amount) I can click as many times as i want on the submit button, as long as my text isn't shorter, it won't submit any solutions? Edward PS. I haven't done anything with javascript which might prevent the form from taking action -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] I can't find the problem - parsing error
I have the following line of code: $this-html=$this_html + tr td bgcolor=\$type_color\ class=\copy\ width=\10\ -- this line div align=\center\ ... /td /tr ; I get Warning: unexpected character in input '\' (ASCII=92) state=1 And Parse Error in the same line..I am just sitting and looking at that line and can't find the problem..can anyone see the problem? Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea
i think you don't understand the problem it's just a textarea, no php has to do with it: textarea name='test'/textarea when i try to FILL it with tekst (so, in my browser) it is working for a certain amount of characters, but above it, the submit button is clickable, but doesn't take any action... Edward - Original Message - From: Bas Jobsen [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED] Sent: Wednesday, February 27, 2002 4:53 PM Subject: Re: [PHP] textarea textarea echo addslashes($text); /textarea Op woensdag 27 februari 2002 16:38, schreef u: Hi, I've got a strange HTML problem... When I have a textarea, and put a large text in it, the submit button isn't working if the text is very long, but it is working till a certain amount of characters (didn't check out which amount) I can click as many times as i want on the submit button, as long as my text isn't shorter, it won't submit any solutions? Edward PS. I haven't done anything with javascript which might prevent the form from taking action -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Custom 404 Page
I am running apache and php. I want to create a custom 404 page for my site. I have created a .htaccess file and ErrorDocument 404 /error.php3 line to it. If someone tries to view www.myserver.com/thispagedoesnotexist.htm the 404 page is displayed without issue. If someone tries to view www.myserver.com/thispagedoesnotexist.php3 then the following message is displayed instead of the 404 page. Fatal error: Unable to open /path/to/my/page/thispagedoesnotexist.php3 in - on line 0 No input file specified. How do I resolve this issue? Thank you. _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] I can't find the problem - parsing error
td bgcolor=\$type_color\ class=\copy\ width=\10\ -Original Message- From: Pax [mailto:[EMAIL PROTECTED]] Sent: mercredi 27 février 2002 16:47 To: [EMAIL PROTECTED] Subject: [PHP] I can't find the problem - parsing error I have the following line of code: $this-html=$this_html + tr td bgcolor=\$type_color\ class=\copy\ width=\10\ -- this line div align=\center\ ... /td /tr ; I get Warning: unexpected character in input '\' (ASCII=92) state=1 And Parse Error in the same line..I am just sitting and looking at that line and can't find the problem..can anyone see the problem? Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] I can't find the problem - parsing error
Swap round the and \ before the number 10 ie \10\ should be \10\ HTH, Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: Pax [SMTP:[EMAIL PROTECTED]] Sent: 27 February 2002 15:47 To: [EMAIL PROTECTED] Subject:[PHP] I can't find the problem - parsing error I have the following line of code: $this-html=$this_html + tr td bgcolor=\$type_color\ class=\copy\ width=\10\ -- this line div align=\center\ ... /td /tr ; I get Warning: unexpected character in input '\' (ASCII=92) state=1 And Parse Error in the same line..I am just sitting and looking at that line and can't find the problem..can anyone see the problem? Paul -- 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] maximum string length
Generally more than you'll ever need :-) About 8 MB by default. Bogdan Kancha . wrote: What is the maximum number of characters a variable of type string can hold ?? Is there a restriction ?? $x = adfafasfadfaf what is the max number of characters $x can hold ?? __ Do You Yahoo!? Yahoo! Greetings - Send FREE e-cards for every occasion! http://greetings.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] textarea
I think, what he's trying to say is check to make sure it's not an errant quote and not a string length issue. The same behavior may be caused by an errant quote. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 9:45 AM To: PHP-General Subject: Re: [PHP] textarea i think you don't understand the problem it's just a textarea, no php has to do with it: textarea name='test'/textarea when i try to FILL it with tekst (so, in my browser) it is working for a certain amount of characters, but above it, the submit button is clickable, but doesn't take any action... Edward - Original Message - From: Bas Jobsen [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED] Sent: Wednesday, February 27, 2002 4:53 PM Subject: Re: [PHP] textarea textarea echo addslashes($text); /textarea Op woensdag 27 februari 2002 16:38, schreef u: Hi, I've got a strange HTML problem... When I have a textarea, and put a large text in it, the submit button isn't working if the text is very long, but it is working till a certain amount of characters (didn't check out which amount) I can click as many times as i want on the submit button, as long as my text isn't shorter, it won't submit any solutions? Edward PS. I haven't done anything with javascript which might prevent the form from taking action -- 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 mysql_num_rows problem
Hi list, I have a class to perform my tasks to bd, among than there's this function function executa($sql=) { if($sql == ) { $this-resultado = 0; $this-numrows = 0; $this-row = -1; } $this-resultado = mysql_query($sql,$this-conexao-id); $this-numrows = mysql_num_rows($this-resultado); } everything works fine, except when I tri to insert a record. It inserts, but give an error Warning: Supplied argument is not a valid MySQL result resource in /home/restricted/home/papagaiodigital/public_html/recrutamento/includes/clas sesql.inc on line 22 line 22 is $this-numrows = mysql_num_rows($this-resultado); what's the problem?? Thank's n advance Rodrigo Peres -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] unique strings from string column type in mySQL
I have a column in a database with a column type of string that holds catalog numbers. They can be in two formats. 1: 410998 2: 555336-18 The 18 in the dash number represents a length. So there could be multiple entries with the same base, just a different int after the dash. I am experiencing two issues: First, when using the catalognumbers in a SELECT statement, only those without dashes return anything. Is there something I need to do with my datatype in order to use: $item = 555336-18; $sql = SELECT * FROM products WHERE catalognumber = $item; Second question, when I strip off the dash and following int(s), my select statement will work, even though the subtring I am then searching for doesn't really exist in the database. And if I have two numbers with that same subtring base they are both returned. For Example: $item1 = 555336-18; $item2 = 555336-7; $item = substr($item,0,6); $sql = SELECT * FROM products WHERE catalognumber = $item; Both items will be be returned, even without using %LIKE%. I'm guessing this all stems from my column type. Should I change it to something else, and if so what? Can anyone help out? Thanks, Mike Krisher -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I can't find the problem - parsing error
Pax, If the backslashes are to escape the double-quotes then the one after width is the wrong way around. \10\ I would expect to be \10\ Hope this helps. Regards Chris Pax wrote: I have the following line of code: $this-html=$this_html + tr td bgcolor=\$type_color\ class=\copy\ width=\10\ -- this line div align=\center\ ... /td /tr ; I get Warning: unexpected character in input '\' (ASCII=92) state=1 And Parse Error in the same line..I am just sitting and looking at that line and can't find the problem..can anyone see the problem? Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mysql_num_rows problem
with insert, update and delete you must use mysql_affected_rows() - Original Message - From: Rodrigo Peres [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Wednesday, February 27, 2002 4:58 PM Subject: [PHP] php mysql_num_rows problem Hi list, I have a class to perform my tasks to bd, among than there's this function function executa($sql=) { if($sql == ) { $this-resultado = 0; $this-numrows = 0; $this-row = -1; } $this-resultado = mysql_query($sql,$this-conexao-id); $this-numrows = mysql_num_rows($this-resultado); } everything works fine, except when I tri to insert a record. It inserts, but give an error Warning: Supplied argument is not a valid MySQL result resource in /home/restricted/home/papagaiodigital/public_html/recrutamento/includes/clas sesql.inc on line 22 line 22 is $this-numrows = mysql_num_rows($this-resultado); what's the problem?? Thank's n advance Rodrigo Peres -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mysql_num_rows problem
with insert, update and delete you must use mysql_affected_rows() http://www.php.net/manual/en/function.mysql-affected-rows.php - Original Message - From: Rodrigo Peres [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Wednesday, February 27, 2002 4:58 PM Subject: [PHP] php mysql_num_rows problem Hi list, I have a class to perform my tasks to bd, among than there's this function function executa($sql=) { if($sql == ) { $this-resultado = 0; $this-numrows = 0; $this-row = -1; } $this-resultado = mysql_query($sql,$this-conexao-id); $this-numrows = mysql_num_rows($this-resultado); } everything works fine, except when I tri to insert a record. It inserts, but give an error Warning: Supplied argument is not a valid MySQL result resource in /home/restricted/home/papagaiodigital/public_html/recrutamento/includes/clas sesql.inc on line 22 line 22 is $this-numrows = mysql_num_rows($this-resultado); what's the problem?? Thank's n advance Rodrigo Peres -- -- 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] unique strings from string column type in mySQL
On Thursday 28 February 2002 00:09, Mike Krisher wrote: I have a column in a database with a column type of string that holds catalog numbers. They can be in two formats. 1: 410998 2: 555336-18 The 18 in the dash number represents a length. So there could be multiple entries with the same base, just a different int after the dash. I am experiencing two issues: First, when using the catalognumbers in a SELECT statement, only those without dashes return anything. Is there something I need to do with my datatype in order to use: $item = 555336-18; $sql = SELECT * FROM products WHERE catalognumber = $item; As your column type is a string your select statement should read: SELECT * FROM products WHERE catalognumber = '$item' Second question, when I strip off the dash and following int(s), my select statement will work, even though the subtring I am then searching for doesn't really exist in the database. And if I have two numbers with that same subtring base they are both returned. For Example: $item1 = 555336-18; $item2 = 555336-7; $item = substr($item,0,6); $sql = SELECT * FROM products WHERE catalognumber = $item; Both items will be be returned, even without using %LIKE%. I'm guessing this all stems from my column type. Should I change it to something else, and if so what? Can anyone help out? It's probably because by not using single-quotes around $item, you're forcing your column, which is a string, into a number. The DB does its best and takes as many leading characters as it can to make this number. It stops when it gets to the hyphen as it's not a valid digit thus you end up with 555336, and hence it matches. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* A sine curve goes off to infinity, or at least the end of the blackboard. -- Prof. Steiner */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sending mail using a password
I have used phpmailer as my SMTP host also requires authentication. so far working without a problem. -- R'twick Niceorgaw E-Mail: [EMAIL PROTECTED] -- - Original Message - From: DL Neil [EMAIL PROTECTED] To: Svavar Lúthersson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, February 27, 2002 11:39 AM Subject: Re: [PHP] Sending mail using a password Greetings Svavar My SMTP server requests I use a password for every time I send(not IP based). How is it possible to let PHP to use password authentication when mail is sent. =Eureka! I have been looking at this, and made a note to come back to take a look at a 'likely candidate'. Of course, couldn't find it again when I read your msg... Check out http://phpmailer.sourceforge.net/ - Features Can send emails with multiple TOs, CCs, BCCs and REPLY-TOs Redundant SMTP servers Multipart/alternative emails for mail clients that do not read HTML email Support for 8bit, base64, binary, and quoted-printable encoding Uses the same methods as the very popular AspEmail active server (COM) component SMTP authentication Word wrap - You're a bit ahead of me! I haven't used the s/w. Nor did I notice any of the examples using SMTP-Auth. I don't recognise any of the project team's names. So I can't give you a definitive 'yes' or 'no' recommendation. If you try it, will you please share some feedback? Regards, =dn -- 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] textarea
On Wednesday 27 February 2002 23:44, Edward van Bilderbeek - Bean IT wrote: i think you don't understand the problem it's just a textarea, no php has to do with it: You said it yourself, so what's this doing on a PHP list :) textarea name='test'/textarea when i try to FILL it with tekst (so, in my browser) it is working for a certain amount of characters, but above it, the submit button is clickable, but doesn't take any action... Browsers have a limit to the amount of stuff you can enter into a textarea. You're probably coming up against that limit. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* An age is called Dark not because the light fails to shine, but because people refuse to see it. -- James Michener, Space */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Changed localhost?
Hi, Did you try http://localhost , instead of 127.0.0.1, or with your machine, if you have changed any, recently. Or else just check if it conflicts with the port(s) if you have PWS also installed on your machine. If you don't get any solutions, alternatively post your query to the PHP Windows mailing list also. Hth, Karthick All of a sudden Apache is nor running correctly under Windows 98. It appears that somehow localhost was changed from 127.0.0.1 to something else. Does the fact that I now have a 24/7cable connection to the Net cause the problem? Thanks! Anthony Rodriguez ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] maximum string length
It may be able to store 8MB, but each line can only hold 1024 characters. I ran into this using a string variable to store the message body of an HTML email. If I did not put a '\n' at the end of each line, I would get random '!' placed through the sent email. Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED] On Wednesday, February 27, 2002, at 07:55 AM, Bogdan Stancescu wrote: Generally more than you'll ever need :-) About 8 MB by default. Bogdan Kancha . wrote: What is the maximum number of characters a variable of type string can hold ?? Is there a restriction ?? $x = adfafasfadfaf what is the max number of characters $x can hold ?? __ Do You Yahoo!? Yahoo! Greetings - Send FREE e-cards for every occasion! http://greetings.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] maximum string length
-Original Message- From: Steven Walker [mailto:[EMAIL PROTECTED]] Sent: 27 February 2002 17:26 It may be able to store 8MB, but each line can only hold 1024 characters. I ran into this using a string variable to store the message body of an HTML email. If I did not put a '\n' at the end of each line, I would get random '!' placed through the sent email. But that's an email limit -- not one of PHP strings! 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] PHP on Pocket PC
Is it possible to run PHP on a Pocket PC? Thanks CW
[PHP] Getting the compression rate of a jpeg image
Hi there, I am wondering if it is possible to get the compression rate of a jpeg file?! As I did read on php.net creating a jpeg gives you a third parameter with the compression. Default is 75 %. So asuming the user has an image compressed with 50 % and he does upload this picture through my application, PHP will blow up the size by going back to 75 %. Quality stayes the same. So it is absolutly neccessary to know that value. Does somebody know how to get this thing? Thanx for your help guys, Cheers Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] help:PDF
Hi All, Slightly difficult question, and I am new to Windows programming. Installed Apache, PHP, Office and Adobe Acrobat 5.0 on Win2000 Professional. By using, $pdf = new COM(pdfdistiller.pdfdistiller.1); $pdf-FileToPdf($psfile, , ); I am able to convert PS to PDF. In the same fashion I want to convert DOC, XLS and PPT file format to PDF format, using PHP COM methods. Is that possible, please explain in detail. Is there any other way of doing this, ie., converting to pdf file using Acrobat with web interface. Thanks in advance, Regards, Kumar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] appending to include_path
hi, i'm hoping to find a way to append to the include_path set in my php.ini file. i've got several virtual servers that each require different include_paths which are defined using the php_admin_value line in my apache conf file. Since the documentation says that include_path is like the UNIX PATH variable, i assumed (or maybe hoped) that i would be able to use a syntax like this: php_admin_value include_path $include_path:/some/other/path unfortunately, it doesn't work. Is there a way to append to the path? -- ~darcy w. christ Elegant Communications Inc. 416.362.9772 x222 | 416.362.8324 fax -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] maximum string length
Steven It may be able to store 8MB, but each line can only hold 1024 characters. I ran into this using a string variable to store the message body of an HTML email. If I did not put a '\n' at the end of each line, I would get random '!' placed through the sent email. Maybe you know more about what Kancha is planning to do with this massive string, but the above criticism only applies to strings used to 'write' an email msg - and only to certain email servers/clients at that. It doesn't apply to strings within PHP, eg reading in the whole of some large text file and storing it in a string. Regards, =dn On Wednesday, February 27, 2002, at 07:55 AM, Bogdan Stancescu wrote: Generally more than you'll ever need :-) About 8 MB by default. Bogdan Kancha . wrote: What is the maximum number of characters a variable of type string can hold ?? Is there a restriction ?? $x = adfafasfadfaf what is the max number of characters $x can hold ?? __ Do You Yahoo!? Yahoo! Greetings - Send FREE e-cards for every occasion! http://greetings.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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP on Pocket PC
I've been looking for a WIN CE port of PHP for some time now and haven't been able to find one, let me know if you find something. There is a version of ASP for the PocketPC though in case you need an alternative. __ Mike Krisher -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] compiling with all options
Not really, no. On Wed, 27 Feb 2002, Henning Sprang wrote: hy all, is there an easy way to compile php with all possible extension and feature options, as far as they don't crash when used together, and, even better as far as the libs are available on the system? tia, henning -- 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] appending to include_path
On Thursday 28 February 2002 01:50, darcy w. christ wrote: hi, i'm hoping to find a way to append to the include_path set in my php.ini file. i've got several virtual servers that each require different include_paths which are defined using the php_admin_value line in my apache conf file. Since the documentation says that include_path is like the UNIX PATH variable, i assumed (or maybe hoped) that i would be able to use a syntax like this: php_admin_value include_path $include_path:/some/other/path unfortunately, it doesn't work. Is there a way to append to the path? One way to allow each virtual server to have their own php config is to set the values from within httpd.conf: VirtualHost 123.123.123.123 ServerAdmin [EMAIL PROTECTED] DocumentRoot /home/www/www.domain.com ServerName www.domain.com Directory /home/www/www.domain.com Allow from All php_value include_path .:/home/www/www.domain.com /Directory /VirtualHost -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Lubarsky's Law of Cybernetic Entomology: There's always one more bug. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Unusual Form situation?
I have form I am working with and trying to add some PHP processing to the form's contents. The form is a html template used by a CGI script. So, instead of having a 'submit' button for the form's content, there is a GIF. The CGI apparently reads the GIF as a button to submit the form's content and move on. How would I go about getting php to recognize this GIF as such? Typically for forms I use: if ($submit) { blah, blah, blah } Would I use if ($gifname)? Would the the GIF's name be the ALT tag? Or am I going to have to sift through the arcane CGI to find some action? Can I make the PHP come to life using the ACTION section of the form (which only refers to the CGI right now)? Thanks, -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP on Pocket PC
I've written webpages that were designed to be used on an iPaq. It had a wireless card in it so the used simply used a browser to hit the server they were stored on. That's one way but does not exactly answer your question. To answer your question, no, there is no port of php to WinCE that I am aware of. (Your language options for writing programs for a PocketPC are very limited.) * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Craig Westerman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 11:44 AM To: php-general-list Subject: [PHP] PHP on Pocket PC Is it possible to run PHP on a Pocket PC? Thanks CW -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] appending to include_path
Hi Jason, i think you misunderstood what i was asking. i am doing exactly what you described below. My question is whether there is a way to not overwrite the include_path variable, but instead to append certain paths within my virtual server's setup to the master include_path that is setup in my php.ini file. Jason Wong wrote: On Thursday 28 February 2002 01:50, darcy w. christ wrote: hi, i'm hoping to find a way to append to the include_path set in my php.ini file. i've got several virtual servers that each require different include_paths which are defined using the php_admin_value line in my apache conf file. Since the documentation says that include_path is like the UNIX PATH variable, i assumed (or maybe hoped) that i would be able to use a syntax like this: php_admin_value include_path $include_path:/some/other/path unfortunately, it doesn't work. Is there a way to append to the path? One way to allow each virtual server to have their own php config is to set the values from within httpd.conf: VirtualHost 123.123.123.123 ServerAdmin [EMAIL PROTECTED] DocumentRoot /home/www/www.domain.com ServerName www.domain.com Directory /home/www/www.domain.com Allow from All php_value include_path .:/home/www/www.domain.com /Directory /VirtualHost -- ~darcy w. christ Elegant Communications Inc. 416.362.9772 x222 | 416.362.8324 fax -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Custom 404 Page
I am running apache and php. I want to create a custom 404 page for my site. I have created a .htaccess file and ErrorDocument 404 /error.php3 line to it. If someone tries to view www.myserver.com/thispagedoesnotexist.htm the 404 page is displayed without issue. I guess you are using PHP on Windows? I had the same problem with a development server running IIS. I did not find a solution. IIS starts the PHP parser if you use a file with a .php3 extension (or whatever you configured) even when It does not exist. --- Jeroen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Oracle NLS : Access from PHP
Hi, I have some script to access an Oracle database using stored procedures. When I access a development database everything runs fine. When I access the production database I get errors PLS-00553: character set name is not recognized ORA-06550. The problem seems to be related to NLS. So in the beginning of the script I've put : putenv(ORACLE_BASE=/u01/app/oracle) ; putenv(ORACLE_HOME=/u01/app/oracle/product/8.1.7); putenv(ORA_NLS33=/u01/app/oracle/product/8.1.7/ocommon/nls/admin/data/) ; putenv(ORACLE_SID=MYSID) ; putenv(NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1) ; But the error continues. The remote database has the following parametes (select * from nls_database_parameters) 'NLS_LANGUAGE','AMERICAN' 'NLS_TERRITORY','AMERICA' 'NLS_CURRENCY','$' 'NLS_ISO_CURRENCY','AMERICA' 'NLS_NUMERIC_CHARACTERS','.,' 'NLS_CHARACTERSET','WE8ISO8859P1' 'NLS_CALENDAR','GREGORIAN' 'NLS_DATE_FORMAT','DD-MON-RR' 'NLS_DATE_LANGUAGE','AMERICAN' 'NLS_SORT','BINARY' 'NLS_TIME_FORMAT','HH.MI.SSXFF AM' 'NLS_TIMESTAMP_FORMAT','DD-MON-RR HH.MI.SSXFF AM' 'NLS_TIME_TZ_FORMAT','HH.MI.SSXFF AM TZH:TZM' 'NLS_TIMESTAMP_TZ_FORMAT','DD-MON-RR HH.MI.SSXFF AM TZH:TZM' 'NLS_DUAL_CURRENCY','$' 'NLS_COMP','BINARY' 'NLS_NCHAR_CHARACTERSET','WE8ISO8859P1' 'NLS_RDBMS_VERSION','8.1.7.0.1' My development database has the following settings : SQL select * from nls_database_parameters; PARAMETER VALUE -- NLS_LANGUAGE AMERICAN NLS_TERRITORY AMERICA NLS_CURRENCY $ NLS_ISO_CURRENCY AMERICA NLS_NUMERIC_CHARACTERS ., NLS_CHARACTERSET US7ASCII NLS_CALENDAR GREGORIAN NLS_DATE_FORMATDD-MON-RR NLS_DATE_LANGUAGE AMERICAN NLS_SORT BINARY NLS_TIME_FORMATHH.MI.SSXFF AM NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZH:TZM NLS_TIMESTAMP_TZ_FORMATDD-MON-RR HH.MI.SSXFF AM TZH:TZM NLS_DUAL_CURRENCY $ NLS_COMP BINARY NLS_NCHAR_CHARACTERSET US7ASCII NLS_RDBMS_VERSION 8.1.7.0.1 Help! :) Rt. __ Do You Yahoo!? Yahoo! Greetings - Send FREE e-cards for every occasion! http://greetings.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unusual Form situation?
I assume that you are doing something like this for your image: input type=image src=path/to/image/image.gif border=0 name=myimage Given that, PHP gives you $myimage_x and $myimage_y which correspond to the X and Y coordinates that were clicked on the image from the user. So on the page that your form submits to, you can do the following: if (isset($myimage_x) || isset($myimage_y)) { // do something } If the image was clicked, this will submit your form, and both $myimage_x and $myimage_y will be set. HTH Sam Masiello Software Quality Assurance Engineer Synacor (716) 853-1362 X289 [EMAIL PROTECTED] - Original Message - From: SpyProductions Support Team [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 27, 2002 1:33 PM Subject: [PHP] Unusual Form situation? I have form I am working with and trying to add some PHP processing to the form's contents. The form is a html template used by a CGI script. So, instead of having a 'submit' button for the form's content, there is a GIF. The CGI apparently reads the GIF as a button to submit the form's content and move on. How would I go about getting php to recognize this GIF as such? Typically for forms I use: if ($submit) { blah, blah, blah } Would I use if ($gifname)? Would the the GIF's name be the ALT tag? Or am I going to have to sift through the arcane CGI to find some action? Can I make the PHP come to life using the ACTION section of the form (which only refers to the CGI right now)? Thanks, -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] intranet security
I am currently building an intranet security system to handle internal users and the web applications we have. When we are done we will have the ability to add/remove users, control what apps they can and can't see, etc. One thing I would like to be able to do is set up groups and have the ability to assign multiple groups to a person. Say you have these groups: Admin, Developer, Read-Only and I want to assign Scott to Admin and Developer. Then also be able to control rights on a user level. Can someone point me to some links or let me know how you handled these situations. I have a rough draft here, but would like to see what others are doing to handle these issues. Thanks, -Scott -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is_uploaded_file() emulation?
On Tue, 2002-02-26 at 13:22, Bogdan Stancescu wrote: Hello all! How do I find out if a file was actually uploaded /without/ using is_uploaded_file()? First: Why not use is_uploaded_file()? Second Second: What version of PHP are you using? Torben My first though is that I should use fileowner() on the file and see if it's the same as the user who runs PHP (Apache) - but how do I find that out? I don't want to use exec(id -u) either because the syntax may be different for distinct systems and I'd like to avoid system calls if possible. I'm open to any suggestions to solve the original problem - not necessarily using UID's. Thanks! Bogdan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] appending to include_path
On Thursday 28 February 2002 02:30, darcy w. christ wrote: Hi Jason, i think you misunderstood what i was asking. i am doing exactly what you described below. My question is whether there is a way to not overwrite the include_path variable, but instead to append certain paths within my virtual server's setup to the master include_path that is setup in my php.ini file. My apologies :) Not sure how you can do it from the setup. But from within php there are functions to retrieve and set the include path. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Mr. Cole's Axiom: The sum of the intelligence on the planet is a constant; the population is growing. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Form Annoyances
I'm having this one issue that's really bugging me - I have a textarea where you can type in something - After typing it in, it goes to another page asking you to verify, if it's correct, it inserts it into a database. The page that asks you to verify holds the value of the textbox in a hidden form field. If the value the user entered in contains any single (') or double () quotes, it will mess everything up. Single quotes end up having a backslash thrown automatically in front of it, and it inserts it into the database WITH THE backslash. If there are double quotes, the HTML will get messed up due to the fact that when it sees the quote, it will cut off the rest of the value because if: value=this is an example: Hello how are you. everything after example: is going to get cut off. I tried putting the value in a query string, but when traveling across two pages, it seems to do the exact same thing. Any suggestions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Checking for and @ and a .
I'm trying to make an email field and I would like to check that its valid by checking for an @ and a . can someone point me in the right direction for this. THanks Philip J. Newman Philip's Domain - Internet Project. http://www.philipsdomain.com/ [EMAIL PROTECTED] Phone: +64 25 6144012 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php-general Digest 27 Feb 2002 06:51:42 -0000 Issue 1196
Chris, I've done some stuff on my site in PHP... certainly not big name, and maybe or maybe not cool depending on what you're into. http://www.northern.ca/ (my yahoo like directory of links) http://www.northern.ca/projects/phpwidgets/ (an semi-abandoned personalization engine... still cool to play with though) http://www.northern.ca/projects/xspell/XSpellClient.html (a XML-RPC based spell checker) And finally, not my work, but something I will be deploying soon: http://fud.prohost.org/forum/ (a cool GPL message board written in PHP) Chris Lott - cool PHP sites - Tue, 26 Feb 2002 10:07:55 -0900 It strikes me that my students really don't have a good grasp of what PHP is capable of doing, since they are getting bogged down in learning the minutiae of the language itself. So (quickly if possible-- I'd like to demo some sites tonight) what are some examples of cool and publically accessible sites that use PHP? I'm looking for sites that demonstrate what PHP can do, examples of big name sites using PHP, etc. I can explain how the back end technology is working if I have some good sites to use as a framework. I'd like to keep them excited about the potential, you know? c -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question about send email through php script
Hi Folks! I am working on a php system which sends e-mail. The system is ready to go now, but I am asking myself and now all of you what´s the best way to send this emails throug a php script: a) Using the mail() function? b) popen sendmail and writing the messages directly on it? I am thinking about which could be faster and costless for the server processing perspective. Regards Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] appending to include_path
Jason Wong wrote: On Thursday 28 February 2002 02:30, darcy w. christ wrote: Hi Jason, i think you misunderstood what i was asking. i am doing exactly what you described below. My question is whether there is a way to not overwrite the include_path variable, but instead to append certain paths within my virtual server's setup to the master include_path that is setup in my php.ini file. My apologies :) Not sure how you can do it from the setup. But from within php there are functions to retrieve and set the include path. i see the get_cfg_var, but i'm not sure what to use to set that variable. Any suggestions? -- ~darcy w. christ Elegant Communications Inc. 416.362.9772 x222 | 416.362.8324 fax -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] apostrphe's entered into MySQL database
Hi, I've sent a few emails thus far regarding adding apostrophe's through a PHP script form into a MySQL database. The responses I received indicated to me that I needed to get my hosting company to activate magic_quotes_gpc. After several days of talking with what seems to be the sole tech support person left at my hosting company - I was told that the magic_quotes_gpc variable is not supported by them. Sooo ... this leaves me in a rather awkward situation. I need to have a basic content management system up and running in the extremely near future that will be utilized by a great number of individuals. If when an apostrophe is entered - all the information entered through the form is rejected by the database - the entire endeavour suddenly becomes rather useless. I know that if I enter a \ before any apostrophe's in the form, it all works well ... but I highly doubt that the large number of volunteer's we're going to be working with here will take the time to add them, or even remember 5 minutes after I tell them. Does anyone have any possible solutions for this problem? I'll include the portion of code that seems to be causing the problems now ... I'm already using the addslashes() command and it is not working ... I'm desperate at this point ... Again, the following works flawlessly on my local test machine running Apache 1.3.23 and PHP 4.1.1 with MySQL 3.23.39 but not at all on my web host running Apache 1.3.12 and PHP 3.0.16 with MySQL 3.22.32 Thanks in advance, -Tim ?php $db = mysql_connect(localhost, , ); mysql_select_db(edoinfo,$db); if ($submit) { // here if no ID then adding else we're editing if ($id) { $sql = UPDATE ai_data SET section='$section',subsection='$subsection',heading='$heading',title='$title',info='$info',entry=NOW() WHERE id=$id; } else { $sql = INSERT INTO ai_data (section,subsection,heading,title,info,entry) VALUES ('$section','$subsection','$heading','$title','$info',NOW()); } // run SQL against the DB $result = mysql_query($sql); echo Record updated/edited!p; echo a href='add_info.php' class='comcal'ADD A RECORD/a; } elseif ($delete) { // delete a record $sql = DELETE FROM ai_data WHERE id=$id; $result = mysql_query($sql); echo $sql Record deleted!p; echo a href='add_info.php' class='comcal'ADD A RECORD/a; } else { // this part happens if we don't press submit if (!$id) { // print the list if there is not editing $result = mysql_query(SELECT * FROM ai_data,$db); while ($myrow = mysql_fetch_array($result)) { printf(a href=\%s?id=%s\ class='comcal'%s/a \n, $PHP_SELF, $myrow[id], $myrow[title]); printf(a href=\%s?id=%sdelete=yes\ class='comcal'(DELETE)/abr, $PHP_SELF, $myrow[id]); } } ? p a href=?php echo $PHP_SELF? class=comcalADD A RECORD/a p form method=post action=?php echo $PHP_SELF? ?php if ($id) { // editing so select a record $sql = SELECT * FROM ai_data WHERE id=$id; $result = mysql_query($sql); $myrow = mysql_fetch_array($result); $id = $myrow[id]; $section = $myrow[section]; $subsection = $myrow[subsection]; $heading = $myrow[heading]; $title = addslashes($myrow[title]); $info = addslashes($myrow[info]); $entry = $myrow[entry]; // print the id for editing ? input type=hidden name=id value=?php echo $id ? ?php } ? /td td align=left valign=topSectionfont size=1/font:/td td align=left valign=top input type=text name=section value=?php echo $section ? size=35 maxlength=100 ?php include('../../../scripts/forms.css'); ? /td /tr tr td align=left valign=topSub-Section: /td td align=left valign=top input type=text name=subsection value=?php echo $subsection ? size=35 maxlength=100 ?php include('../../../scripts/forms.css'); ? /td /tr tr td align=left valign=topHeading Graphic: /td td align=left valign=top input type=text name=heading value=?php echo $heading ? size=35 maxlength=255 ?php include('../../../scripts/forms.css'); ? /td /tr tr td align=left valign=topSection Title: /td td align=left valign=top input type=text name=title value=?php echo $title ? size=35 maxlength=255 ?php include('../../../scripts/forms.css'); ? /td /tr tr td align=left valign=top colspan=2nbsp;/td /tr tr td align=left valign=topDocument Information: /td td align=left valign=top textarea cols=35 name=info rows=5 ?php include('../../../scripts/forms.css'); ??php echo
RE: [PHP] Checking for and @ and a .
Use a regular expression to test the variable submitted by the form. This is an excerpt from my usual validation script using ereg().. I'm sure you can adapt this for your purposes.. if (!ereg('^[-!#$%\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'. '[-!#$%\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'. '[-!#$%\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email_address)) { $send = no; } HTH james -Original Message- From: Philip J. Newman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 2:11 PM To: [EMAIL PROTECTED] Subject: [PHP] Checking for and @ and a . I'm trying to make an email field and I would like to check that its valid by checking for an @ and a . can someone point me in the right direction for this. THanks Philip J. Newman Philip's Domain - Internet Project. http://www.philipsdomain.com/ [EMAIL PROTECTED] Phone: +64 25 6144012 -- 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] Checking for and @ and a .
On 2/27/02 1:10 PM, Philip J. Newman [EMAIL PROTECTED] wrote: I'm trying to make an email field and I would like to check that its valid by checking for an @ and a . can someone point me in the right direction for this. THanks Philip J. Newman Philip's Domain - Internet Project. http://www.philipsdomain.com/ [EMAIL PROTECTED] Phone: +64 25 6144012 Try this... function emailValidate ($str) { $reg = ^([a-zA-Z0-9._-]+)@([a-zA-Z0-9-])+(\.[a-zA-Z0-9-]+)+$; if (eregi($reg, $str)) { return true; }else{ return false; } } $addy = [EMAIL PROTECTED]; if (emailValidate($addy)) { echo valid; }else{ echo Not Valid!; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] appending to include_path
On Wed, 27 Feb 2002, darcy w. christ wrote: Jason Wong wrote: On Thursday 28 February 2002 02:30, darcy w. christ wrote: Hi Jason, i think you misunderstood what i was asking. i am doing exactly what you described below. My question is whether there is a way to not overwrite the include_path variable, but instead to append certain paths within my virtual server's setup to the master include_path that is setup in my php.ini file. My apologies :) Not sure how you can do it from the setup. But from within php there are functions to retrieve and set the include path. i see the get_cfg_var, but i'm not sure what to use to set that variable. Any suggestions? I think ini_get() ini_set() is what you want. -- Jason Wong -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Unable to display images on browser
Hello, Thanks for your help. This is what I have for file1.php and ddownloadfile.php. What I want is to click on Donwnload now link and be able to get the file out of the database and display it on the browser. Thank you in adavance, -Teresa file1.php --- ?php while ($row = mysql_fetch_array($result)) { ? SOME_HTLM_CODE_TO_DISPLAY_DB_FIELDS_GOES_HERE; // img src=\ddownloadfile.php?fileId=?php echo $row[PicNum]; ?\ a href=ddownloadfile.php?fileId=?php echo $row[PicNum]; ? Download Now /a/font /td /tr ?php ddownloadfile.php -- ? $dbQuery = Select PicNum, size, type, description, Image; $dbQuery .= FROM Images WHERE PicNum = $fileId; $result = mysql_query($dbQuery) or die (Could not get file list: . mysql_error() ); echo Sent Query successfullybr; if ( mysql_num_rows($result) == 1) { $fileType = @mysql_result($result,0, type); $fileContent = @mysql_result($result, 0, Image); $filedesc = @mysql_result($result,0, description); $filenum = @mysql_result($result,0, PicNum); Header(Content-type: image/gif); echo $fileContent; } else { echo Record does not exist; } // else ? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 4:56 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] Unable to display images on browser Well, you probably need to do something like this: file1.php (where you want to display an image) img src=getimage.php?fileId=42 end file1 getimage.php (the ? needs to be on the first line in the file) ? Code to connect and selected DB not included - $dbQuery = Select PicNum, size, type, description, Image; $dbQuery .= FROM Images WHERE PicNum = $fileId; $result = mysql_query($dbQuery) or die (Could not get file list: . mysql_error() ); if ( mysql_num_rows($result) == 1) { $fileType = @mysql_result($result,0, type); $fileContent = @mysql_result($result, 0, Image); $filedesc = @mysql_result($result,0, description); $filenum = @mysql_result($result,0, PicNum); // Header(Content-type: $fileType); header (Content-type: image/gif); $im = ImageCreateFromString ($fileContent); ImageGif ($im); } else { //Insert code to display error.gif } // else ? ---end getimage.php Good Luck /Joakim -Original Message- From: Narvaez, Teresa [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 2:08 AM To: 'Dean Householder'; [EMAIL PROTECTED] Subject: [PHP] Unable to display images on browser Hello, I do not understand why I can't display images retrieved from MySQL on my browser(IE 4.0). When I retrieve the image from MYSQL I set the Header function to change the type of content(image/gif) I am sending to the browser. However, the browser displays an box with an X in it. I would greatly appretiate any ideas/help. Here is the piece of code: Thanks in advance! -Teresa ? Code to connect and selected DB not included - $dbQuery = Select PicNum, size, type, description, Image; $dbQuery .= FROM Images WHERE PicNum = $fileId; $result = mysql_query($dbQuery) or die (Could not get file list: . mysql_error() ); echo Sent Query successfullybr; if ( mysql_num_rows($result) == 1) { $fileType = @mysql_result($result,0, type); $fileContent = @mysql_result($result, 0, Image); $filedesc = @mysql_result($result,0, description); $filenum = @mysql_result($result,0, PicNum); // Header(Content-type: $fileType); Header(Content-type: image/gif); echo $fileContent; } else { echo Record does not exist; } // else ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Getting the compression rate of a jpeg image possible?
Hi there, I am wondering if it is possible to get the compression rate of a jpeg file?! As I did read on php.net creating a jpeg gives you a third parameter with the compression. Default is 75 %. So asuming the user has an image compressed with 50 % and he does upload this picture through my application, PHP will blow up the size by going back to 75 %. Quality stayes the same. So it is absolutly neccessary to know that value. Does somebody know how to get this thing? Thanx for your help guys, Cheers Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea
Maybe it's just an issue of using get rather than post. in the form. Hugh For every complex and difficult problem there is always a simple, easy answer--that's wrong. - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 27, 2002 8:55 AM Subject: Re: [PHP] textarea On Wednesday 27 February 2002 23:44, Edward van Bilderbeek - Bean IT wrote: i think you don't understand the problem it's just a textarea, no php has to do with it: You said it yourself, so what's this doing on a PHP list :) textarea name='test'/textarea when i try to FILL it with tekst (so, in my browser) it is working for a certain amount of characters, but above it, the submit button is clickable, but doesn't take any action... Browsers have a limit to the amount of stuff you can enter into a textarea. You're probably coming up against that limit. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* An age is called Dark not because the light fails to shine, but because people refuse to see it. -- James Michener, Space */ -- 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] How to get the url of frameset
Hi, Within a frame I would like to get the url of the frameset and include a different css dependent on the url. I am using apache and php, and first tried with HTTP_REFERER. However, this only works the first time you call the frame and not when you have a link (the referring page will be the frame and not the frameset). Any tips how to get the url of the frameset? Thanks, Patrick. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form Annoyances
James, Look into stripslashes(): http://www.php.net/manual/en/function.stripslashes.php and htmlspecialchars(): http://www.php.net/manual/en/function.htmlspecialchars.php Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED] On Wednesday, February 27, 2002, at 11:08 AM, James Taylor wrote: I'm having this one issue that's really bugging me - I have a textarea where you can type in something - After typing it in, it goes to another page asking you to verify, if it's correct, it inserts it into a database. The page that asks you to verify holds the value of the textbox in a hidden form field. If the value the user entered in contains any single (') or double () quotes, it will mess everything up. Single quotes end up having a backslash thrown automatically in front of it, and it inserts it into the database WITH THE backslash. If there are double quotes, the HTML will get messed up due to the fact that when it sees the quote, it will cut off the rest of the value because if: value=this is an example: Hello how are you. everything after example: is going to get cut off. I tried putting the value in a query string, but when traveling across two pages, it seems to do the exact same thing. Any suggestions? -- 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] Checking for and @ and a .
Yo thanks this dose work. (o; haven't got to functions in the book yet - Original Message - From: Chris Burnett [EMAIL PROTECTED] To: Philip J. Newman [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, February 28, 2002 8:25 AM Subject: Re: [PHP] Checking for and @ and a . On 2/27/02 1:10 PM, Philip J. Newman [EMAIL PROTECTED] wrote: I'm trying to make an email field and I would like to check that its valid by checking for an @ and a . can someone point me in the right direction for this. THanks Philip J. Newman Philip's Domain - Internet Project. http://www.philipsdomain.com/ [EMAIL PROTECTED] Phone: +64 25 6144012 Try this... function emailValidate ($str) { $reg = ^([a-zA-Z0-9._-]+)@([a-zA-Z0-9-])+(\.[a-zA-Z0-9-]+)+$; if (eregi($reg, $str)) { return true; }else{ return false; } } $addy = [EMAIL PROTECTED]; if (emailValidate($addy)) { echo valid; }else{ echo Not Valid!; } -- 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: Changed localhost?
Anthony Rodriguez wrote: All of a sudden Apache is nor running correctly under Windows 98. It appears that somehow localhost was changed from 127.0.0.1 to something else. Does the fact that I now have a 24/7cable connection to the Net cause the problem? Thanks! Anthony Rodriguez ([EMAIL PROTECTED]) Since you are using a cable modem, You are using a firwall too,Right? Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Form Annoyances
Hi there :) Use the addslashes() function prior to insertion to database, and stripslashes() on retrieval from db before you display it. //prior to db insertion $myvar = addslashes($myvar); //on retrieval $myvar = stripslashes($myvar); Since you are wanting to display it to the user before inserting to the databse, you'll have to add, then strip before displaying, and then use the addslashes() again prior to inserting. When retrieving this data at a later point you'll have to use stripslashes() again. Hope this helps, Joe :) James Taylor [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I'm having this one issue that's really bugging me - I have a textarea where you can type in something - After typing it in, it goes to another page asking you to verify, if it's correct, it inserts it into a database. The page that asks you to verify holds the value of the textbox in a hidden form field. If the value the user entered in contains any single (') or double () quotes, it will mess everything up. Single quotes end up having a backslash thrown automatically in front of it, and it inserts it into the database WITH THE backslash. If there are double quotes, the HTML will get messed up due to the fact that when it sees the quote, it will cut off the rest of the value because if: value=this is an example: Hello how are you. everything after example: is going to get cut off. I tried putting the value in a query string, but when traveling across two pages, it seems to do the exact same thing. Any suggestions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: intranet security
I've done it :-) But be careful. There are dozens of way to implement this. My way is simple, but makes use of too many sql queries I believe. Could have stored everything in one line and grab it at user's login, but anyway My current way seems more logical to follow and update. I have created these 'groups of power', where you can add/remove users. Since an user can be part of more than one group, I store in a session array these groups ids. In a page where it's necessary to verify if the user (actually, the groups he's attached to) can perform certain actions, there's a little check like this: $var = ''; foreach ($_SESSION['user']['group_ids'] as $value) { $var .= OR group_id = '$value' ; } And a Mysql query: // 'groups' is a table with a collumn for every section of the site. $sql = SELECT section_power FROM groups WHERE id = 0 . $var . AND active = 1; $res = mysql_query($sql); while (list($section_power) = mysql_fetch_array($res)) { // using parse_str() since the data is stored om Mysql as: // r=1w=1d=0m=0 parse_str($section_power); // More on discover_power() below discover_powers($r,$w,$d,$m); } function discover_powers($r, $w, $d, $m) { // If there's no current power defined: if (!isset($_SESSION['user']['powers']['section']['w'])) { // User's power the same as the var; $_SESSION['user']['powers']['section']['w'] = $w; } else { // Else, in the while loop above, he's assigned to one group with power = 0 // and another one with power = 1, let the user get 1 if ($w $_SESSION['user']['powers']['section']['w']) { $_SESSION['user']['powers']['section']['w'] = $w; } } Well, pretty much is like this. I am close to redesign the whole thing because of the many SQL queries, the while loop calling two functions for every group the user is attached, and because it's plain a 'not-elegant' solution. Feel free to steal any ideas :-D -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fw: [PHP] maximum string length
Steven (and anyone else interested), I was working on email earlier in the day, and have just cleared my desk of all that 'junk'. Your reading for tonight (1024/1000/997 byte line length limits in email) can be found in the discussion of RFC 2646 available from sunsite.dk (and elsewhere) - one of the MIME format 'standards' for email. If you're that interested!? Regards, =dn It may be able to store 8MB, but each line can only hold 1024 characters. I ran into this using a string variable to store the message body of an HTML email. If I did not put a '\n' at the end of each line, I would get random '!' placed through the sent email. Maybe you know more about what Kancha is planning to do with this massive string, but the above criticism only applies to strings used to 'write' an email msg - and only to certain email servers/clients at that. It doesn't apply to strings within PHP, eg reading in the whole of some large text file and storing it in a string. Regards, =dn On Wednesday, February 27, 2002, at 07:55 AM, Bogdan Stancescu wrote: Generally more than you'll ever need :-) About 8 MB by default. Bogdan Kancha . wrote: What is the maximum number of characters a variable of type string can hold ?? Is there a restriction ?? $x = adfafasfadfaf what is the max number of characters $x can hold ?? __ Do You Yahoo!? Yahoo! Greetings - Send FREE e-cards for every occasion! http://greetings.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 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] apostrphe's entered into MySQL database
Why isn't addslashes() working? You addslashes then you stripslashes() :-) Anyway, how about mysql_escape_string()? -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Unusual Form situation?
Thanks for the help! Those output variables are pretty interesting - I didn't know that image maps could be built in PHP with relative ease. :) So I learned two things for the price of one. :) -Mike -Original Message- From: Sam Masiello [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 1:48 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Unusual Form situation? I assume that you are doing something like this for your image: input type=image src=path/to/image/image.gif border=0 name=myimage Given that, PHP gives you $myimage_x and $myimage_y which correspond to the X and Y coordinates that were clicked on the image from the user. So on the page that your form submits to, you can do the following: if (isset($myimage_x) || isset($myimage_y)) { // do something } If the image was clicked, this will submit your form, and both $myimage_x and $myimage_y will be set. HTH Sam Masiello Software Quality Assurance Engineer Synacor (716) 853-1362 X289 [EMAIL PROTECTED] - Original Message - From: SpyProductions Support Team [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 27, 2002 1:33 PM Subject: [PHP] Unusual Form situation? I have form I am working with and trying to add some PHP processing to the form's contents. The form is a html template used by a CGI script. So, instead of having a 'submit' button for the form's content, there is a GIF. The CGI apparently reads the GIF as a button to submit the form's content and move on. How would I go about getting php to recognize this GIF as such? Typically for forms I use: if ($submit) { blah, blah, blah } Would I use if ($gifname)? Would the the GIF's name be the ALT tag? Or am I going to have to sift through the arcane CGI to find some action? Can I make the PHP come to life using the ACTION section of the form (which only refers to the CGI right now)? Thanks, -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: intranet security
Thank you. What I am trying to avoid is doing a parsing of the string everytime a user comes in. My thought is to use a user table, a group table and then a permissions table that will allow the user to be a member of more than one group. Thank you, -Scott On Wed, 27 Feb 2002, Julio Nobrega Trabalhando wrote: I've done it :-) But be careful. There are dozens of way to implement this. My way is simple, but makes use of too many sql queries I believe. Could have stored everything in one line and grab it at user's login, but anyway My current way seems more logical to follow and update. I have created these 'groups of power', where you can add/remove users. Since an user can be part of more than one group, I store in a session array these groups ids. In a page where it's necessary to verify if the user (actually, the groups he's attached to) can perform certain actions, there's a little check like this: $var = ''; foreach ($_SESSION['user']['group_ids'] as $value) { $var .= OR group_id = '$value' ; } And a Mysql query: // 'groups' is a table with a collumn for every section of the site. $sql = SELECT section_power FROM groups WHERE id = 0 . $var . AND active = 1; $res = mysql_query($sql); while (list($section_power) = mysql_fetch_array($res)) { // using parse_str() since the data is stored om Mysql as: // r=1w=1d=0m=0 parse_str($section_power); // More on discover_power() below discover_powers($r,$w,$d,$m); } function discover_powers($r, $w, $d, $m) { // If there's no current power defined: if (!isset($_SESSION['user']['powers']['section']['w'])) { // User's power the same as the var; $_SESSION['user']['powers']['section']['w'] = $w; } else { // Else, in the while loop above, he's assigned to one group with power = 0 // and another one with power = 1, let the user get 1 if ($w $_SESSION['user']['powers']['section']['w']) { $_SESSION['user']['powers']['section']['w'] = $w; } } Well, pretty much is like this. I am close to redesign the whole thing because of the many SQL queries, the while loop calling two functions for every group the user is attached, and because it's plain a 'not-elegant' solution. Feel free to steal any ideas :-D -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] DB2 from PHP : ODBC ?
Hi phpers, Does anybody know if accessing DB2 using ODBC runs ok ? I've never tried that and was wondering if there are any tips/limitations (like configuration settings on both ends...) ? Thanks, Mário -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] objects in sessions.
If you register an object as a session variable, do you need to include the objects class *before* start_session()? What if I use serialize() on my object, and then register a variable with the serialized data; then I can start_session(), do some other things, then include the class definition, then unserialize()? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] DB2 from PHP : ODBC ?
Mário, It runs fine, either using the unified-ODBC or compiling PHP --with-iodbc as per the HOWTO at www.iodbc.org and using real ODBC drivers. As in every case with ODBC, the quality of your experience will be determined by the quality of the ODBC drivers you use. OpenLink provides free, non-expiring downloads at www.openlinksw.com for development and testing. Hope this helps! Best regards, Andrew Hill Director of Technology Evangelism http://www.openlinksw.com/virtuoso/whatis.htm OpenLink Virtuoso Internet Data Integration Server -Original Message- From: Mario Bittencourt [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 3:27 PM To: [EMAIL PROTECTED] Subject: [PHP] DB2 from PHP : ODBC ? Hi phpers, Does anybody know if accessing DB2 using ODBC runs ok ? I've never tried that and was wondering if there are any tips/limitations (like configuration settings on both ends...) ? Thanks, Mário -- 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] Uploading Files through PHP
I'm trying to let users upload word files through a PHP form but its not working! The script keeps telling me that the file path doesn't exist. HERE'S THE CODE I USE IN THE FORM PAGE: FORM ENCTYPE=multipart/form-data ACTION=freelancers/uploaded_word.php METHOD=POST INPUT TYPE=hidden name=MAX_FILE_SIZE value=1000 p align=center input type=submit value=Upload name=submit input type=file name=wordcv size=30 /p /form is the code on the form page, when i submit i'm told the $wordcv is a null. WHY?? -- Regards, Georgie Casey [EMAIL PROTECTED] *** http://www.filmfind.tv Ireland's Online Film Production Directory *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] apostrphe's entered into MySQL database
I don't see why addslashes wouldn't work, but why not roll your own? $dbStr = preg_replace(/'/, /\\'/); I believe that, in MySQL, you can also double-up single quotes to escape them: $dbStr = preg_replace(/'/, /''/); HTH Matt On Wed, 27 Feb 2002, Tim Thorburn wrote: Hi, I've sent a few emails thus far regarding adding apostrophe's through a PHP script form into a MySQL database. The responses I received indicated to me that I needed to get my hosting company to activate magic_quotes_gpc. After several days of talking with what seems to be the sole tech support person left at my hosting company - I was told that the magic_quotes_gpc variable is not supported by them. Sooo ... this leaves me in a rather awkward situation. I need to have a basic content management system up and running in the extremely near future that will be utilized by a great number of individuals. If when an apostrophe is entered - all the information entered through the form is rejected by the database - the entire endeavour suddenly becomes rather useless. I know that if I enter a \ before any apostrophe's in the form, it all works well ... but I highly doubt that the large number of volunteer's we're going to be working with here will take the time to add them, or even remember 5 minutes after I tell them. Does anyone have any possible solutions for this problem? I'll include the portion of code that seems to be causing the problems now ... I'm already using the addslashes() command and it is not working ... I'm desperate at this point ... Again, the following works flawlessly on my local test machine running Apache 1.3.23 and PHP 4.1.1 with MySQL 3.23.39 but not at all on my web host running Apache 1.3.12 and PHP 3.0.16 with MySQL 3.22.32 Thanks in advance, -Tim ?php $db = mysql_connect(localhost, , ); mysql_select_db(edoinfo,$db); if ($submit) { // here if no ID then adding else we're editing if ($id) { $sql = UPDATE ai_data SET section='$section',subsection='$subsection',heading='$heading',title='$title',info='$info',entry=NOW() WHERE id=$id; } else { $sql = INSERT INTO ai_data (section,subsection,heading,title,info,entry) VALUES ('$section','$subsection','$heading','$title','$info',NOW()); } // run SQL against the DB $result = mysql_query($sql); echo Record updated/edited!p; echo a href='add_info.php' class='comcal'ADD A RECORD/a; } elseif ($delete) { // delete a record $sql = DELETE FROM ai_data WHERE id=$id; $result = mysql_query($sql); echo $sql Record deleted!p; echo a href='add_info.php' class='comcal'ADD A RECORD/a; } else { // this part happens if we don't press submit if (!$id) { // print the list if there is not editing $result = mysql_query(SELECT * FROM ai_data,$db); while ($myrow = mysql_fetch_array($result)) { printf(a href=\%s?id=%s\ class='comcal'%s/a \n, $PHP_SELF, $myrow[id], $myrow[title]); printf(a href=\%s?id=%sdelete=yes\ class='comcal'(DELETE)/abr, $PHP_SELF, $myrow[id]); } } ? p a href=?php echo $PHP_SELF? class=comcalADD A RECORD/a p form method=post action=?php echo $PHP_SELF? ?php if ($id) { // editing so select a record $sql = SELECT * FROM ai_data WHERE id=$id; $result = mysql_query($sql); $myrow = mysql_fetch_array($result); $id = $myrow[id]; $section = $myrow[section]; $subsection = $myrow[subsection]; $heading = $myrow[heading]; $title = addslashes($myrow[title]); $info = addslashes($myrow[info]); $entry = $myrow[entry]; // print the id for editing ? input type=hidden name=id value=?php echo $id ? ?php } ? /td td align=left valign=topSectionfont size=1/font:/td td align=left valign=top input type=text name=section value=?php echo $section ? size=35 maxlength=100 ?php include('../../../scripts/forms.css'); ? /td /tr tr td align=left valign=topSub-Section: /td td align=left valign=top input type=text name=subsection value=?php echo $subsection ? size=35 maxlength=100 ?php include('../../../scripts/forms.css'); ? /td /tr tr td align=left valign=topHeading Graphic: /td td align=left valign=top input type=text name=heading value=?php echo $heading ? size=35 maxlength=255 ?php include('../../../scripts/forms.css'); ? /td /tr tr td align=left valign=topSection Title: /td td align=left valign=top input type=text name=title value=?php echo $title ? size=35 maxlength=255 ?php include('../../../scripts/forms.css'); ? /td /tr tr td
Re: [PHP] apostrphe's entered into MySQL database
Whoops...helps if I write it legally. $dbStr = preg_replace(/'/, /\\'/, $dbStr); $dbStr = preg_replace(/'/, /''/, $dbStr); M On Wed, 27 Feb 2002, Matt Drake wrote: I don't see why addslashes wouldn't work, but why not roll your own? $dbStr = preg_replace(/'/, /\\'/); I believe that, in MySQL, you can also double-up single quotes to escape them: $dbStr = preg_replace(/'/, /''/); HTH Matt On Wed, 27 Feb 2002, Tim Thorburn wrote: Hi, I've sent a few emails thus far regarding adding apostrophe's through a PHP script form into a MySQL database. The responses I received indicated to me that I needed to get my hosting company to activate magic_quotes_gpc. After several days of talking with what seems to be the sole tech support person left at my hosting company - I was told that the magic_quotes_gpc variable is not supported by them. Sooo ... this leaves me in a rather awkward situation. I need to have a basic content management system up and running in the extremely near future that will be utilized by a great number of individuals. If when an apostrophe is entered - all the information entered through the form is rejected by the database - the entire endeavour suddenly becomes rather useless. I know that if I enter a \ before any apostrophe's in the form, it all works well ... but I highly doubt that the large number of volunteer's we're going to be working with here will take the time to add them, or even remember 5 minutes after I tell them. Does anyone have any possible solutions for this problem? I'll include the portion of code that seems to be causing the problems now ... I'm already using the addslashes() command and it is not working ... I'm desperate at this point ... Again, the following works flawlessly on my local test machine running Apache 1.3.23 and PHP 4.1.1 with MySQL 3.23.39 but not at all on my web host running Apache 1.3.12 and PHP 3.0.16 with MySQL 3.22.32 Thanks in advance, -Tim ?php $db = mysql_connect(localhost, , ); mysql_select_db(edoinfo,$db); if ($submit) { // here if no ID then adding else we're editing if ($id) { $sql = UPDATE ai_data SET section='$section',subsection='$subsection',heading='$heading',title='$title',info='$info',entry=NOW() WHERE id=$id; } else { $sql = INSERT INTO ai_data (section,subsection,heading,title,info,entry) VALUES ('$section','$subsection','$heading','$title','$info',NOW()); } // run SQL against the DB $result = mysql_query($sql); echo Record updated/edited!p; echo a href='add_info.php' class='comcal'ADD A RECORD/a; } elseif ($delete) { // delete a record $sql = DELETE FROM ai_data WHERE id=$id; $result = mysql_query($sql); echo $sql Record deleted!p; echo a href='add_info.php' class='comcal'ADD A RECORD/a; } else { // this part happens if we don't press submit if (!$id) { // print the list if there is not editing $result = mysql_query(SELECT * FROM ai_data,$db); while ($myrow = mysql_fetch_array($result)) { printf(a href=\%s?id=%s\ class='comcal'%s/a \n, $PHP_SELF, $myrow[id], $myrow[title]); printf(a href=\%s?id=%sdelete=yes\ class='comcal'(DELETE)/abr, $PHP_SELF, $myrow[id]); } } ? p a href=?php echo $PHP_SELF? class=comcalADD A RECORD/a p form method=post action=?php echo $PHP_SELF? ?php if ($id) { // editing so select a record $sql = SELECT * FROM ai_data WHERE id=$id; $result = mysql_query($sql); $myrow = mysql_fetch_array($result); $id = $myrow[id]; $section = $myrow[section]; $subsection = $myrow[subsection]; $heading = $myrow[heading]; $title = addslashes($myrow[title]); $info = addslashes($myrow[info]); $entry = $myrow[entry]; // print the id for editing ? input type=hidden name=id value=?php echo $id ? ?php } ? /td td align=left valign=topSectionfont size=1/font:/td td align=left valign=top input type=text name=section value=?php echo $section ? size=35 maxlength=100 ?php include('../../../scripts/forms.css'); ? /td /tr tr td align=left valign=topSub-Section: /td td align=left valign=top input type=text name=subsection value=?php echo $subsection ? size=35 maxlength=100 ?php include('../../../scripts/forms.css'); ? /td /tr tr td align=left valign=topHeading Graphic: /td td align=left valign=top input type=text name=heading value=?php echo $heading ? size=35 maxlength=255 ?php include('../../../scripts/forms.css'); ? /td /tr tr td align=left
[PHP] Did everybody see the security warning at php.net?
http://www.php.net/ [27-Feb-2002] Due to a security issue found in all versions of PHP (including 3.x and 4.x), a new version of PHP has been released. Details about the security issue are available here. All users of PHP are strongly encouraged to either upgrade to PHP 4.1.2, or install the patch (available for PHP 3.0.18, 4.0.6 and 4.1.0/4.1.1). http://security.e-matters.de/advisories/012002.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Unsuscribe
Please unscribe me from this list I did not sign up for the stuff