[PHP] Re: Problems with apache and php
I have a small problem, I can make the cgi version of php fine, it runs and installs perfectly, but when I try to make the apache module (i.e. --with-apxs=/path/to/apxs) php crashes apache. can anyone give me any insight on this? What error messages are in Apache log? Do you get a core dump? Have you read the instructions on http://bugs.php.net/ ? Is the apxs you pointed out to PHP the current one matching your Apache installation? What was your configure line for Apache? -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTTP_USER_AGENT?
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... For example in a book discussing PHP 3 it says: ? phpinfo(); ? This works just fine. In a book that discusses PHP 4 it says: ? php_info() ? This gives Fatal error: Call to undefined function: php_info() in c:\inetpub\wwwroot\php\phpinfo.php on line 2. So it's not just backwards compatibility it is careless planning. This is not good. I will have to search hi and lo to determine if a failure is due to incorrect syntax because of version and not just careless typing on my part. As far as I know, php_info() has never been a documented function. The manual has always re-directed requests for php_info to phpinfo. Try it yourself: http://php.net/php_info This is not a new behaviour nor a change in the language -- It's people using an undocumented alias that they shouldn't. I do not understand why people insist on using undocumented features, much less putting them into text books. Don't do that. PHP actually has a pretty good history as far as backwards compatibility goes. Not perfect, perhaps, but pretty good. I suggest you complain to the Author, Technical Editor, or Publisher of the book. If that doesn't suit, feel free to write your web-pages in Fortran 77 :-) -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: xml and max size of xml doc
Hi y'all Has anyone found any problems with the xml parsing functions when the xml document gets quite large. eg, a doc with about 5000 lines (about 200KB) The problem that's occurring is that some of the elements are being broken in two parts If you require more details, please ask, as it's one of my colleagues that is having this problem and I'll need her to pass on an example if needed. I've heard that the DOM is a memory hog... Are you using DOM or the other one, or ??? It's also quite possible that somewhere deep into the XML somebody line-wrapped an element, which is prefectly valid, but that isn't anticipated by your algorithm for reading/parsing the file... That's the most likely source of the problem as described. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP meetup
I just signed up for this, as I would LOVE to be able to talk and interact (in person) with some PHP Developers. As I'm still learning (as we all are), it would be a great opportunity for me to be able to meet up and discuss this wonderful language with my peers. Hopefully that'll come to pass! :o) I emplore all PHP Developers to sign up for MEETUP. You have nothing to loose, and everything to gain! Hey, it would be great if some of these grew into regular things or even turned into full-fledge PHP User Groups... I think it might even be good for PHP user groups to just go ahead and have an informal meeting of this sort anyway. I'm in. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: A question of style ...
An agent goes to an interface that reveals a list of customers from a database. These customers have provided referrals which now reside in a database. The agent selects a referral which is processed by an intermediary script which sets a flag in the database saying that this agent is, has,or will be contacting this referral (to prevent duplicate contact). Then this redirects to the referral's interface where the details about this referral are revealed. The things is... If these are all done by header(Location: ...) then you are needlessly chewing up an awful lot of HTTP connections. HTTP connections are, I think, a very limited and over-strained resource on a busy site. Now, the price *might* be worth it for maintainability... OTOH -- I suspect you could simply include 'processing.inc' in Interface B and have code that's just as maintainable without chewing up two/three/four times as many HTTP connections/processes. You can't scale up when you waste HTTP connections. As far as atomicity (not letting the user abort) goes, I suspect that is really better handled by transactions or, in a very crude way, register_shutdown_function to check that all the results tie out. Actually, modular design and clear interface/API/back-end design often obviate most of what beginners think they need transactions for, and a couple well-placed (and well-thought-out) flags/time-outs can get rid of the rest, until you actually get to the canonical checkbook (or any money) example... You can do those the hard way, but it's usually not as good a solution as a real transaction. This is just my opinion, though, and I've often seen paradigms under fire for all the wrong reasons. It won't scale up is meaningless for a botique/niche site that won't every *NEED* to scale up. And yet you often see a Manager insisting on doing it that way, while wasting a zillion people-hours on lame features and poor design layout and... Ah well. Enough on that topic. I quit looking for a day job so I wouldn't have to worry about that kind of junk any more. :-) -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Emulating Java Exceptions
Hi All, I'm porting Java Code to PHP, my question is: What is the best approach to emulate Java exceptions in PHP4? (I know ZE2 adds exceptions but I can't wait). When a Java method throws an exception it is difficult to handle as a return of an exception object since then I'd have to check in every sinlge line that calls a method if the returned value is an exception and then return and exception etc etc. (Chaning that up to the user would be a nightmare). So I need some clever ideas ;-) http://php.net/set_error_handler http://php.net/trigger_error http://php.net/error_log Pretty much, take those and a little discipline with your programming staff, and you're done... Maybe write some kind of error message system that creates a unique ID for each error message. You can wrap it up in some Objects if that makes you happy. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Write EXIF - is it possible?
Is it possible to write to exif-headers in pictures? I don't think any PHP built-in function will do that. Your options include: 1. Looking at the PHP source and extending it to do what you want. (and contributing that back). 2. Using some external program to do it: http://php.net/exec 3. Digging into the guts of whomever defined EXIF (MPEG folks?) and writing some PHP functions that read/write exif data without screwing up the images. I suspect none of these are terribly difficult -- It's just that nobody else has wanted them badly enough yet to do the work... -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Final Year Computer Science Project involving PHP
The onus is on us to define the problem boundaries, to investigate possible solutions, and to present the results verbally, in writing and (possibly) to demonstrate in action. They like having projects that find solutions (or improve a current sloution) real life problems. You may want to look at http://sourceforge.net for some interesting ideas of projects that are under-staffed, or at http://linuxfund.org (ditto). If there's any particular extra-curricular activity you are interested in, do some thinking on what kinds of software might be particularly useful for that. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: black becomes red w/ imagecreatefromjpeg
It's been over a year since I've had to come to you for help, but your insights and experience are too hard to resist... :-) I don't have a problem with any of the gd functions and they all works fine except that when I try to fill a circle or draw onto an imported image from imagecreatefromjpeg: When I create my working jpg image from scratch: $im = ImageCreate($sizew, $sizeh); $black = ImageColorAllocate($im, 0, 0, 0); I decided to cut out the 200+ lines of stripe drawing code and import the fixed stripped image using imagecreatefromjpeg to draw and fill the circle and arrow onto: ... $im = imagecreatefromjpeg(stripes.jpg); $black = ImageColorAllocate($im, 0, 0, 0); ImageArc($im, $arrwell, $arrwell, 10, 10, 0, 360, $black); ImageFillToBorder($im, $arrwell, $arrwell, $black, $black); ... The problem is that now the Arc and arrow lines comes out in a reddish color and the fill to border doesn't fill (regardless of the color used in ImageArc). Anything I attempt to draw in any color comes out in red (it doesn't matter what the stripe color behind it is, it's still the same red). Try using the TrueColor functions. I suspect that while it's possible for the JPEG to have a zillion colors, the actualy pallette in use for any particular image is limited. Once you hit that limit, it gets ugly fast. Before the True Color stuff came along, I wrote some really gnarly code that would essentially search out the least-used color, de-allocate that one -- which automatically re-mapped that color to the nearest, I think, and then I was able to allocate my new color flawlessly. You really don't want to use this code, since scanning the whole image for all the colors and building up the frequency table is extremely inefficient, and almost-for-sure the True Color stuff will take care of you. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Encoding problem with command line PHP.exe
Hello - My problem is as follows: ? $data = mssql_result(mssql_query(SELECT Field FROM table WHERE ID='1'),0); echo $data; mysql_insert(INSERT INTO table2 VALUES('$data')); ? The data in the MSSQL table is: Æã I dunno what those characters are or what's going on, but this code needs some serious error-checking... Perhaps the web version and CGI version are using different php.ini files with different sql_magic_quotes settings... -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: pgSQL Functions with results set to php?
List, I'm creating a PHP/pgSQL web site...I need to execute queries with a cursor and get their result set into my PHP script. How can I make a pgSQL procedure with logic that also returns a result set? I've searched and searched but cannot find the answer. Does anyone got it? Any old select will return a result set that works with a query... But if you need your PostgreSQL FUNCTION to return a result set, I *think* you need to use: 'set of XXX' for the 'rettype' (return type) and I *THINK* you can figure out what to use for XXX if you start digging to find the name/oid of the complex type that represents a row in your table here: http://www.postgresql.org/idocs/index.php?catalog-pg-type.html I've never done this, I just did a little digging right now, and this is where I would keep digging if I was working on this... But it sounds to me like PostgreSQL already *has* a complex type to represent the tuples in your table, and you just need to find out what the name of that complex type might be. It may even turn out to be just the table name or something... -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP install - what features?
I have searched the archive for a message subject something like PHP Wish List and was unsuccessful. Depends who does the wishing :-) The first time I compiled PHP, I tried to throw in almost everything that sounded remotely interesting. That was incredibly time-consuming and frustrating. I didn't even really understand what half that crap was, and then I had to go download and install and configure it and kick the tires on each one, and... By the time I got so frustrated with it all, there was *ALREADY* a new version of PHP out. (It's not like I didn't have other stuff to do...) So when I started over with that version I only compiled in the stuff I *KNEW* I would have time to mess with in the next six months. HIGHLY RECOMMENDED -- It don't matter what you choose, but choose only the stuff you're gonna need FOR SURE in the next six months. -- If it turns out you were wrong, it's no big deal to download/compile/install one more toy, after you've been playing awhile. Oh yeah -- Be sure to compile it as a CGI as well. You'll need that for cron jobs sooner than you think, and it's way easier when you still have the shell with the up arrow :-) Actually, I always put my configure line in a chmod 700 shell script so I can just use it again. I know PHP writes one out, but it's got all those quotes and stuff, and I like one I can just read. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: New 2 PHP
Hi Everyone. Yup.. another dummy who can't suss out php. I'm running win2000 server and have installed php (by the book), also have mysql running. I just saw an article on Apache Today (http://www.apachetoday.com) about PHP on W2K installation. It seemed to be pretty clearly-written and had a lot of 'splaining about WHY the guy did what he did, and what did and didn't work when he tried it... YMMV. It's the next one after the SWYNK article. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Can this be done with mail()?
I need to query a database and return a resultset. A php script will then sort through the data and send the data to the browser in the form of a table. Is it possible to gather the the results with html tags and store them in a variable so that the results can be emailed to someone? If so, how would this be done? Do as much of the sorting/searching in SQL as you can. MUCH faster. Use the mail class from http://phpclasses.org to do the html-enhanced email. WARNING: Many readers will simply *TRASH* your enhanced email. Re-think your priorities. Collecting your HTML in a variable is easy: ?php $html = ''; # Get db stuff $html .= TABLE\n; # Loop through results{ $html .= TRTD$x/TDTD$y/TDTD$z/TD/TR\n; } $html .= /TABLE\n; ? It's just like doing everything with echo, only not. :-) You may want to echo some stuff out as well, so you know what's happening... -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Dealing with spaces and punctuation in uploaded filenames (tjlq)
$SAFEFILENAME = ereg_replace ([[:punct:]]+[[:blank:]]+, , $FILENAME); But that does not seem to be working, and I have not been able to figure out why. It's better to specifically *ALLOW* certain characters than to try to list all the ones you do *NOT* allow: # Get rid of gnarly characters in filenames: $filename = ereg_replace('[^a-zA-Z0-9_\\.-]', '', $photo_name); $filename = $filename ? $filename : chr(rand(ord('A'),ord('Z'))) . chr(rand(ord('A'),ord('Z'))) . chr(rand(ord('A'),ord('Z'))) . chr(rand(ord('A'),ord('Z'))); if (!ereg('[a-zA-Z0-9_-]+[\\.]*[a-zA-Z0-9_-]*', $filename)){ $filename = chr(rand(ord('A'),ord('Z'))) . chr(rand(ord('A'),ord('Z'))) . chr(rand(ord('A'),ord('Z'))) . chr(rand(ord('A'),ord('Z'))) . $filename; } Here, I throw out anything that's not alphanumeric, underscore (_), dot (\\.), or dash (-) I also accept that fact that some goofball will end up have a file name with *NOTHING* useful in it, and then I just make a random filename up. Damned if I know why I felt the need for that last if(){} part... Maybe ord('Z') should be ord('Y') and I was getting whatever comes after Z some of the time??? Or perhaps that just adds four more characters on when I *DO* need to make up random names? That part looks pretty broken to me right now, but maybe I just need some sleep. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] serverside restrictions
Hi guys, I have a function: $substring = substr($REMOTE_ADDR,0,9); if ($substring != '192.168.0') { echo Access Denied; exit; } If the user isn't from the local network, he's not allowed in. This works fine, but is there a way to get apache to do it for me instead? Like, this for example... Location /server-info SetHandler server-info Order deny,allow Deny from all Allow from 192.168.0.0 /Location Is it possible to have apache do this for a Vhost? like this... VirtualHost * DocumentRoot /home/admin ServerName admin.blabla.net ErrorLog /home/logs/error.admin.net.log CustomLog /home/logs/access.admin.net.log common php_admin_flag safe_mode off Location /home/admin Order deny,allow Deny from all Allow from 192.168.0.0 /Location /VirtualHost See what I'm trying to do? i've had a big fiddle, can't get it to work. Anyone got any ideas? Cheers, Liam P.S. I know it's got to do with Apache mostly, but it kinda has some relation to PHP... ;-)
[PHP] state engine or HTML parser
Hi all, I'm looking at some pretty complex regexp's at the moment for parsing HTML, stripping out some attributes, getting the values of others, etc etc. The simple fact is that all these... A HREF=foo.php A HREF='foo.php' A HREF=foo.php A HREF='foo.php' TARGET=something A HREF=foo.php TARGET=something A HREF = foo.php A HREF = 'foo.php' ... and many more are *valid* HTML mark-up. It starts to make the task look rather daunting -- especially if I want to get it right, rather than taking shortcuts. I'm pretty sure I need to start looking at a state engine or HTML parser which can identify a tag, and seek out all the attributes of it, according to strictly valid HTML (preferably 4.01 strict), rather than working with regexp's. As it turns out, I'm only looking to work with A at this stage, so I don't think it'll be a massive state engine, but I'd like to explore any other options or existing libraries of code before considering such a beast. Any links / articles / code / whatever warmly welcome :) Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 14 Jul 2002 08:21:08 -0000 Issue 1463
php-general Digest 14 Jul 2002 08:21:08 - Issue 1463 Topics (messages 107537 through 107584): Animated GIFs 107537 by: Peter Re: recusive functions 107538 by: Jome Can't Install on Mac OS X 107539 by: Brandon Pearcy 107543 by: Liam MacKenzie Re: Can this be done with mail()? 107540 by: John Holmes 107581 by: Richard Lynch How do I get the name of the script? 107541 by: David Duong 107544 by: Philip Olson 107545 by: David Duong Setting include_path 107542 by: Tim Thorburn 107565 by: Jason Wong How come this will echo No or nothing? 107546 by: JJ Harrison 107547 by: Cal Evans 107548 by: JJ Harrison 107549 by: Cal Evans 107552 by: JJ Harrison 107555 by: Cal Evans 107556 by: JJ Harrison 107560 by: JJ Harrison 107562 by: JJ Harrison Re: objects in an array 107550 by: Alberto Serra Dealing with spaces and punctuation in uploaded filenames (tjlq) 107551 by: Tim Luoma 107564 by: Jason Wong 107582 by: Richard Lynch Newbie question 107553 by: Jay 107554 by: Cal Evans 107561 by: Alberto Serra Re: problem with cookies and some browsers 107557 by: Justin French Re: PHPDiscuss.com 107558 by: Justin French 107559 by: Jeff Lewis TOC protocol (AOL Instant Messenger) 107563 by: SpamSucks86 Re: Can not delete files that were uploaded 107566 by: Richard Lynch Re: how can this be? GET instead of POST - db error 107567 by: Richard Lynch Re: Problems with apache and php 107568 by: Richard Lynch Re: HTTP_USER_AGENT? 107569 by: Richard Lynch Re: xml and max size of xml doc 107570 by: Richard Lynch Re: PHP meetup 107571 by: Richard Lynch Re: A question of style ... 107572 by: Richard Lynch Re: Emulating Java Exceptions 107573 by: Richard Lynch Re: Write EXIF - is it possible? 107574 by: Richard Lynch Re: Final Year Computer Science Project involving PHP 107575 by: Richard Lynch Re: black becomes red w/ imagecreatefromjpeg 107576 by: Richard Lynch Re: Encoding problem with command line PHP.exe 107577 by: Richard Lynch Re: pgSQL Functions with results set to php? 107578 by: Richard Lynch Re: PHP install - what features? 107579 by: Richard Lynch Re: New 2 PHP 107580 by: Richard Lynch serverside restrictions 107583 by: Liam MacKenzie state engine or HTML parser 107584 by: Justin French 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--- I know GIF support was dropped from the GD library, but can you make animated GIFs in any version of GD? ---End Message--- ---BeginMessage--- Alexander Ross [EMAIL PROTECTED] skrev i meddelandet [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Does exit() in a recursive function exit the entire function, of does it only exit that iteration of teh function?? Thanks exit terminas the whole script and not just a function. Read more on http://php.net/exit -Jome ---End Message--- ---BeginMessage--- Hi Everyone, In the past I have setup many Mac OS X web servers successfully. Now I'm trying to setup another OS X web server, but PHP will not work. I'm having massive problems getting PHP to make, and I'm all out of ideas. After I configure PHP (./configure), and try to make it, I get these errors: make[1]: *** [php] Error 1 make: *** [all-recursive] Error 1 I've tried an alternative way of installing from Marc Liyanage's web site, http://www.entropy.ch/ which was very easy to follow, but it absolutely will not allow me to view any PHP pages through Apache. PHP prints out the following error instead: Warning: Failed opening '/Library/WebServer/Documents/test.php' for inclusion (include_path='.:/usr/local/lib/php') in Unknown on line 0 As you can see, the file's name is test.php, but you should know it has absolutely NO PHP code in it. It's contents are: html body Why don't I work? /body /html Anyone have any ideas? If anyone is willing, could they download the latest source of PHP and try to configure and make it (don't bother make install-ing it...) If you have any success with it, let me know. Thanks in advance! -- -- Brandon Pearcy Internet Technician Bowes Online -- phone: 1-780-532-1110 ext. 265 fax: 1-780-532-2120 [EMAIL PROTECTED] ---End Message--- ---BeginMessage--- What extras are you compiling in with it? Compile PHP and Apache with the bare minimum only, no fancy stuff. Try it then. I sucessfully compiled several
Re: [PHP] PHPDiscuss.com
Wow...a forum. Is that vBulletin your using? Shouldn't you be giving them credit somewhere?? It looks like YaBB. You'd think when people are using a free BB, they'd atleast have the courtesy of dropping a small plug at the end of the page. I guess not -- Adam Alkins http://www.rasadam.com -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Variables aren't being passed to php page
Hi, I've recently upgraded from PHP 4.0.4p11 - PHP 4.2.1, but now there seems to be a problem that variables from POST/GET are not being passed to the PHP page. For example, with the following file test.php, using the URL 'test.php?mid=1' displays 'nope'. ? if (isset($mid)) echo $mid; else echo nope; ? Is this a known problem, or is this some configuration issue? Thanks for any help, Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Can't Install on Mac OS X
I've tried an alternative way of installing from Marc Liyanage's web site, http://www.entropy.ch/ which was very easy to follow, but it absolutely will not allow me to view any PHP pages through Apache. as far as I remember you have to have the original apache build (by apple) to run Marcs script. Not sure though, read his docs. Andy Brandon Pearcy [EMAIL PROTECTED] schrieb im Newsbeitrag news:a05111b00b956353ac94a@[207.229.10.79]... Hi Everyone, In the past I have setup many Mac OS X web servers successfully. Now I'm trying to setup another OS X web server, but PHP will not work. I'm having massive problems getting PHP to make, and I'm all out of ideas. After I configure PHP (./configure), and try to make it, I get these errors: make[1]: *** [php] Error 1 make: *** [all-recursive] Error 1 I've tried an alternative way of installing from Marc Liyanage's web site, http://www.entropy.ch/ which was very easy to follow, but it absolutely will not allow me to view any PHP pages through Apache. PHP prints out the following error instead: Warning: Failed opening '/Library/WebServer/Documents/test.php' for inclusion (include_path='.:/usr/local/lib/php') in Unknown on line 0 As you can see, the file's name is test.php, but you should know it has absolutely NO PHP code in it. It's contents are: html body Why don't I work? /body /html Anyone have any ideas? If anyone is willing, could they download the latest source of PHP and try to configure and make it (don't bother make install-ing it...) If you have any success with it, let me know. Thanks in advance! -- -- Brandon Pearcy Internet Technician Bowes Online -- phone: 1-780-532-1110 ext. 265 fax: 1-780-532-2120 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: TOC protocol (AOL Instant Messenger)
You can find AIM/ICQ (Since some years ICQ uses the AIM protocol - OSCAR - too, the only difference is one packet where the ICQ client identifies it as an ICQ Client, not AIM) information on http://www.rejetto.com/icq :) I don't know anything about a PHP-AIM/ICQ project. As server you can use login.icq.com or login.oscar.aol.com (both are the same servers) and any port you want ! Spamsucks86 wrote: I'm interested in coding something in PHP which uses the TOC protocol to connect to AOL Instant Messenger (AIM). Has there been anything done like this in PHP? I'm also looking for more information on the TOC protocol. I have the protocol specs, but it doesn't say where the server is to connect to (same server as normal AIM, possibly?). Anyone who knows ANYTHING about this, please help.I don't know much ;-) Thanks for any and all replies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] (Exact) Difference between - and ::
Hi, I would like to know the exact difference between - and ::. I know that I can use as class directcly by using :: but I still don't know the exact meaning So why do they use in Example 8 on http://www.php.net/source.php?url=/zend2_example.phps $this-id = self::$id++ and not self::id++ or $this-id++ ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Opening and Editing Quark Binaries
I've been trying to open and end some of the ascii portions of Quark Express binary files, (I'm using PHP4 on MacOSX, the quark files are OS9 files). Even if I make the simplest eregi_replace () having done ... $fd = fopen ($file, rb+); $contents = fread ($fd, filesize ($file)); fclose ($fd); ... then the edits ... ... and then ... touch ($new_filename); $fd = fopen ($new_filename, ab+); fwrite ($fd, $contents); fclose ($fd); ... quark reports things like unexpected EOF (even though when I open the file in a text editor they have same number of lines and look identical), I've also tried a few things with the Mac resource forks to no avail. Has anyone tried something like this before? Does the fread() fwrite() change line endings from mac to unix or something? Kind of an obscure subject, but hoping for a clue from somewhere. Zim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Variables aren't being passed to php page
This is no problem. Since PHP 4.2 register_globals is disabled by default (in prior versions it was enabled). Either you can use the $_POST, $_GET etc. arrays or simply set register_globals in the php.ini to On ! -micha Mike Heffner wrote: Hi, I've recently upgraded from PHP 4.0.4p11 - PHP 4.2.1, but now there seems to be a problem that variables from POST/GET are not being passed to the PHP page. For example, with the following file test.php, using the URL 'test.php?mid=1' displays 'nope'. ? if (isset($mid)) echo $mid; else echo nope; ? Is this a known problem, or is this some configuration issue? Thanks for any help, Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] (Exact) Difference between - and ::
Hi, I would like to know the exact difference between - and ::. I know that I can use as class directcly by using :: but I still don't know the exact meaning So why do they use in Example 8 on http://www.php.net/source.php?url=/zend2_example.phps $this-id = self::$id++ and not self::id++ or $this-id++ ... ? -micha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How come this will echo No or nothing?
I've come up with this before and solved it like this (guess it'll work): if($row['plevel'] == '0'){ echo 'No'; } else if($row['plevel'] != '0'){ echo 'Yes'; } Notice the *ELSE IF* instead of a simple else statement. Try it. C. -Original Message- From: JJ Harrison [mailto:[EMAIL PROTECTED]] Sent: Saturday, July 13, 2002 1:01 AM To: [EMAIL PROTECTED] Subject: [PHP] How come this will echo No or nothing? here is the portion of the script: if($row['plevel'] == '0'){ echo 'No'; } else { echo 'Yes'; } here is my table structure dump: # # Table structure for table `docs` # CREATE TABLE docs ( id int(11) unsigned NOT NULL auto_increment, name varchar(200) NOT NULL default '', note varchar(200) NOT NULL default '', author varchar(200) NOT NULL default '', path varchar(200) NOT NULL default '', plevel tinyint(3) NOT NULL default '0', type char(3) NOT NULL default '', cat tinyint(3) NOT NULL default '0', file_size int(11) unsigned NOT NULL default '0', date int(11) unsigned NOT NULL default '0', PRIMARY KEY (id) ) TYPE=MyISAM; the row plevel is either 0 or 1. why won't this script echo Yes? The reason that the plevel is set in numbers is because I may add higher ones later. -- JJ Harrison [EMAIL PROTECTED] www.tececo.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] hello the list
Welcome Nicolas, =You didn't actually say what the problem was! =Some have made suggestions, please also consider (below): i'm new and i'm trouble with this code :'( can U help me please ?? this is the code : while ($cd_tbl = mysql_fetch_array ($result)) { $cd_id = $cd_tbl['cd_id']; $cd_oeuvre = $cd_tbl['cd_oeuvre']; $cd_chef = $cd_tbl['cd_chef']; $cd_compositeur = $cd_tbl['cd_compositeur']; ---partie concernée- //-Debut Seth //-- // name : _ALTERNANCE_COULEUR_ // desc : test de 'id' pour l'alternance de couleur //-- if(is_int($cd_id) = TRUE) =there is no need for the double-quotes in this statement. =you should be coding equality (==) or even equality and type equivalence (===) Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Restricting access using IPs
Liam, Not altogether happy with the suggestion below. It works - for now. A more generic solution might be to replace the hard-coded 9 with a call to strrchr() on the last 'dot' character position (minus one). Then it should work on any properly formed IP address. Thereafter parameterise the subnet address portion and things become mobile/re-usable. Regards, =dn Oops, wrong variable. That should be: $substring = substr($REMOTE_ADDR,0,9); if ($substring == '192.168.0') { // you're in } Michael On Sat, 13 Jul 2002, Liam MacKenzie wrote: If I enter 192.168.0.13 (My IP) it works, I'm allowed in and any other IP isn't. However, I need to grant access to this whole network, not just me. So I need 192.168.0.* to be able to access it, everyone else should get Access Denied So I need to know how to write this bit: $localip = 192.168.0.13; so that it's the network, not just me. I tried these but they didn't work: $localip = 192.168.0.0; $localip = 192.168.0.*; $localip = 192.168.0.0/24; Any other ideas? Cheers - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, July 13, 2002 3:49 PM Subject: Re: [PHP] Restricting access using IPs On Saturday 13 July 2002 13:10, Liam MacKenzie wrote: Hey all, I'm looking to deny access to all IPs except those that fall into a specific IP range. 192.168.0.* in this case. Am I missing something out of this code, it don't work too well ;-) HOW doesn't it work too well? It displays a picture of a naked guy instead of the naked girl that you was expecting? ? $localip = 192.168.0.13; if ($REMOTE_ADDR == $localip) { ? Allowed! ? } else { ? Denied! ? } ? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* GOOD-NIGHT, everybody ... Now I have to go administer FIRST-AID to my pet LEISURE SUIT!! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- n i n t i . c o m php-python-perl-mysql-postgresql Michael Hall [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] Variables aren't being passed to php page
Check your php version. if its greater then 4.1.0, then you must either enable 'register_globals' in your php.ini, or use $_GET['var'] or $_POST['var'] to get data from a form - Original Message - From: Mike Heffner [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 14, 2002 2:36 AM Subject: [PHP] Variables aren't being passed to php page Hi, I've recently upgraded from PHP 4.0.4p11 - PHP 4.2.1, but now there seems to be a problem that variables from POST/GET are not being passed to the PHP page. For example, with the following file test.php, using the URL 'test.php?mid=1' displays 'nope'. ? if (isset($mid)) echo $mid; else echo nope; ? Is this a known problem, or is this some configuration issue? Thanks for any help, 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] serverside restrictions
Liam MacKenzie wrote: This works fine, but is there a way to get apache to do it for me instead? Like, this for example... Location /server-info SetHandler server-info Order deny,allow Deny from all Allow from 192.168.0.0 /Location Yes, using exactly the syntax you have. The exact line you have would only allow the particular ip address of 192.168.0.0 to connect. If you want the /24 subnet to have access then leave off the last octet, e.g. 192.168.0 Its all in the Apache manual, manual/howto/auth.html#allowdeny HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] serverside restrictions
On Sunday 14 July 2002 14:17, Liam MacKenzie wrote: This works fine, but is there a way to get apache to do it for me instead? Like, this for example... Location /server-info SetHandler server-info Order deny,allow Deny from all Allow from 192.168.0.0 /Location This works for me: Location /server-status SetHandler server-status Order deny,allow Deny from all Allow from 10.0.0.0/8 /Location Is it possible to have apache do this for a Vhost? like this... VirtualHost * DocumentRoot /home/admin ServerName admin.blabla.net ErrorLog /home/logs/error.admin.net.log CustomLog /home/logs/access.admin.net.log common php_admin_flag safe_mode off Location /home/admin Order deny,allow Deny from all Allow from 192.168.0.0 /Location /VirtualHost This also works for me: VirtualHost 1.2.3.4 ServerAdmin [EMAIL PROTECTED] DocumentRoot /home/www/example.com/html ServerName example.com Directory /home/www/example.com/html Order allow,deny Allow from 10.0.0.0/24 /Directory /VirtualHost P.S. I know it's got to do with Apache mostly, but it kinda has some relation to PHP... ;-) To be honest, follow-up questions should be directed to the apache list. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* You can't have your cake and let your neighbor eat it too. -- Ayn Rand */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Can not delete files that were uploaded
Be warned that if PHP can delete them, so can anybody else on the shared server who wants to write a PHP script to delete them, unless you've configured PHP specially to run as a specific user, which is unlikely for most ISP setups. How can PHP be configured to run as a specific user? I'm referring to a DSO installation, where I assume that because PHP is 'part' of Apache, it would be the same user as Apache. Michael Hall [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How come this will echo No or nothing?
this is from the O'Reilly _Programming PHP_ (Rasmus Lerdorf Kevin Tatroe): Because echo is not a true function, you can't use it as part of a larger expression: // parse error if (echo(test)) { echo(it worked!; } Such errors are easily remedied, though, by using the print() or printf() functions. p. 76 Here's how I solved a similar problem: if ( $foo != '' ) print ( yes); and then just add the else statement... best, Matt - Original Message - From: César Aracena [EMAIL PROTECTED] To: 'JJ Harrison' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, July 14, 2002 5:42 AM Subject: RE: [PHP] How come this will echo No or nothing? I've come up with this before and solved it like this (guess it'll work): if($row['plevel'] == '0'){ echo 'No'; } else if($row['plevel'] != '0'){ echo 'Yes'; } Notice the *ELSE IF* instead of a simple else statement. Try it. C. -Original Message- From: JJ Harrison [mailto:[EMAIL PROTECTED]] Sent: Saturday, July 13, 2002 1:01 AM To: [EMAIL PROTECTED] Subject: [PHP] How come this will echo No or nothing? here is the portion of the script: if($row['plevel'] == '0'){ echo 'No'; } else { echo 'Yes'; } here is my table structure dump: # # Table structure for table `docs` # CREATE TABLE docs ( id int(11) unsigned NOT NULL auto_increment, name varchar(200) NOT NULL default '', note varchar(200) NOT NULL default '', author varchar(200) NOT NULL default '', path varchar(200) NOT NULL default '', plevel tinyint(3) NOT NULL default '0', type char(3) NOT NULL default '', cat tinyint(3) NOT NULL default '0', file_size int(11) unsigned NOT NULL default '0', date int(11) unsigned NOT NULL default '0', PRIMARY KEY (id) ) TYPE=MyISAM; the row plevel is either 0 or 1. why won't this script echo Yes? The reason that the plevel is set in numbers is because I may add higher ones later. -- JJ Harrison [EMAIL PROTECTED] www.tececo.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] Form/insert problem
Below, is the code of a form to predict some matches. What I want is to submit this with with one button so it inserts the macthes in the database. One match is one record. The problem is that I don't know what to do now. Can someone help me with this form and the insert file (addvoorspelling.php) Thanks, Martin. ?PHP $today = date( Y-m-d H:i:s); include(auth.php); mysql_connect(., ..., ..); mysql_select_db (..); $sql = SELECT * FROM wedstrijden WHERE status='actief' AND datum '$today' ORDER BY datum; $resultaat = mysql_query($sql); $aantal = mysql_num_rows($resultaat); $i = 0; $queryr = SELECT * FROM ronde WHERE status='actief'; $resultr = MYSQL_QUERY($queryr) or die(mysql_error()); $aantalr = MYSQL_NUMROWS($resultr); $start = mysql_result($resultr,$r,start); $einde = mysql_result($resultr,$r,einde); PRINT link rel='stylesheet' href='centerstyle.css' body bgcolor=#f5f5f5 CENTER font size='5'From $start to $einde/fontp table tr td width=300bDatum/b/td td width=150bHome/b/td td width=50/td td width=150bAway/b/td td colspan=2bHT/b/td td colspan=2bFT/b/td td/td /tr; WHILE ($i $aantal): $id_wedstr = mysql_result($resultaat,$i,id_wedstr); $home = mysql_result($resultaat,$i,home); $away = mysql_result($resultaat,$i,away); $datum = mysql_result($resultaat,$i,datum); $sqlv = SELECT * FROM voorspelling WHERE id_user='$id' AND id_wedstrijd='$id_wedstr'; $resultaatv = mysql_query($sqlv); $aantalv = mysql_num_rows($resultaatv); IF ($aantalv == 0): PRINT form action=addvoorspelling.php method=POST tr td width=300$datum/td td width=150$home/td td width=50-/td td width=150$away/td td width=50select size'1' name='ht_home' option value='--'--/option; $j = 0; WHILE ($j 11): printoption value='$j'$j/option; $j++; ENDWHILE; PRINT /select/td td width=50select size'1' name='ht_aways' option value='--'--/option; $j = 0; WHILE ($j 11): printoption value='$j'$j/option; $j++; ENDWHILE; PRINT /select/td td width=50select size'1' name='ft_home' option value='--'--/option; $j = 0; WHILE ($j 11): printoption value='$j'$j/option; $j++; ENDWHILE; PRINT /select/td td width=50select size'1' name='ft_away' option value='--'--/option; $j = 0; WHILE ($j 11): printoption value='$j'$j/option; $j++; ENDWHILE; PRINT /select/td tdcenter input type=hidden value='$id' name=id input type=hidden value='$naam' name=naam input type=hidden value='$id_wedstr' name=id_wedstr input type=hidden value='$home' name=home input type=hidden value='$away' name=away /center/td /tr input type=submit Value=Verstuur! /form; ELSE: ENDIF; $i++; ENDWHILE; PRINT/table/CENTER; ?
RE: [PHP] PHPDiscuss.com
Wow...a forum. Is that vBulletin your using? Shouldn't you be giving them credit somewhere?? It looks like YaBB. You'd think when people are using a free BB, they'd atleast have the courtesy of dropping a small plug at the end of the page. I guess not Exactly, it's the small things that count. Even though it's small, not giving credit to the free program you're using and didn't write, is enough to make me not want to use the site... Give credit where credit is due... ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Variables aren't being passed to php page
I've recently upgraded from PHP 4.0.4p11 - PHP 4.2.1, but now there seems to be a problem that variables from POST/GET are not being passed to the PHP page. For example, with the following file test.php, using the URL 'test.php?mid=1' displays 'nope'. Do you always upgrade programs without reading to see what changes have been made? If so, I have this update program that I'll send you...just run it for me, okay? Check your register_globals setting, like the others said, and read the changelog for your new installation of PHP. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] You are about to leave the secure conexion
Is the new window your opening secure? Is it an HTTPS URL? Either way, sound like a client side issue to me... ---John Holmes... -Original Message- From: Pedro Garre [mailto:[EMAIL PROTECTED]] Sent: Sunday, July 14, 2002 9:13 AM To: [EMAIL PROTECTED] Subject: [PHP] You are about to leave the secure conexion *This message was transferred with a trial version of CommuniGate(tm) Pro* Hi, I've got a https site with Apache and mod_ssl. When I open a new window with javascript (window.open) the browser (IE) says I am about to leave the secure conexion. Same happens when I download the .der certificate. What could I do so that those messages do not show up ? ( I search the HTTP/1.1 spec looking for a header but could not find anything and the new window could not be solved with a header anyway) Sorry if this is not completely PHP :-) Thanks. Pedro. -- 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
Fw: [PHP] Re: Problems with apache and php
Do you have apache2 and one of the latest php versions? if so oyu need to download the latest php4apache2.dll ... I found in on the manual page somewhere. And oyu also need to change some other stuff which was listed in the install.txt. - Original Message - From: Richard Lynch [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 14, 2002 3:50 AM Subject: [PHP] Re: Problems with apache and php I have a small problem, I can make the cgi version of php fine, it runs and installs perfectly, but when I try to make the apache module (i.e. --with-apxs=/path/to/apxs) php crashes apache. can anyone give me any insight on this? What error messages are in Apache log? Do you get a core dump? Have you read the instructions on http://bugs.php.net/ ? Is the apxs you pointed out to PHP the current one matching your Apache installation? What was your configure line for Apache? -- Like Music? http://l-i-e.com/artists.htm -- 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] ob_start
I wish to compress some data using ob_start(ob_gzhandler); I use if(strstr($_SERVER['HTTP_ACCEPT_ENCODING'],gzip)) { ob_start(ob_gzhandler); } else { ob_start(); } but the compression is never used.. obstart is always used withouth the gz_handler is there a way around this? or am I doing something wrong here? Kind regards kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variables aren't being passed to php page
On Sunday 14 July 2002 21:53, John Holmes wrote: I've recently upgraded from PHP 4.0.4p11 - PHP 4.2.1, but now there seems to be a problem that variables from POST/GET are not being passed to the PHP page. For example, with the following file test.php, using the URL 'test.php?mid=1' displays 'nope'. This list gets at least one question a day on this subject ... Do you always upgrade programs without reading to see what changes have been made? ... and that's because people don't read up on what they're upgrading to. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Don't drop acid, take it pass-fail! -- Bryan Michael Wendt */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ob_start
I wish to compress some data using ob_start(ob_gzhandler); I use if(strstr($_SERVER['HTTP_ACCEPT_ENCODING'],gzip)) { Shouldn't gzip be in quotes, here?? The second argument to strstr... ob_start(ob_gzhandler); } else { ob_start(); } but the compression is never used.. obstart is always used withouth the gz_handler is there a way around this? or am I doing something wrong here? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ob_start
I don't think you need to do the if(strstr($_SERVER['HTTP_ACCEPT_ENCODING'],gzip)) { because ob_start(ob_gzhandler); checks to see if the browser will accept gzip content before gzipping it.. But I think the reason that it isn't working for you is that you don't have the correct compression libraries compiled into PHP... I spent ages trying to figure out why mind didn't work and this was the problem. The anonying thing is that if you don't have this libs it doesn't even tell you andrew - Original Message - From: Kevin Waterson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 14, 2002 3:34 PM Subject: [PHP] ob_start I wish to compress some data using ob_start(ob_gzhandler); I use if(strstr($_SERVER['HTTP_ACCEPT_ENCODING'],gzip)) { ob_start(ob_gzhandler); } else { ob_start(); } but the compression is never used.. obstart is always used withouth the gz_handler is there a way around this? or am I doing something wrong here? Kind regards kevin -- 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] ob_start
On Sun, 14 Jul 2002 10:35:13 -0400 John Holmes [EMAIL PROTECTED] wrote: Shouldn't gzip be in quotes, here?? The second argument to strstr... indeed, that fixes that.. thanks now, I have a problem with mozilla and netscape. Although they both accept the ob_start(ob_gzhandler); netscape gives a comunication error, and mozilla just a blank page, IE on the Mac however displays the output. The blank page in mozilla is mentioned in the manual, but how do get around this?? Kind regards Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Creating an PHP program and C program
Hello All, I wrote some times ago an library to draw graphics in 2 and 3 D, but this sources are write in C, whats the procedures I need to use this rotines in PHP. Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Animated GIFs
Peter [EMAIL PROTECTED] skrev i meddelandet [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I know GIF support was dropped from the GD library, but can you make animated GIFs in any version of GD? I think your best shoot would be to combine GD with ImageMagick which has a function called combine, to create animated gifs. ImageMagick can be found on this URL: http://www.imagemagick.org/ -Jome -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Newbie Date question
If: $today = date(Y-m-d); Then how to I get: $yesterday = ? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: pgSQL Functions with results set to php?
Richard Lynch wrote: List, I'm creating a PHP/pgSQL web site...I need to execute queries with a cursor and get their result set into my PHP script. How can I make a pgSQL procedure with logic that also returns a result set? I've searched and searched but cannot find the answer. Does anyone got it? Any old select will return a result set that works with a query... But if you need your PostgreSQL FUNCTION to return a result set, I *think* you need to use: 'set of XXX' for the 'rettype' (return type) and I *THINK* you can figure out what to use for XXX if you start digging to find the name/oid of the complex type that represents a row in your table here: http://www.postgresql.org/idocs/index.php?catalog-pg-type.html I've never done this, I just did a little digging right now, and this is where I would keep digging if I was working on this... But it sounds to me like PostgreSQL already *has* a complex type to represent the tuples in your table, and you just need to find out what the name of that complex type might be. It may even turn out to be just the table name or something... A complex, or aka composite, type in PostgreSQL is represented by the name of a table or view. The capability to return setof a-composite-type exists in a limited way in PostgreSQL 7.2.x. See the thread at: http://archives.postgresql.org/pgsql-interfaces/2002-06/msg00042.php for a recent discussion about this with some examples. PostgreSQL 7.3, when it is released, will have much better capability. You will be able to do: test=# select * from getfoo(1); fooid | f2 ---+- 1 | 11 1 | 111 (2 rows) In cvs HEAD you can do this already with SQL language functions and C language functions. HTH, Joe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Trying to build intelligent query from question
Hi, I may be doing this all the wrong way :) so feel free to let me know, thanks. I've been developing a q/a database. I don' want to search on what I consider common words. Certainly there must be a list of these. Anyhow, I explode the question string into words and then iterate as such: foreach($words as $Key=$Value) { if($ignoreWords[strtolower($Value)]) { continue; } Here is my $ignoreWords array: $ignoreWords = array('brazil'=1,'like'=1,'the'=1,'this'=1,'that'=1,'why'=1,'are'=1,'there'= 1,'where'=1,'find'=1,); What do you think? Do I just build up $ignoreWords like I'm doing or this there another way I've missed? Also, does someone have a list of common words to ignore? Thanks, Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() problem
Hi again, ok i found out now, that the problem is the From: ... Reply-To: header. Whenever i leave those, the email gets delivered instantly, but included, the email gets a delivery delay for about 3 hours. Is there any other way, i can avoid getting the default email address as the sender, but a selected one? Regards, Duncan
Re: [PHP] Newbie Date question
On Monday 15 July 2002 00:01, RoyW wrote: If: $today = date(Y-m-d); Then how to I get: $yesterday = ? Use strtotime() followed by date(). Details in manual. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* I went to a Grateful Dead Concert and they played for SEVEN hours. Great song. -- Fred Reuss */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP, JAva history
I would like to see from where visitor come from mypage i need a function who return the last visited page prior to mine. I didn't found any function on php for that purpose and I'm thinking in mix Java and php for that purpose, using the browser history, Can someone show-me how can I do that. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Trying to build intelligent query from question
On Monday 15 July 2002 01:00, Peter J. Schoenster wrote: I may be doing this all the wrong way :) so feel free to let me know, thanks. I'm not going to comment on your overall concept. I've been developing a q/a database. I don' want to search on what I consider common words. Certainly there must be a list of these. Anyhow, I explode the question string into words and then iterate as such: foreach($words as $Key=$Value) { if($ignoreWords[strtolower($Value)]) { continue; } You would be better off using array_diff(). -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Conquering Russia should be done steppe by steppe. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() problem
Hi again, ok, i found the (weird!) problem now: Its not my server nor my ISP, but php (at least, i think so): Here are the exact lines i used in my test script: 1st non working - delayed example: mail($receiver,-Subject-,Here are your account details:\n\nusername: $lp_name\npassword: .base64_decode($lp_pass).\n\nYou can login now at: http://domain.com$PHP_SELF,From: [EMAIL PROTECTED]\r\nReply-To: [EMAIL PROTECTED]\r\n); 2nd working - non delayed example: $message = Here are your account details:\n\nusername: $lp_name\npassword: .base64_decode($lp_pass).\n\nYou can login now at: http://domain.com$PHP_SELF;; mail($receiver,-Subject-,$message,From: [EMAIL PROTECTED]\r\nReply-To: [EMAIL PROTECTED]\r\n); This is rather strange, because all i did was changing the email-message text into a variable and pass it to the mail() function, instead of including the whole string directly in it. But fact is, now it works just perfect without any delay! Does anyone have an idea, what may cause example #1 not to be delivered instantly? Or is my string in a bad-programming style? ...but then it shouldn't work as a variable either, right? I am completely lost in this case, Regards, Duncan
Re: [PHP] Variables aren't being passed to php page
Please read this: http://www.php.net/manual/en/language.variables.external.php Regards, Philip Olson On Sun, 14 Jul 2002, Mike Heffner wrote: Hi, I've recently upgraded from PHP 4.0.4p11 - PHP 4.2.1, but now there seems to be a problem that variables from POST/GET are not being passed to the PHP page. For example, with the following file test.php, using the URL 'test.php?mid=1' displays 'nope'. ? if (isset($mid)) echo $mid; else echo nope; ? Is this a known problem, or is this some configuration issue? Thanks for any help, 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] Variables aren't being passed to php page
PHP page. For example, with the following file test.php, using the URL 'test.php?mid=1' displays 'nope'. This list gets at least one question a day on this subject ... Please refer to the manual when this happens, specifically: http://www.php.net/manual/en/language.variables.external.php Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Michalski Luc - Weblog upgrading - Asking for some help
Hello, my name is lucas I am student in computer science... We are imporving a previous version of phpweblog ( News Management ) in which we have had a DHTML editor and others goodies...For this part we don't have problems... But translations are problematics because we have integrated PHPlang, which recogonize automaticlly your Internet Explorer language, but we don't have these translations... language searched : Romanian Bulgarian Danois Deutsch Italian Korean Brasilian spanish swedish Turckish English Polish Japanese Faroese Norvegian Danish Greeck Portugeese Egyptian autrichian taiwaneese chineese russian The World Federal Network is a network which would be a real vector of communication... We hope that we could develop a linux OS too but each things at their times... You will in the lang file that the publication of an announcement on the network will only cost 1 euros for one month...( because we needs some servers) Ask me whatever you want... a program or a script... I will do my best for you in exchange... We trust in LINUX power and believe for more interactive internet... so that's why we ask you some help... I give you a .lang in english Thank you in advance... Lucas [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Development Tools
www.phpide.de Check this out - Php IDE Lord Loh. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Trying to build intelligent query from question
foreach($words as $Key=$Value) { if($ignoreWords[strtolower($Value)]) { continue; } You would be better off using array_diff(). Jason, Thanks, that works except that it doesn't account for case. I want to ignore case as it doesn't apply here. But I was able to get rid of the associative array. So I reckoned it best to LC the question and copy it because I want to return the original question as is back to the browser. $_string = strtolower ($Config['input']['question']); $words = explode( ,$_string); $ignoreWords = array('brazil','like','the','this','that','why','are','there','where','find',); $FindTheseWords = array_diff($words, $ignoreWords); Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] You are about to leave the secure conexion
Pedro Garre wrote: When I open a new window with javascript (window.open) the browser (IE) says I am about to leave the secure conexion. Same happens when I download the .der certificate. Its a browser configuration. Most browsers have the means of notifying the user if they are entering or leaving a secure page. In Mozilla its configurable in Edit, Preferences, Privacy and Security, SSL. Where (and if) its configured will vary with the browser you are using. HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP, JAva history
On 14 Jul 2002 at 13:42, Saci wrote: I would like to see from where visitor come from mypage i need a function who return the last visited page prior to mine. I didn't found any function on php for that purpose and I'm thinking in mix Java and php for that purpose, using the browser history, Can someone show-me how can I do that. Sounds like you want the REFERER, misspelling on purpose. Take a look here: http://www.php.net/manual/en/reserved.variables.php http://www.php.net/manual/en/ref.url.php Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Development Tools
Ahm... Anything good for MacOS X out there? I currently use and love BBEdit, but am open to other alternatives. Chris He who calles himself Lord Loh. (from [EMAIL PROTECTED]) wrote on 7/14/02 1:40 PM: www.phpide.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Does not work
I tried this simple code html body Page refered by ?php echo $HTTP_REFERER.'br'; echo $_SERVER['HTTP_REFERER'].'br'; ? /body /html and I receive blank reply even if referenced from a link from other site. What am i doing wrong ? Or perhaps my server does not have referer enabled? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Does not work
from PHP documentation: http://www.php.net/manual/en/reserved.variables.php 'HTTP_REFERER' The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted. -Original Message- From: Saci [mailto:[EMAIL PROTECTED]] Sent: Sunday, July 14, 2002 2:11 PM To: [EMAIL PROTECTED] Subject: [PHP] Does not work I tried this simple code html body Page refered by ?php echo $HTTP_REFERER.'br'; echo $_SERVER['HTTP_REFERER'].'br'; ? /body /html and I receive blank reply even if referenced from a link from other site. What am i doing wrong ? Or perhaps my server does not have referer enabled? -- 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] Does not work
// HTTP_REFERER as a feature. In short, it cannot really be trusted. Anybody know how to do that using JAva history with PHP together , or any other methode that works and can be trusted. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Variables aren't being passed to php page
Jason Wong wrote: This list gets at least one question a day on this subject ... And there will be a lot more as people scan the web for example scripts and find ones that assume 'register_globals' is set to on. TjL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variables aren't being passed to php page
I totally agree. No offence to all the ppl who have asked, but didn't it say on the download page that there had been major changes to the way variables are used?? John Holmes [EMAIL PROTECTED] wrote in message 000a01c22b3d$e4755790$b402a8c0@mango">news:000a01c22b3d$e4755790$b402a8c0@mango... I've recently upgraded from PHP 4.0.4p11 - PHP 4.2.1, but now there seems to be a problem that variables from POST/GET are not being passed to the PHP page. For example, with the following file test.php, using the URL 'test.php?mid=1' displays 'nope'. Do you always upgrade programs without reading to see what changes have been made? If so, I have this update program that I'll send you...just run it for me, okay? Check your register_globals setting, like the others said, and read the changelog for your new installation of PHP. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Does not work
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Saci) wrote: I tried this simple code html body Page refered by ?php echo $HTTP_REFERER.'br'; echo $_SERVER['HTTP_REFERER'].'br'; ? /body /html and I receive blank reply even if referenced from a link from other site. What am i doing wrong ? Or perhaps my server does not have referer enabled? It's possible that your *browser* does not pass referer information. But keep in mind that if there was no referring page, then there is no referer value for the browser to set. Try this instead: html body form method=get Page refered by ?php echo $HTTP_REFERER.'br'; echo $_SERVER['HTTP_REFERER'].'br'; ? input type=submit /form /body /html Load it, check the value, click Submit, then check again. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 14 Jul 2002 20:27:28 -0000 Issue 1464
php-general Digest 14 Jul 2002 20:27:28 - Issue 1464 Topics (messages 107585 through 107635): Re: PHPDiscuss.com 107585 by: Adam Alkins 107603 by: John Holmes Variables aren't being passed to php page 107586 by: Mike Heffner 107591 by: Micha 107596 by: Jason Reid 107604 by: John Holmes 107608 by: Jason Wong 107622 by: Philip Olson 107623 by: Philip Olson 107633 by: Tim Luoma 107634 by: Peter Re: Can't Install on Mac OS X 107587 by: Andy Re: TOC protocol (AOL Instant Messenger) 107588 by: Micha (Exact) Difference between - and :: 107589 by: Micha 107592 by: Micha Opening and Editing Quark Binaries 107590 by: Simon Troup Re: How come this will echo No or nothing? 107593 by: César Aracena 107601 by: Matthew K. Gold Re: hello the list 107594 by: DL Neil Re: Restricting access using IPs 107595 by: DL Neil Re: serverside restrictions 107597 by: Chris Hewitt 107598 by: Jason Wong Re: Can not delete files that were uploaded 107599 by: Michael Hall You are about to leave the secure conexion 107600 by: Pedro Garre 107605 by: John Holmes 107627 by: Chris Hewitt Form/insert problem 107602 by: Martin Kampherbeek Re: Problems with apache and php 107606 by: Marxus ob_start 107607 by: Kevin Waterson 107609 by: John Holmes 107610 by: Andrew Brampton 107611 by: Kevin Waterson Creating an PHP program and C program 107612 by: Alexandre Soares Re: Animated GIFs 107613 by: Jome Newbie Date question 107614 by: RoyW 107618 by: Jason Wong Re: pgSQL Functions with results set to php? 107615 by: Joe Conway Trying to build intelligent query from question 107616 by: Peter J. Schoenster 107620 by: Jason Wong 107626 by: Peter J. Schoenster Re: mail() problem 107617 by: Duncan 107621 by: Duncan PHP, JAva history 107619 by: Saci 107628 by: Peter J. Schoenster Michalski Luc - Weblog upgrading - Asking for some help 107624 by: David D Re: Development Tools 107625 by: Lord Loh. 107629 by: Chris Garaffa Does not work 107630 by: Saci 107631 by: Michael Geier 107632 by: Saci 107635 by: CC Zona 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--- Wow...a forum. Is that vBulletin your using? Shouldn't you be giving them credit somewhere?? It looks like YaBB. You'd think when people are using a free BB, they'd atleast have the courtesy of dropping a small plug at the end of the page. I guess not -- Adam Alkins http://www.rasadam.com -- ---End Message--- ---BeginMessage--- Wow...a forum. Is that vBulletin your using? Shouldn't you be giving them credit somewhere?? It looks like YaBB. You'd think when people are using a free BB, they'd atleast have the courtesy of dropping a small plug at the end of the page. I guess not Exactly, it's the small things that count. Even though it's small, not giving credit to the free program you're using and didn't write, is enough to make me not want to use the site... Give credit where credit is due... ---John Holmes... ---End Message--- ---BeginMessage--- Hi, I've recently upgraded from PHP 4.0.4p11 - PHP 4.2.1, but now there seems to be a problem that variables from POST/GET are not being passed to the PHP page. For example, with the following file test.php, using the URL 'test.php?mid=1' displays 'nope'. ? if (isset($mid)) echo $mid; else echo nope; ? Is this a known problem, or is this some configuration issue? Thanks for any help, Mike ---End Message--- ---BeginMessage--- This is no problem. Since PHP 4.2 register_globals is disabled by default (in prior versions it was enabled). Either you can use the $_POST, $_GET etc. arrays or simply set register_globals in the php.ini to On ! -micha Mike Heffner wrote: Hi, I've recently upgraded from PHP 4.0.4p11 - PHP 4.2.1, but now there seems to be a problem that variables from POST/GET are not being passed to the PHP page. For example, with the following file test.php, using the URL 'test.php?mid=1' displays 'nope'. ? if (isset($mid)) echo $mid; else echo nope; ? Is this a known problem, or is this some configuration issue? Thanks for any help, Mike ---End Message--- ---BeginMessage--- Check your php version. if its greater then 4.1.0, then you must either enable 'register_globals' in your php.ini, or use $_GET['var'] or $_POST['var'] to get data from a form - Original Message
[PHP] mysql LIMIT
can I use limit to show the 2nd record on without knowing how many more records there might be? also, what happens if I set the limit in a mysql statement (LIMIT 5,10), but there are only 3 results? 7 results? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] REminder APllication
On Thu, Jul 11, 2002 at 10:05:05PM -0400, John Holmes wrote: DOes anyone know how to build a reminder application on: a) identified users b) Sorting users' reminders?? Yes. ---John Holmes... http://homepages.tesco.net/~J.deBoynePollard/FGA/questions-with-yes-or-n o-answers.html Getting down to specifics then: 1) I have a reminder process that a) uses .htpasswd b) USes a static file So I want to: I) Convert or use said file using a fill in the blank username/password process on a Web Page Once in II) The user have instant access to their reminder list so they could A) Modify by adding and/or deleting B) Set up an e-mail reminder time C) Set up which e-mail address to go to. Can I do/convert this and SPECIFICAAL how? http://homepages.tesco.net/~J.deBoynePollard/FGA/questions-with-yes-or-no-answers.html Not acceptible. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Member - Liberal International On 11 Sept 2001 the WORLD was violated. This is [EMAIL PROTECTED] Ici [EMAIL PROTECTED] Society MUST be saved! Extremists must dissolve. Beware of defining as intelligent only those who share your opinions -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql LIMIT
Alexander Ross wrote: can I use limit to show the 2nd record on without knowing how many more records there might be? also, what happens if I set the limit in a mysql statement (LIMIT 5,10), but there are only 3 results? 7 results? This looks like a question that could be answered with a 10 second test query! Cheers, Rob. -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] retrieving random data from mysql database
hi, can you teach me how to retrieve random data from my database? like for example...i have a list of names on my database and i'd like to retrieve only one name at a time..randomly. how do i go about this? hope someone can help...thanx.
RE: [PHP] mysql LIMIT
can I use limit to show the 2nd record on without knowing how many more records there might be? also, what happens if I set the limit in a mysql statement (LIMIT 5,10), but there are only 3 results? 7 results? My answer would tend to be that you should try it for yourself and see... But anyway, without having tried it myself recently, the first question is that you could use LIMIT (2, 1) and you'd probably get what you're trying for. As for the second question, you'll only get what records there are. If your limit excludes all possible results then you'll get no result (ie. If you use LIMIT(5, 10) and you've only got 3 records, then you won't get anything back at all. If you've got 7 records then you'll get the last 3 of them). But in all honesty, you could have worked this out for yourself fairly quickly with some simple testing of your own. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] retrieving random data from mysql database
can you teach me how to retrieve random data from my database? like for example...i have a list of names on my database and i'd like to retrieve only one name at a time..randomly. how do i go about this? This is really a database question rather than a php question and you haven't said which database you're using so it's hard to give a definitive answer. In MySQL you'd do something like this: Select * from some_table where some_condition order by RAND() limit 1; That would select one random row out of all rows that meet some_condition. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] retrieving random data from mysql database
SELECT RANDOM name FROM table or SELECT name FROM table ORDER BY RANDOM LIMIT 1 not tested, used at your own free will. -- me - Original Message - From: mm fernandez [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 14, 2002 11:37 PM Subject: [PHP] retrieving random data from mysql database hi, can you teach me how to retrieve random data from my database? like for example...i have a list of names on my database and i'd like to retrieve only one name at a time..randomly. how do i go about this? hope someone can help...thanx. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Can not delete files that were uploaded
Be warned that if PHP can delete them, so can anybody else on the shared server who wants to write a PHP script to delete them, unless you've configured PHP specially to run as a specific user, which is unlikely for most ISP setups. How can PHP be configured to run as a specific user? I'm referring to a DSO installation, where I assume that because PHP is 'part' of Apache, it would be the same user as Apache. Apache 2.0 allows that... Meanwhile, in *CURRENT* ISP-land :-) Some ISPs give you *BOTH* Apache as Module (DSO) and as CGI via suExec, using different extensions. So for those really critical security pages that need to run as you, use the .phpcgi (or whatever) extension and leave the rest as normal .php Actually, I don't even know what the extension is that does .phpcgi on my servers, I just use the ForceType directive to set the mime-type. It's nice to be able to run a PHP script as me when I have to instead of as nobody Very nice. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question 1
I am looking at importing data from rdtool into a mysql backend And not sure how to go about it... I was wondering if anyone has tried this or know of some information that may help. Or even a theroy on how the best way would be to do this... Thanks in advance.. --- Chris Kay Technical Support - Techex Communications Website: www.techex.com.au Email: [EMAIL PROTECTED] Telephone: 1300 88 111 2 - Fax: (02) 9970 5788 Address: Suite 13, 5 Vuko Place, Warriewood, NSW 2102 Platinum Channel Partner of the Year - Request DSL - Broadband for Business --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Training / Courses in Australia
Would anyone know of any PHP training or courses in Australia... Also for the devolopers... Is there at present, or a future plan for a PHPCE A certified engineer :) Just a thought since everyone else has them --- Chris Kay Technical Support - Techex Communications Website: www.techex.com.au Email: [EMAIL PROTECTED] Telephone: 1300 88 111 2 - Fax: (02) 9970 5788 Address: Suite 13, 5 Vuko Place, Warriewood, NSW 2102 Platinum Channel Partner of the Year - Request DSL - Broadband for Business --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Newbie Date question
include(Calc.php); #http://www.phpinsider.com/php/code/Date_Calc/ #Date_Calc - a class for manipulating and comparing #Calendar dates, as well as formulating arrays of dates # for traditional calendar display. $yesterday = Date_Calc::prevDay($day=date('d'),$month=date('m'),$year=date('Y'),$format=%m-%Y-%d); Hope that helps. -J On Sun, 14 Jul 2002 23:01:07 +1200, Royw wrote: If: $today = date(Y-m-d); Then how to I get: $yesterday = ? Thanks! -- Jason Morehouse (jm [@] netconcepts [.] com) Netconcepts LTD - Auckland, New Zealand * Linux: Because rebooting is for adding hardware. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] DOM XML : experimental ?
Hi, I am planning to use PHP to develop some scripts that will need to create and manipulate html pages. One of the things that will be created is a DOM tree of the html. After reading the manual I've found that php supports the event-driven and dom xml, but with the latter tagged as EXPERIMENTAL. I've also noticed that as of 4.3.0-dev (which I am using) the api has changed. So I'd like to know how experimental (also stable) this support is and suggestions regarding this issue and DOM itself. One of the main issues is that I'll need to cope with html (not xml) and mostly not well-formed. Regards. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Does not work
ðÒÉ×ÅÔ! Saci wrote: // HTTP_REFERER as a feature. In short, it cannot really be trusted. Anybody know how to do that using JAva history with PHP together , or any other methode that works and can be trusted. Thank god no method can be trusted :) History even less the the referrer. Just think of the frequency at which people in their offices clear it to avoid bosses seeing where they surfed while they were supposed to work... You'll never get a secure method, and if you do I'll personally report you to the authority for protection of privacy :) Marketing dotcoms would just love to do it, but fortunately it cannot be done :) Relax, you can live without knowing where some of the guys came from. Most won't mind telling you. But I just cleared my history immediately after reading your msg :) Pavlovian reaction ;) ÐÏËÁ áÌØÂÅÒÔÏ ëÉÅ× -_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_- LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] (Exact) Difference between - and ::
ðÒÉ×ÅÔ! Micha wrote: Hi, I would like to know the exact difference between - and ::. I know that I can use as class directcly by using :: but I still don't know the exact meaning So why do they use in Example 8 on http://www.php.net/source.php?url=/zend2_example.phps $this-id = self::$id++ and not self::id++ or $this-id++ ... ? Some OO languages (notably smalltalk does it) name a difference between Class methods (and variables) and instance variables. What is class can be used and executed even when lacking any actual instance of the class. PHP has not fully implemented this model (we miss class variables, that is, a value that is common and general to all instances of a given class) but does have a bit of it. So :: is mainly used to execute a method without needing to create an instance for it. If your class Printer has a method changeCartridge() you can use Printer::changeCartridge() without the need of any prior $myPrinter = new Printer() That is, you use a class as a common library. This has a limitation in that you cannot dinamically say $myclass::changeCartridge(), while you can say: $a = printer; $p = new $a(); $p-changeCartridge(); The operator :: cannot address internal variables directly like - does for the simple reason that no variable exists, in the absence of the instance. Which is why you declare $ signs. :: operator is also handy when you need to call an overriden method. By saying parent::myMethod() you call your parent's method, while $this-myMethod would execute the locally redeclared code. - operator can be read (maybe it must be read, I don't know) as belongs to. So this-a means the $a that belongs to $this (the object in which you are executing class code). - obviously only applies to single instances and not to classes. Hope it was clear. ÐÏËÁ áÌØÂÅÒÔÏ ëÉÅ× -_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_- LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Does not work
Pffft you can't trust Java, JavaScript or anything on the server side at all. Since it's set by the browser (client) itself, the best you can do is test for it, and provide a fall back option. For the bulk of users, this will be okay, because they're on IE. What you need to be carefull of is what effect your fall back has on the unknown browsers. Or design/program without the need to know what they're using :D Justin French on 15/07/02 5:34 AM, Saci ([EMAIL PROTECTED]) wrote: // HTTP_REFERER as a feature. In short, it cannot really be trusted. Anybody know how to do that using JAva history with PHP together , or any other methode that works and can be trusted. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: compiling with mysql
In article Pine.LNX.4.21.0207120957190.1434- [EMAIL PROTECTED], [EMAIL PROTECTED] says... Another PHP compilation question ... I've just compiled PHP 4.2.1 --with-mysql. I added no path to mysql, and it worked fine as it always does. However, I'm keen to add mod_python as a DSO to Apache as well, and noticed in PHP's INSTALL notes that I'll probably need to recompile PHP with a path to mysql: --with-mysql=/somewhere/or/other/ 1. Is this always the case? 2. Where would the path be likely to be on RedHat 7.2 with MySQL rpms? I'm not a Redhat user, but I think you will have to have installed a source rpm for mysql. You can probably check if you have the include files installed by doing locate mysql.h to give you the mysql include directory, possibly something like /var/mysql/include or /usr/local/mysql/include. Stripping the /include should give you the 'parent' directory under which both the include files and lib files can be found. Cheers -- 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] IF inside LOOP?
Hi all. Ive been fooling around with a LOOP which should show one or more text string stored in separate rows in a DB. The trick would we to separate them with commas (,) when theres another string to show or end it with a period (.) if no other row is found according to the SELECT criteria. This is what I have so far: for ($m=0; $m$num_rows2; $m++) { $row2 = mysql_fetch_array($result2); echo $row2[devlanguage]; if ($m $num_rows2) { echo , ; } else { echo .; } } The problem is that the LOOP stops as its told to do, keeping the ELSE statement from doing its work, resulting in comma separated string as it should, but also add an extra comma at the end of it instead of a period. What approach should I use? Thanks in advance, mailto:[EMAIL PROTECTED] Cesar Aracena CE / MCSE+I Neuquen, Argentina +54.299.6356688 +54.299.4466621
RE: [PHP] IF inside LOOP?
try using this if statement instead if ($m $num_rows2 - 1) or even use the ?: operator echo ($m $num_rows2 - 1 ? , : .); -Original Message- From: César Aracena [mailto:[EMAIL PROTECTED]] Sent: Monday, July 15, 2002 12:04 PM To: PHP General List Subject: [PHP] IF inside LOOP? Hi all. I've been fooling around with a LOOP which should show one or more text string stored in separate rows in a DB. The trick would we to separate them with commas (,) when there's another string to show or end it with a period (.) if no other row is found according to the SELECT criteria. This is what I have so far: for ($m=0; $m$num_rows2; $m++) { $row2 = mysql_fetch_array($result2); echo $row2[devlanguage]; if ($m $num_rows2) { echo , ; } else { echo .; } } The problem is that the LOOP stops as it's told to do, keeping the ELSE statement from doing it's work, resulting in comma separated string as it should, but also add an extra comma at the end of it instead of a period. What approach should I use? Thanks in advance, mailto:[EMAIL PROTECTED] Cesar Aracena CE / MCSE+I Neuquen, Argentina +54.299.6356688 +54.299.4466621 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] IF inside LOOP? -- SOLVED
Thanks for two things Martin: First for teaching me about the -1 operation (which seems logic now) and second, for getting me into the ?: operator. I've read something about it in the books, but didn't tough it was really useful 'till now. It worked perfectly. C. -Original Message- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: Sunday, July 14, 2002 11:05 PM To: 'César Aracena'; PHP General List Subject: RE: [PHP] IF inside LOOP? try using this if statement instead if ($m $num_rows2 - 1) or even use the ?: operator echo ($m $num_rows2 - 1 ? , : .); -Original Message- From: César Aracena [mailto:[EMAIL PROTECTED]] Sent: Monday, July 15, 2002 12:04 PM To: PHP General List Subject: [PHP] IF inside LOOP? Hi all. I've been fooling around with a LOOP which should show one or more text string stored in separate rows in a DB. The trick would we to separate them with commas (,) when there's another string to show or end it with a period (.) if no other row is found according to the SELECT criteria. This is what I have so far: for ($m=0; $m$num_rows2; $m++) { $row2 = mysql_fetch_array($result2); echo $row2[devlanguage]; if ($m $num_rows2) { echo , ; } else { echo .; } } The problem is that the LOOP stops as it's told to do, keeping the ELSE statement from doing it's work, resulting in comma separated string as it should, but also add an extra comma at the end of it instead of a period. What approach should I use? Thanks in advance, mailto:[EMAIL PROTECTED] Cesar Aracena CE / MCSE+I Neuquen, Argentina +54.299.6356688 +54.299.4466621 -- 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] two way encryption
Hi all, I'm looking at a way of encrypting AND decrypting a string (cc#) with a key. I plan to store the key in a file outside the docroot, and have asked the ISP for as much advice as possible to protect the key file. Anyway, since it needs to be encrypted and decrypted with a key, I obviously can't use the old faithfull md5(), and from my understanding of the manual, crypt() is also one-way. Then I found mcrypt_encrypt() and mcrypt_decrypt(). Paraphrasing the samples in the php manual, does the below code achieve what I want, assuming that the key would usually be stored in a separate file outside the docroot? ? $iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND); $key = This is a very secret key; $text = ; echo plain string: {$text}BR; $crypttext = mcrypt_encrypt (MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_ECB, $iv); echo encoded string: {$crypttext}BR; $dectext = mcrypt_decrypt (MCRYPT_RIJNDAEL_256, $key, $crypttext, MCRYPT_MODE_ECB, $iv); echo decoded string: {$dectext}BR; ? I'm getting the following error using 4.1.1: Fatal error: Call to undefined function: mcrypt_create_iv() in /usr/local/apache/htdocs/tests/enc.php on line 3 Which is confusing, given that the manual says mcrypt_create_iv() is available in PHP 4. Any ideas / contributions / pointers? Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] two way encryption
Justin French wrote: I'm getting the following error using 4.1.1: Fatal error: Call to undefined function: mcrypt_create_iv() in /usr/local/apache/htdocs/tests/enc.php on line 3 Which is confusing, given that the manual says mcrypt_create_iv() is available in PHP 4. Looks like your ISP doesn't have mcrypt support. What does phpinfo() show? General encryption advice -- generate your key using urandom and save it to your key file. It will be much more secure than anything you can think up for a good key. HTH, Joe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Does not work
To say the minumum yor reply does not help in nothing. Who cares about privacy on my own company Intranet ? Alberto Serra [EMAIL PROTECTED] escreveu na mensagem [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... ðÒÉ×ÅÔ! Saci wrote: // HTTP_REFERER as a feature. In short, it cannot really be trusted. Anybody know how to do that using JAva history with PHP together , or any other methode that works and can be trusted. Thank god no method can be trusted :) History even less the the referrer. Just think of the frequency at which people in their offices clear it to avoid bosses seeing where they surfed while they were supposed to work... You'll never get a secure method, and if you do I'll personally report you to the authority for protection of privacy :) Marketing dotcoms would just love to do it, but fortunately it cannot be done :) Relax, you can live without knowing where some of the guys came from. Most won't mind telling you. But I just cleared my history immediately after reading your msg :) Pavlovian reaction ;) ÐÏËÁ áÌØÂÅÒÔÏ ëÉÅ× @-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@ LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ignore_user_abort question
Hi, got a question. What happend if ignore_user_abort is true, and the user closes the window? Also, i tried, but i push the stop button, and the script stops, shouldn ignore that?. Thx :D _ MSN Fotos: la forma más fácil de compartir e imprimir fotos. http://photos.msn.es/support/worldwide.aspx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Does not work
-Original Message- From: Saci [mailto:[EMAIL PROTECTED]] Sent: Monday, 15 July 2002 12:51 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Does not work To say the minumum yor reply does not help in nothing. Who cares about privacy on my own company Intranet ? u the bosses.. the employees tring to hide where they been from the bosses... the network admin... the list goes on and on and on and on and on and on and on ...
Re: [PHP] two way encryption
on 15/07/02 12:41 PM, Joe Conway ([EMAIL PROTECTED]) wrote: Looks like your ISP doesn't have mcrypt support. What does phpinfo() show? Well, that was on my local test server, which I didn't compile with mcrypt... so that solves that, but it appears my ISP didn't compile with it either... so there's very little point in getting my local server working with it. What alternatives do I have? General encryption advice -- generate your key using urandom and save it to your key file. It will be much more secure than anything you can think up for a good key. Good advice. Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] two way encryption
Justin French wrote: Well, that was on my local test server, which I didn't compile with mcrypt... so that solves that, but it appears my ISP didn't compile with it either... so there's very little point in getting my local server working with it. What alternatives do I have? I don't *think* PHP includes any builtin-by-default, non-one-way encryption functions, but I haven't looked in a long time so I could be wrong. You might be able to get your ISP to install mcrypt itself which has a command line utility. Then you could use passthru() I suppose. Joe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Does not work
I agree, I made a mistake on my last reply , and I apologize for that. Thank you also for you for your coments, but my main question still open without any related reply. To say the minumum yor reply does not help in nothing. Who cares about privacy on my own company Intranet ? 1. I don't believe you specified this was a company intranet, but you may have. 2. Generally it's a good idea to get things right the first time, rather than assuming that something will always remain in it's current state. I tend to copy-and-paste a lot of code from one project to another, or assemble libraries of code. It might be okay for you to say this code works for a limited environment, and i'm happy with that, but will you remember this when: a) you copy it across to another project b) the status of the project changes or is extended c) the project is no longer in your control If you insist on sticking with this limitation, do yourself and your co-workers a favour, and ensure you: a) comment your code well, pointing out the limitation b) do some minimal (at least) error handling to deal with the fact that it may not be there 3. The reply WAS helpful, raised some important issues, and IMHO you should have thanked the poster for being kind enough to point out issues you may not have thought of. You could have easily replied with thanks for those pointers, but I'm less concerned with privacy, since this is a corporate intranet. I'm not sure I'd ever help you again, if I'd received a reply such as yours. Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Does not work
This works for me, PHP 4.1.1 Upon first loading the page, I get nothing, but when I click on go, I get both referrer address' echoed. refer.php: --- html body A HREF=refer.phpgo/aBRBR Page refered by ?php echo $HTTP_REFERER.'br'; echo $_SERVER['HTTP_REFERER'].'br'; ? /body /html --- It's already been said but: 1. are you sure php is working (with other files, and with simple echo hello world!; type stuff)? 2. use this file (phpinfo.php) to test for the existence of HTTP_REFERER: refer.php: --- html body A HREF=refer.phpgo/aBRBR Page refered by ?php echo $HTTP_REFERER.'br'; echo $_SERVER['HTTP_REFERER'].'br'; ? /body /html --- Upon first loading, it will not be set, but when you click go, you have a referer, and it is set. For me, it's listed under the Apache Environment heading. If you still can't get a referrer var after all that, then there's an issue with your server (are you using apache) or perhaps the client (browser). because it *should* be simple. Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] two way encryption
sorry to step in, but did you consider base64_[encode|decode] ? -- james Justin French wrote: Well, that was on my local test server, which I didn't compile with mcrypt... so that solves that, but it appears my ISP didn't compile with it either... so there's very little point in getting my local server working with it. What alternatives do I have? I don't *think* PHP includes any builtin-by-default, non-one-way encryption functions, but I haven't looked in a long time so I could be wrong. You might be able to get your ISP to install mcrypt itself which has a command line utility. Then you could use passthru() I suppose. Joe -- 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] retrieving random data from mysql database
When you say, Order by RAND() I would think the Order by construct expects a column name. In your case, it gets a decimal value. How does Order by treat decimal values? Oh, I just checked the manual: In MySQL Version 3.23, you can, however, do: SELECT * FROM table_name ORDER BY RAND() I still don't understand how does Order by work with a decimal value!!! David Freeman [EMAIL PROTECTED] wrote: can you teach me how to retrieve random data from my database? like for example...i have a list of names on my database and i'd like to retrieve only one name at a time..randomly. how do i go about this? This is really a database question rather than a php question and you haven't said which database you're using so it's hard to give a definitive answer. In MySQL you'd do something like this: Select * from some_table where some_condition order by RAND() limit 1; That would select one random row out of all rows that meet some_condition. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php - Do You Yahoo!? Yahoo! Autos - Get free new car price quotes
Re: [PHP] two way encryption
base64 doesn't have a key, so anyone could decode the string, which is obviously not desirable :) thanks anyway Justin on 15/07/02 2:00 PM, James Cox ([EMAIL PROTECTED]) wrote: sorry to step in, but did you consider base64_[encode|decode] ? -- james Justin French wrote: Well, that was on my local test server, which I didn't compile with mcrypt... so that solves that, but it appears my ISP didn't compile with it either... so there's very little point in getting my local server working with it. What alternatives do I have? I don't *think* PHP includes any builtin-by-default, non-one-way encryption functions, but I haven't looked in a long time so I could be wrong. You might be able to get your ISP to install mcrypt itself which has a command line utility. Then you could use passthru() I suppose. Joe -- 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