[PHP] chmod error?
Hi all...I want to change the ownership of a file that is created via php..so i uses chmod command in my php script.. Upon execution of the script i get an error saying command not permitted with a line number pointing to my chmod command. I'm running apache as user nobody for security reasons. any hints as to how i can get chmod to work would be great... John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] chmod error?
Hello. First off, to change ownership you want chown, not chmod. Also, chown isn't always permitted depending on the cicrumstances of who owns the directory or the specific file to begin with. If you're web server is running as nobody it will only be able to create files in a directory owned by nobody (or world writable...but that's stupid) or modify a file that already exists and owned by nobody. If I may ask, what are you trying to change the ownership for / to? Henrik On Wednesday 10 April 2002 02:06, John Weez wrote: Hi all...I want to change the ownership of a file that is created via php..so i uses chmod command in my php script.. Upon execution of the script i get an error saying command not permitted with a line number pointing to my chmod command. I'm running apache as user nobody for security reasons. any hints as to how i can get chmod to work would be great... John -- -- Henrik Hudson [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file locks
Liam Gibbs wrote: Is there a way for a script to tell if the file it's trying to access is locked by other script (via flock()) or not. I need to make script wait untill other script running in a parallel thread releases the lock on the file. Without testing, would this work? Just a suggestion (read: shot in the dark) that may work. while(!$filehandle) { $filehandle = fopen(file_in_question, r/w/whatever); } Tnx in advance. You're welcome in advance. :) __ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ How is it possible that the file locked with exclusive lock can be opened by another call to fopen in the same script? Am i getting it all wrong, or the second call to fopen in the next code should fail? $fp=fopen(somefile, w); flock($fp, LOCK_EX); $fp1=fopen(somefile, w); I'm using php 4.1.2 windows version on apache 1.2.23. Armin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: how to send an email to everone listed in a file
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Hi all. I really wish I could contribute here and help people out too but i don't know a fraction of the stuff that you gurus do. I try not to bug you all with too many questions and try to figure it out/learn on my own as much as possible. I am trying to figure out how i could send an email to everyone listed in a file. the file contains a name followed by a space followed by their email followed by a carriage return. the number of entries in the file changes. i would like to send the newletter to everyone in the file and have their name put in the email as well. (since i don't endorse spam I assure you this isn't for such purpose). From what i'm able to figure out on my own, I think i'm going to need something that reads the file into some array which separates each entry based on the \n and the space and some sort of loop (for, while, etc). I have no idea how complex of a task this is but i would appreciate any help or ideas! thanks! (note: i'm on php4.0.4pl1) file() will read the file into an array; you could then use explode() on each element of the array to extract the email address, and mail() to send the message. -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MySQL connection from non-localhost
I was just wondering if there was a way to connect to a MySQL server on a server other than the one that your php script is on. I tried just putting in the URL of the site in place of localhost but that didn't work. Is there anything special that I have to do to get it to work? Thanks, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: MySQL connection from non-localhost
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... I was just wondering if there was a way to connect to a MySQL server on a server other than the one that your php script is on. I tried just putting in the URL of the site in place of localhost but that didn't work. Is there anything special that I have to do to get it to work? Thanks, Dave Are the grants of the remote host set to accept anything other than localhost? -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Php + Mysql Hosting problem
I have made a web site containing Php and Mysql script And I have applied for a free web hosting account in www.spaceports.com there are two folder i can use: Public_html Cgi-bin which one i should put mysql files in? and what user name and password should i use for connecting mysql server? the current setting is mysql_connect (localhost, Administrator); thank you! and which free hosting is recommanded for php + mysql? I can only found this spaceports free! Thank you very much! __ ¦èªù³½ SeeMon Simonk ICQ#: 25943733 Current ICQ status: + More ways to contact me i See more about me: __ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML HELP
Why don't you use this class...it's really good! http://sourceforge.net/projects/phpxpath/ Analysis Solutions [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hey Christopher: On Mon, Apr 08, 2002 at 09:14:08PM -0400, Christopher J. Crane wrote: ok I tried this at your suggestion Not exactly. As mentioned, you've got all sorts of unneded stuff going on. To make sure you're on the right track, start with a new script with just the basics: ?php $Symbols[] = 'ek'; $Symbols[] = 'et'; $URI = 'http://quotes.nasdaq.com/quote.dll?page=xmlmode=stocksymbol='; function StartHandler($Parser, $ElementName, $Attr='') { } function CharacterHandler($Parser, $Line) { } function EndHandler($Parser, $ElementName, $Attr='') { } while ( list(,$Sym) = each($Symbols) ) { $Contents = implode( '', file($URI$Sym) ); $Parser = xml_parser_create('ISO-8859-1'); xml_set_element_handler($Parser, 'StartHandler', 'EndHandler'); xml_set_character_data_handler($Parser, 'CharacterHandler'); if ( xml_parse($Parser, $Contents) ) { echo 'YES!'; } else { echo 'NO!'; } xml_parser_free($Parser); } ? Now, if that works, start flushing out the element/character handlers. Do it little by little to make sure each of your steps are correct. Enjoy, --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session variables and unset
Hello, I have 3 scripts: ## i2.php ?php session_start(); $counter = 1; session_register(counter); header(Location: /i.php); ? ## i.php ?php session_start(); $counter = 0; ### uncomment this to see the difference # session_unregister(counter); session_register(counter); unset($counter); $counter = 4; session_register(counter); header(Location: /i1.php); ? ## i1.php ?php session_start(); print $counter; ? When I open http://host/i2.php on my browser I get 0, though I expect it to be 4. If I uncomment session_unregister(counter); I get 4 as expected. PHP version 4.1.2. Anyone can explain this behavior? Also can anyone try this with say 4.0.5 or older version of PHP? Good luck, Valdas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How creat image pointer from JPG/GIF string?
Robert Cummings wrote: M wrote: I have stored lot of images into BLOB Mysql fields, and need recover it to resize. How can I create some image pointer from string stored into BLOB field? Thanks Miguel imagecreatefromstring() seems to be the candidate... however a comment attached to the help page indicates it is buggy. I suggest trying it out and if that fails then pull your image from the database, write to a temporary file, and then use imagecreatefromjpeg() as per usual. Cheers, Rob. Hello Rob, just to inform that function ImageCreateFromString works ok Thanks for your valuable info Miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] using php for keywords
hi how can i use php to list keywords in search engines ?!? how to index a website keywords via php =) plz mail thx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Empty HTML problem
Hello. Would you try to confirm your server's native response as below? telnet your.server 80 GET /your/authentication_code.php HTTP/1.0 Authorization: Basic base64encoded_ID/PW -- (request header ends with \n * 2) -- !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN HTMLHEAD META http-equiv=Content-Type content=text/html; charset=shift_jis/ HEAD BODY/BODY/HTML -- Do you use I.E? The above HTML may be the auto made by IE... I think I saw the same above when the server's respons is nothing... ,unless this is your own writing. :) and it seems that Apache's behavior rather differs between on Windows and Unix(Linux) HYH K.Tomono -Original Message- From: ayukawa [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 10, 2002 12:17 PM To: [EMAIL PROTECTED] Subject: [PHP] Empty HTML problem Hello, I have a big problem around login script. I made an authentication site with PHP using PHP session. I use my own session handler that store session data into MySQL DB. It worked well on Win2000+Apache. But the problem occured when I put the scripts on TurboLinuxServer7+ Apache. login authentication script output nothing but -- !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN HTMLHEAD META http-equiv=Content-Type content=text/html; charset=shift_jis/ HEAD BODY/BODY/HTML -- It is almost empty HTML I have never expected!! Does anyone know about this kind of matter? Please HELP ME!!! I made php.ini as same as one of Windows. Regards, Hiroshi Ayukawa http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.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 Digest 10 Apr 2002 10:27:56 -0000 Issue 1278
php-general Digest 10 Apr 2002 10:27:56 - Issue 1278 Topics (messages 92311 through 92358): Re: Manipulate the address field in the browser? 92311 by: Dan Harrington 92313 by: Maxim Maletsky Re: AS/400 data access 92312 by: Dan Vande More 92316 by: Matt auth,perm,content management 92314 by: Dennis Gearon splitting array values into usable chunks.. 92315 by: phplists.woodenpickle.com 92317 by: phplists.woodenpickle.com shopping cart suggestions 92318 by: Eugene Lee 92319 by: phplists.woodenpickle.com Re: includes 92320 by: Tom Rogers 92343 by: Tom Rogers Re: Downloading files 92321 by: Jim Koutoumis 92340 by: Jason Wong Re: Php/Pdf application 92322 by: Justin French PHP 4.2.0 RC2 + Apache 2.0.35 .. DirectoryIndex problem 92323 by: Adam Plocher 92324 by: Rasmus Lerdorf 92328 by: Austin Gonyou PCRE - catching a caracter set in a negative class 92325 by: Maxim Maletsky 92332 by: CC Zona Dealing with Query String 92326 by: Vladislav Kulchitski 92330 by: Maxim Maletsky 92333 by: Vladislav Kulchitski 92335 by: Maxim Maletsky LOBS with CURSOR_SHARING=FORCE gives core dump on Oracle 8.1.7.2 92327 by: Prince Help, anyone else using GD2 php 4.1.2 ? 92329 by: Mark W. Humphries 92336 by: Matt Parlane LOBS with CURSOR_SHARING=FORCE gives core dumpf 92331 by: Prince php 4.0.6 file upload security fix 92334 by: peter Empty HTML problem 92337 by: ayukawa 92358 by: K.Tomono Scoping functions in PHP 92338 by: Eric Starr how to send an email to everone listed in a file 92339 by: Police Trainee 92350 by: David Robley no mod_dbase on FreeBSD? 92341 by: Jeff D. Hamann Weird Session headers 92342 by: S.Murali Krishna Re: sablotron XMl XSLT 92344 by: Yasuo Ohgaki unserialize_callback_func 92345 by: Ian allowed tags reg exp 92346 by: Justin French chmod error? 92347 by: John Weez 92348 by: Henrik Hudson Re: file locks 92349 by: rarmin MySQL connection from non-localhost 92351 by: David Johansen 92352 by: David Robley Php + Mysql Hosting problem 92353 by: Simonk Re: XML HELP 92354 by: Michael Virnstein session variables and unset 92355 by: Valdas Andrulis Re: How creat image pointer from JPG/GIF string? 92356 by: M using php for keywords 92357 by: Marc Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Sounds to me like an Apache Alias Directive is what you need. can you get at your apache configuration? :-) http://httpd.apache.org/docs/mod/mod_alias.html -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 09, 2002 4:22 PM To: Kevin Stone Cc: PHP-general Subject: Re: [PHP] Manipulate the address field in the browser? On Tuesday, April 9, 2002, at 05:44 PM, Kevin Stone wrote: Here's a crazy question. Say I have a script (such as a bulliten board script) that is run by many clients (other websites) off of one location on my web account. Think of it as a service of some kind. Is there anyway to trick the browser into displaying the client's domain rather than my own? I would want it to look as though you've never left their website when in fact you are now on mine. Possible? My domain name registrar uses a neat trick called stealth forwarding. It's probably explained in some tutorial on the web, so I won't speculate on how it's done, but the principle is this -- You have a web page hosted at a certain ISP... where the domain name is something like http://isp.com/~eprice/index.html But you just purchased a fancy domain name from an independent domain name registrar (not thru your ISP) and you want to point the new domain name to the old domain name. Unfortunately, the ISP didn't give you a dedicated IP address and they won't give you a virtual host, so you have no way to map your shiny new domain name to your web site. Stealth forwarding essentially makes the entire browser window into one giant new frame. The contents of the frame are http://isp.com/~eprice/index.html, but because the frameset is hosted by the indie domain name registrar, and they have your shiny new domain name mapped to a virtual host on their servers or something, it looks like (judging from the URL bar) a user is browsing http://shinynewdomainname.com, not http://isp.com/~eprice/index.html. The only problem is that (a) it relies on frames, so it might not work for all browsers (and
[PHP] Re: Scoping functions in PHP
No, there's nothing like private or public functions/methods. There's no way preventing someone using your private functions/methods. Eric Starr [EMAIL PROTECTED] schrieb im Newsbeitrag 000e01c1e041$d931cc20$[EMAIL PROTECTED]">news:000e01c1e041$d931cc20$[EMAIL PROTECTED]... I am a Java programmer learning PHP. In Java you can have a class that contains public and private functions. Only the public functions are accessible outside of the class. Does PHP have a way to hide functions within a class (i.e. make the private)? My concern is that there are some functions that you don't want anyone being able to call...only local functions within the same class should be able to call it. I'll give an example below: ?php // myClass.php3 class myClass { function f1 // I want this one to be public { f2(); } function f2 // I want this one to be private {} } ? ?php include 'myClass.php3'; $p = new myClass(); $p-f1(); // I want this to be a valid function call $p-f2(); // I want this to be an invalid function call ? Any help would be greatly appreciated. Eric Starr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: allowed tags reg exp
Hi try this (untested) ? // replace and and friends with their html equivelants. $input = htmlenitities($input); $input = preg_replace(!lt;(b|i|u)gt;(.*?)lt;/\\1gt;!is, $1$2/$1, $input); echo $input; ? I use something like this on one of my sites, though I check as the user inputs the info whether or not there are matching opening and closing tags before inputting to the db, and later echoing them out and doing the conversions... Hope it helps, anyway. ~James Justin French [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi all, Further to a discussion we had yesterday about the danger of onLoad, onMouseOver, etc etc of allowed tags when using strip_tags(), I've decided to look at the issue from another angle. For the limited set of tags I usually allow on user input, BIU, I'm going take the approach of deleting anything I don't specifically TRUST, rather than deleting things I don't trust. For such simple tags, It seems to me to be a smarter move to delete anything in the tag apart from the actual tag. Banything else becomes B This eliminates the danger of people putting anything evil like onmouseover=javascript:self.close(); into my small set of allowed tags. So, I'd like a regexp which looks for multiple occurences of a tag (let's take B for an example), and throw out anything not needed. In English, I guess it looks like: look for a followed by a b (case insensitive), then throw away anything up to the first we find. Better still would be a regexp or function that checks for b|i|u, or a passed set of tags. I'm aware that this type of hard-line approach will prevent B id=foo, and I will also have problems on things like FONT face=something and A HREF=foo.php, but I plan to devise some psuedo tags for links, and don't require font tags, image tags, etc etc. Many thanks in advance, Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mailing list using mail()
Hi, the combination of PHP and mysql and the ease of use of the mail() function obviously leads me to believe that it *should* be a singe to use php to send customised messages to all my users , of whom I have details in a mysql table by simply running a select * from table and then using a while loop to run through every row and sending an e_mail to $user_in_table. The obvious problem here is that ( in my case 17 000 users) this can easily kill the mail server and could also cause the script to timeout or ( if increasing the timeout) kill the server outright. So, what are my options? Should I be attempting this ( if not, how can I keep others that are hosting on my machines from trying this with their own tables) Should I just use one message and append the BCC: line of the one message? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql
Hi guys, I've been looking on the net and the php docs for a simple mysql query solution, can someone please let me know the best way to get the values of a query that only returns 1 record? All the select query examples on the net are examples of multiple records being returned, and therefor, there is repition methods shown. For this I don't need any repitition, I just need to know the best way to get the DB values from the query into variables. Cheers. -Mason
RE: [PHP] mysql
select * from table_name where criteria=whatever limit 1; -Original Message- From: Mason Batley [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 11, 2002 12:02 AM To: [EMAIL PROTECTED] Subject: [PHP] mysql Hi guys, I've been looking on the net and the php docs for a simple mysql query solution, can someone please let me know the best way to get the values of a query that only returns 1 record? All the select query examples on the net are examples of multiple records being returned, and therefor, there is repition methods shown. For this I don't need any repitition, I just need to know the best way to get the DB values from the query into variables. Cheers. -Mason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mailing list using mail()
Should I just use one message and append the BCC: line of the one message? this could probably be the best way. Petre Agenbag [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, the combination of PHP and mysql and the ease of use of the mail() function obviously leads me to believe that it *should* be a singe to use php to send customised messages to all my users , of whom I have details in a mysql table by simply running a select * from table and then using a while loop to run through every row and sending an e_mail to $user_in_table. The obvious problem here is that ( in my case 17 000 users) this can easily kill the mail server and could also cause the script to timeout or ( if increasing the timeout) kill the server outright. So, what are my options? Should I be attempting this ( if not, how can I keep others that are hosting on my machines from trying this with their own tables) Should I just use one message and append the BCC: line of the one message? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] using .htaccess to repoint
Hi, my isp uses wildcard dns to point to the root. I want to put a .htaccess file in the root to repoint the wildcard requests to a sub-folder but leave the normal request alone. plese help or tell me an article i can read(i've looked but haven't found one specifically dealing with this.) adrian.
RE: [PHP] using .htaccess to repoint
Hi, This might be helpful http://rob-mike.php4hosting.com/mike/htaccess/ Lars -Original Message- From: Adrian Murphy [mailto:[EMAIL PROTECTED]] Sent: 10 April 2002 12:29 To: [EMAIL PROTECTED] Subject: [PHP] using .htaccess to repoint Hi, my isp uses wildcard dns to point to the root. I want to put a .htaccess file in the root to repoint the wildcard requests to a sub-folder but leave the normal request alone. plese help or tell me an article i can read(i've looked but haven't found one specifically dealing with this.) adrian. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] printf
I am looking at how to format output Here is what I have. There is a simple currency conversion that I do and the output is just a string of numbers I would like it so that it puts a comma for every 3 spaces...Any clues..oh knowing newsgroup -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mailing list using mail()
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Hi, the combination of PHP and mysql and the ease of use of the mail() function obviously leads me to believe that it *should* be a singe to use php to send customised messages to all my users , of whom I have details in a mysql table by simply running a select * from table and then using a while loop to run through every row and sending an e_mail to $user_in_table. The obvious problem here is that ( in my case 17 000 users) this can easily kill the mail server and could also cause the script to timeout or ( if increasing the timeout) kill the server outright. So, what are my options? Should I be attempting this ( if not, how can I keep others that are hosting on my machines from trying this with their own tables) Should I just use one message and append the BCC: line of the one message? Thanks Alternatively you could use the output from your table to feed a userlist to a dedicated mail list package -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mysql
In article 002401c1e10d$96850910$e700a8c0@horizon, [EMAIL PROTECTED] says... Hi guys, I've been looking on the net and the php docs for a simple mysql query solution, can someone please let me know the best way to get the values of a query that only returns 1 record? All the select query examples on the net are examples of multiple records being returned, and therefor, there is repition methods shown. For this I don't need any repitition, I just need to know the best way to get the DB values from the query into variables. Cheers. -Mason A while or similar should still work with only one record; but of course you could just drop the while and use the 'enclosed' code just once. If you have a particular sample you want to reduce, post it if you need more help. -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: printf
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... I am looking at how to format output Here is what I have. There is a simple currency conversion that I do and the output is just a string of numbers I would like it so that it puts a comma for every 3 spaces...Any clues..oh knowing newsgroup number_format() -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mailing list using mail()
Michael Virnstein wrote: Should I just use one message and append the BCC: line of the one message? this could probably be the best way. Right, but some MTA cannot handle too large header(s). Why don't you use list server in first place? For example, ezmlm support database backends if you are using qmail. PHP has ezmlm_hash function for it. -- Yasuo Ohgaki Petre Agenbag [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, the combination of PHP and mysql and the ease of use of the mail() function obviously leads me to believe that it *should* be a singe to use php to send customised messages to all my users , of whom I have details in a mysql table by simply running a select * from table and then using a while loop to run through every row and sending an e_mail to $user_in_table. The obvious problem here is that ( in my case 17 000 users) this can easily kill the mail server and could also cause the script to timeout or ( if increasing the timeout) kill the server outright. So, what are my options? Should I be attempting this ( if not, how can I keep others that are hosting on my machines from trying this with their own tables) Should I just use one message and append the BCC: line of the one message? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is While needed in MySQL Result with a Limit of 1
Here is my code: mysql_connect(localhost,username,password); $result=mysql_db_query(Database,select * from table_name where criteria=whatever limit 1); while($r=mysql_fetch_array($result) { $Value1=$r[TableFieldName1]; $Value2=$r[TableFieldName2]; echo $Value1, $Value2; } My question is thisis the while statement needed when I'm only returning one record? Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is While needed in MySQL Result with a Limit of 1
No its not. mysql_fetch_array will return an array if a record is found or false if not. Regards Luke - Original Message - From: Brian Drexler [EMAIL PROTECTED] To: Php-General@Lists. Php. Net [EMAIL PROTECTED] Sent: Wednesday, April 10, 2002 1:58 PM Subject: [PHP] Is While needed in MySQL Result with a Limit of 1 Here is my code: mysql_connect(localhost,username,password); $result=mysql_db_query(Database,select * from table_name where criteria=whatever limit 1); while($r=mysql_fetch_array($result) { $Value1=$r[TableFieldName1]; $Value2=$r[TableFieldName2]; echo $Value1, $Value2; } My question is thisis the while statement needed when I'm only returning one record? Brian -- 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: printf
Use number_format() to put a comma between the thousands $foo = 123456789; print number_format($foo); //will print 123,456,789 Ron Allen wrote: I am looking at how to format output Here is what I have. There is a simple currency conversion that I do and the output is just a string of numbers I would like it so that it puts a comma for every 3 spaces...Any clues..oh knowing newsgroup -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: printf
This is what I have and it is not working $converted1 =round($usdamount * $convamount, 2); $converted = number_format($converted1); //echo $amount * $convamount = $convertedbr; echo bYou should receive/b$nbsp $converted b$currency/b; Ron Allen [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I am looking at how to format output Here is what I have. There is a simple currency conversion that I do and the output is just a string of numbers I would like it so that it puts a comma for every 3 spaces...Any clues..oh knowing newsgroup -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions and Opera
While testing a login page with different browsers I noticed that Opera (vers5.02) didn't allow me access to the site despite using the correct input, so I wrote the following pages to test Opera's performance. It seems that Opera doesn't pass registered variables to the new page. IE NS both print the output as expected, but in Opera all variables are empty. Has anyone got any thoughts/solutions/experiences? regards Steve -- ## login page ?php $password = letmein; if (isset($input)){ if ($input == $password){ $auth = 1; session_start(); session_register(enter,input,password,auth); header(Location: 2.php); exit; } } ? body form action=?php echo $PHP_SELF ? method=POST Enter password: input type=text name=input brinput type=submit /form ?php print The value of \$enter is \$enter\br; print The value of \$input is \$input\br; print The value of \$password is \$password\br; print The value of \$auth is \$auth\br; ? -- ## 2.php ?php session_start(); print The value of \$enter is \$enter\br; // empty print The value of \$input is \$input\br; // should print 'letmein' print The value of \$password is \$password\br; // should print 'letmein' print The value of \$auth is \$auth\br; // should print '1' ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: printf
Figured out why it wasn't working, but I need to be able to display the 2 decimals afterwards Ron Allen [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I am looking at how to format output Here is what I have. There is a simple currency conversion that I do and the output is just a string of numbers I would like it so that it puts a comma for every 3 spaces...Any clues..oh knowing newsgroup -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: printf
figured that out as well You need to put the number_format($number,2) afterwards Thanks to both you! Ron Allen [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I am looking at how to format output Here is what I have. There is a simple currency conversion that I do and the output is just a string of numbers I would like it so that it puts a comma for every 3 spaces...Any clues..oh knowing newsgroup -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Is While needed in MySQL Result with a Limit of 1
It seems that you don't understand why mysql_fetch_array is most often used inside a loop. The loop is not required! if you don't put mysql_fetch_array inside a loop, you can only get the first row and that's it, because calling mysql_fetch_array will return the next row in your result. if you expect more than one row, you have to call mysql_fetch_array for as many times as you expect rows. This could be done by calling mysql_fetch_array manually for as many times you need or via some sort of loop. The easiest way to get all rows, although you don't know how many rows you'll get, is using a while loop. Brian Drexler [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Here is my code: mysql_connect(localhost,username,password); $result=mysql_db_query(Database,select * from table_name where criteria=whatever limit 1); while($r=mysql_fetch_array($result) { $Value1=$r[TableFieldName1]; $Value2=$r[TableFieldName2]; echo $Value1, $Value2; } My question is thisis the while statement needed when I'm only returning one record? Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sessions and Opera
Cookies disabled? Or cache? Have you tried a 'fresh' Opera install or a newer version? -- 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 Steve Fitzgerald [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... While testing a login page with different browsers I noticed that Opera (vers5.02) didn't allow me access to the site despite using the correct input, so I wrote the following pages to test Opera's performance. It seems that Opera doesn't pass registered variables to the new page. IE NS both print the output as expected, but in Opera all variables are empty. Has anyone got any thoughts/solutions/experiences? regards Steve -- ## login page ?php $password = letmein; if (isset($input)){ if ($input == $password){ $auth = 1; session_start(); session_register(enter,input,password,auth); header(Location: 2.php); exit; } } ? body form action=?php echo $PHP_SELF ? method=POST Enter password: input type=text name=input brinput type=submit /form ?php print The value of \$enter is \$enter\br; print The value of \$input is \$input\br; print The value of \$password is \$password\br; print The value of \$auth is \$auth\br; ? -- ## 2.php ?php session_start(); print The value of \$enter is \$enter\br; // empty print The value of \$input is \$input\br; // should print 'letmein' print The value of \$password is \$password\br; // should print 'letmein' print The value of \$auth is \$auth\br; // should print '1' ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] XML HELP
ok I tried this code and the array is still empty. By the way, my code looked the way it did because the browser or my mail client cut it off. I had each of the functions on one line for easy reading but because of the wrap I changed it to how you had it, which is how I would normally do it if each function had more than one line to it. ?php //$Symbols[] = 'ek'; //$Symbols[] = 'et'; $Symbols[] = 'IKN'; $URI = 'http://quotes.nasdaq.com/quote.dll?page=xmlmode=stocksymbol='; function StartHandler($Parser, $ElementName, $Attr='') { print b$ElementName:/b ; } function CharacterHandler($Parser, $Line, $StockStuff) { array_push($StockStuff, $Line); print $Linebr\n; } function EndHandler($Parser, $ElementName, $Attr='') { } while ( list(,$Sym) = each($Symbols) ) { global $StockStuff; $StockStuff = array(); $Contents = implode( '', file($URI$Sym) ); $Parser = xml_parser_create('ISO-8859-1'); xml_set_element_handler($Parser, 'StartHandler', 'EndHandler'); xml_set_character_data_handler($Parser, 'CharacterHandler'); if ( xml_parse($Parser, $Contents) ) { echo 'YES!br'; } else { echo 'NO!br'; } xml_parser_free($Parser); print 1st Position in the array = $StockStuff[1]br\n; } ? Christopher J. Crane Network Operations Manager IKON Office Solutions 860.659.6464
[PHP] MSIE 6.0 Cookie/Privacy Question
Hi, I have noticed that my cookies work just fine in MSIE 6.0 if the browser's privacy setting is set to low. However, in all other settings it is not responding. I am using a remote file JS call to set the cookie. The browser will only read cookie from the host that the page is loaded from and I believe that as the remote JS script appears to be part of the html page from the host when loaded. Why would it not work? Also, settings other than privacy set to low, make mention of if host has a Compact Privacy Policy, and Permission without Concent. I don't know how to qualify for these if there is anything we can do we will meet it. Does everyone have problems with this or am I doing something wrong/ Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sessions and Opera
Cookies it was. Thanks Julio Nobrega Trabalhando wrote: Cookies disabled? Or cache? Have you tried a 'fresh' Opera install or a newer version? -- 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 Steve Fitzgerald [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... While testing a login page with different browsers I noticed that Opera (vers5.02) didn't allow me access to the site despite using the correct input, so I wrote the following pages to test Opera's performance. It seems that Opera doesn't pass registered variables to the new page. IE NS both print the output as expected, but in Opera all variables are empty. Has anyone got any thoughts/solutions/experiences? regards Steve -- ## login page ?php $password = letmein; if (isset($input)){ if ($input == $password){ $auth = 1; session_start(); session_register(enter,input,password,auth); header(Location: 2.php); exit; } } ? body form action=?php echo $PHP_SELF ? method=POST Enter password: input type=text name=input brinput type=submit /form ?php print The value of \$enter is \$enter\br; print The value of \$input is \$input\br; print The value of \$password is \$password\br; print The value of \$auth is \$auth\br; ? -- ## 2.php ?php session_start(); print The value of \$enter is \$enter\br; // empty print The value of \$input is \$input\br; // should print 'letmein' print The value of \$password is \$password\br; // should print 'letmein' print The value of \$auth is \$auth\br; // should print '1' ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mailing list using mail()
Is there anyway you could break this up into managable chunks maybe. I'm currently doing something similar in that I'm writing a PHP based list server app that uses a heirarchical grouping system, but mine is broken done into smaller chunks based on group and user permissions. What if you did a 1 second sleep between each user send? While it would take a very long time to parse through the list of users the mail server would still be able to respond quickly and not have PHP timeout. From: Yasuo Ohgaki [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP] Re: mailing list using mail() Date: Wed, 10 Apr 2002 20:46:57 +0900 MIME-Version: 1.0 Received: from [216.92.131.4] by hotmail.com (3.2) with ESMTP id MHotMailBE7D714200A640043720D85C830472400; Wed, 10 Apr 2002 04:47:15 -0700 Received: (qmail 99799 invoked by uid 1010); 10 Apr 2002 11:47:04 - Received: (qmail 99780 invoked by uid 1007); 10 Apr 2002 11:47:00 - From php-general-return-92371-anzak Wed, 10 Apr 2002 04:47:23 -0700 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:[EMAIL PROTECTED] Delivered-To: mailing list [EMAIL PROTECTED] Message-ID: [EMAIL PROTECTED] User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9+) Gecko/20020328 X-Accept-Language: ja, en-us, en References: [EMAIL PROTECTED] [EMAIL PROTECTED] X-Posted-By: 210.154.73.126 Michael Virnstein wrote: Should I just use one message and append the BCC: line of the one message? this could probably be the best way. Right, but some MTA cannot handle too large header(s). Why don't you use list server in first place? For example, ezmlm support database backends if you are using qmail. PHP has ezmlm_hash function for it. -- Yasuo Ohgaki Petre Agenbag [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, the combination of PHP and mysql and the ease of use of the mail() function obviously leads me to believe that it *should* be a singe to use php to send customised messages to all my users , of whom I have details in a mysql table by simply running a select * from table and then using a while loop to run through every row and sending an e_mail to $user_in_table. The obvious problem here is that ( in my case 17 000 users) this can easily kill the mail server and could also cause the script to timeout or ( if increasing the timeout) kill the server outright. So, what are my options? Should I be attempting this ( if not, how can I keep others that are hosting on my machines from trying this with their own tables) Should I just use one message and append the BCC: line of the one message? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: MySQL connection from non-localhost
Dave, Did you use the URL: http://www.domain.com Or did you use the fully-qualified domain name (FQDN): www.domain.com For connecting to the MySQL server, the connection functions expect an FQDN, not a URL. But, you may already know that. Just checking. Regards, Barry C. Hawkins Systems Consultant All Things Computed [EMAIL PROTECTED] On Wed, 10 Apr 2002 19:54:10 +1200 David Robley [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... I was just wondering if there was a way to connect to a MySQL server on a server other than the one that your php script is on. I tried just putting in the URL of the site in place of localhost but that didn't work. Is there anything special that I have to do to get it to work? Thanks, Dave Are the grants of the remote host set to accept anything other than localhost? -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Sessions and Opera
and btw the browsers dont save the registered vars they are stored on the server side... :) the browser only stores a cookie containing the session id ... Tomy Wagner - Original Message - From: Steve Fitzgerald [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 10, 2002 2:38 PM Subject: [PHP] Re: Sessions and Opera Cookies it was. Thanks Julio Nobrega Trabalhando wrote: Cookies disabled? Or cache? Have you tried a 'fresh' Opera install or a newer version? -- 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 Steve Fitzgerald [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... While testing a login page with different browsers I noticed that Opera (vers5.02) didn't allow me access to the site despite using the correct input, so I wrote the following pages to test Opera's performance. It seems that Opera doesn't pass registered variables to the new page. IE NS both print the output as expected, but in Opera all variables are empty. Has anyone got any thoughts/solutions/experiences? regards Steve -- ## login page ?php $password = letmein; if (isset($input)){ if ($input == $password){ $auth = 1; session_start(); session_register(enter,input,password,auth); header(Location: 2.php); exit; } } ? body form action=?php echo $PHP_SELF ? method=POST Enter password: input type=text name=input brinput type=submit /form ?php print The value of \$enter is \$enter\br; print The value of \$input is \$input\br; print The value of \$password is \$password\br; print The value of \$auth is \$auth\br; ? -- ## 2.php ?php session_start(); print The value of \$enter is \$enter\br; // empty print The value of \$input is \$input\br; // should print 'letmein' print The value of \$password is \$password\br; // should print 'letmein' print The value of \$auth is \$auth\br; // should print '1' ? -- 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] Secure storage of credit card information
Lookup in the manual about the mcrypt functions On Wed, 10 Apr 2002, Someone Somewhere wrote: I'm working on a e commerce site and I need to store the credit card info of people who purchase stuff, on the site. How can I encrypt the credit card # put it in a dbase and decrypt it when I need to Using Php4.* and Mysql. -- 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] Secure storage of credit card information
If I where in your shoes I would encrypt the accounts with Mcrypt, setup a separate database, on a separate computer, communicating on a low speed serial line (4800 baud) using ppp, fully fire walling the connection and doing mass logging. Mcrypt Encryption Functions http://www.php.net/manual/en/ref.mcrypt.php -Original Message- From: Someone Somewhere [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 10, 2002 9:48 AM To: [EMAIL PROTECTED] Subject: [PHP] Secure storage of credit card information I'm working on a e commerce site and I need to store the credit card info of people who purchase stuff, on the site. How can I encrypt the credit card # put it in a dbase and decrypt it when I need to Using Php4.* and Mysql. -- 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] newbie html forms primer help
I need some help with html forms. I primer on html forms and variables is much needed. Anybody have some code snipets to share? I'm getting acquainted with $HTTP_POST_VARS but need some help in accomplishing a couple of things. I'd like to collect all checkbox input variables and stick them together in a comma delimited string. I'd also like to display the names and values of the all posted variables. In another language I'm familiar with, this looks like: [formvariables name=thevarname][name]=[value]BR[/formvariables] For passed checkbox input var doh, where values were blah and bleck, the above code would display: doh=blah doh=bleck How do I do this with php? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Clicking Once -- buttons?
use javascript onClick=this.disabled=true; I think that's correct -Original Message- From: Jason Caldwell [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 11, 2002 1:09 PM To: [EMAIL PROTECTED] Subject: [PHP] Clicking Once -- buttons? Is there a way I can ensure the end user clicks the submit button on a given form, *once* ? Can PHP help me with this, or would this be a job for Java? Thanks. Jason -- 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] ini_set doesn't work
[snip mail header info] Hello, why don't you just do an include hello.html; at the end of the file? Because, there are so many files. thanks. [snip mail footer info] but you'd have to put set_ini() in each of your files (unless you're putting it in an auto prepended file) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php