[PHP] filemtime() error
Hi, i'm writing a piece of code that allows me to upload the updated version of my website from the local tree, to the server. I do this by comparing the linux timestamps on the local and remote files. printing a table of the remote files works fine, but when i do it for my local files, i get an error for every file: Warning: stat failed for bandhistory.html (errno=2 - No such file or directory) in /Users/jslootbe/Sites/upload.php on line 71 except for the index.php which just gives me a normal timestamp. this is a dump of the dir: total 232 drwxr-xr-x 25 jslootbe staff850 Nov 6 11:20 . drwxr-xr-x 11 jslootbe staff374 Nov 6 13:59 .. -rwxr-xr-x 1 jslootbe staff 15364 Nov 2 16:11 .DS_Store -rwxr-xr-x 1 jslootbe staff519 Oct 20 20:15 band.php -rwxr-xr-x 1 jslootbe staff 2034 Oct 23 00:56 bandhistory.html -rwxr-xr-x 1 jslootbe staff 1021 Nov 5 21:50 blindtheory.sql -rwxr-xr-x 1 jslootbe staff 1016 Nov 5 21:32 blindthoery.sql -rwxr-xr-x 1 jslootbe staff322 Oct 8 19:08 colors.inc.php -rwxr-xr-x 1 jslootbe staff146 Oct 8 19:08 contact.php -rwxr-xr-x 1 jslootbe staff 2266 Nov 5 00:13 dates.php -rwxr-xr-x 1 jslootbe staff188 Oct 8 19:08 globals.inc.php -rwxr-xr-x 1 jslootbe staff194 Oct 9 20:35 globals.inc.php-online -rwxr-xr-x 1 jslootbe staff 4 Oct 9 20:32 home.php -rwxr-xr-x 1 jslootbe staff 3376 Oct 30 21:21 index.php -rwxr-xr-x 1 jslootbe staff 5851 Nov 6 11:20 interaction.php -rwxr-xr-x 1 jslootbe staff 2958 Nov 5 00:16 layout.php drwxr-xr-x 18 jslootbe staff612 Oct 19 13:55 lyrics -rwxr-xr-x 1 jslootbe staff 1457 Oct 25 20:42 lyrics.php -rwxr-xr-x 1 jslootbe staff 2578 Oct 25 20:32 media.php -rwxr-xr-x 1 jslootbe staff815 Nov 5 00:18 misc.inc.php -rwxr-xr-x 1 jslootbe staff 1370 Oct 20 19:39 news.php -rwxr-xr-x 1 jslootbe staff 21 Oct 8 22:39 phpinfo.php drwxr-xr-x 7 jslootbe staff238 Oct 10 12:38 pics -rwxr-xr-x 1 jslootbe staff148 Oct 8 19:08 template.php -rwxr-xr-x 1 jslootbe staff 1064 Nov 3 18:53 todo.list and here's the code. $localDir = /Users/jslootbe/Sites/blindtheory; if ($opendir = opendir($localDir)) { while ($localList = readdir($opendir)) { if ($localList != . $localList != ..) { echo tr td.$localList./td tdmodified/td td.filemtime($localList)./td /tr; } } closedir($opendir); } does anyone have any idea why it won't show a stamp for every file? TIA, Jule Jule Slootbeek [EMAIL PROTECTED]
Re: [PHP] Code Advice
Hmm.. So then can anyone tell me why its working so far? ;) I am trying out every single function in this page in hopes to catch something, but so far I don't see any breakage - I can see there are a few ways to skin this cat.. the original code I posted DOES work.. I still may be blind to any future breakings.. that's why I posted it. Unfortunately, I'm getting responses saying that this code won't work at all - when it does.. :-/ Mike Ford wrote: -Original Message- From: Kevin Stone [mailto:kevin;helpelf.com] Sent: 06 November 2002 18:50 To: [EMAIL PROTECTED] Subject: Re: [PHP] Code Advice All I have to go by is what I see. The method was this.. ? $get_allow = array('foo', 'bar', 'add', 'takeovertheworld'); while (list($key,$val)=each($get_allow)) { if (isset($_GET[$key])) $$key = $val; } ? The array $get_allow has numerical indicies. Looping through that in the method described is going to set an integer to $key. So your first error is going to be that $_GET[0] is Undefined. Second error is going to be $$key is an invalid variable name. Mea culpa -- you're quite right, and I should read more carefully! (Well, it is 7pm and going home time) This should, of course, be done like this: $get_allow = array(..); foreach ($get_allow as $key): if (isset($_GET($key)): $$key = $_GET[$key]; endif; endforeach; Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Code Advice
At 20:08 06.11.2002, Ford, Mike [LSS] spoke out and said: [snip] -Original Message- [...snip...] value, in _GET or _POST? Try this: foreach ($_POST as $name = $value) $_GET[$name] = $value; Your application may safely use only the $_GET array after this, the POSTed variables correctly overriding their GET counterparts. The = reference is there for optimization - faster and less memory-consuming. Uh... isn't this what $_REQUEST is for?? [snip] Yessir, exactly. However if you're going to fiddle around with $_GET (checking for allowed input) while allowing any $_POST'ed data, you might prefer this solution... -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
Re: [PHP] generically accessing member variables problem
Well, if, say, one class has this function: function inherit($class_name, $pointer) { $this-objects[$class_name] = $pointer; } then you end up knowing that, whenever you need to access an instance for a class, you can use $this-objects['that_class']-that_array. What I picked on, was that you were assigning keys automatically with ($array[] = ...) and that makes it impossible pointing to the right element directly without having to loop the whole array, which is an overkill. The rest of your logic is pretty complex but doable. As long as you plan off well the complete OOD for that. So, my conclusion is: It is OK storing all objects in one single array, but name then the way you can find them later. If you have multiple instances of the same class, use numeric keys but assign them under a certain logic - not automatically, so you can find/use/destroy them at any point. can't give you more info here as that is all I know of it. Check out the CVs tree for ZoomStats - www.zoomstats.org, it is a 100% OOP PHP app and can give you some hints. -- Maxim Maletsky [EMAIL PROTECTED] John Kenyon [EMAIL PROTECTED] wrote... : I am not really sure I understand what you are saying here, and I would like to. Let me first say that I think the syntax you came up with earlier will solve my immediate problem, but if I could design this in a better way I'd like to know. Let me give you a few more details: I have a large class that contains multiple instances of various different classes, in turn, each of these instances could contain multiple instances of other classes. A big tree. In order to keep track of the various instances of the classes I use arrays, so each class that contains instances of other classes keeps like classes within an array. Sometimes a class has multiple arrays, each holding instances of a different type of class. Each of these classes is being used to generate html forms and I want to have a way to have the user check a checkbox and remove a particular instance of a class. I want to have one function that I can plop into each class (in some cases it may be possible to have children inherit the function from a parent class) and which will delete the correct instance of the correct class by passing in the name of the array the instance is held in and its index in that array. I hope this provides you with a little more context and if your advice still pertains, please explain it if you would. jck Maxim Maletsky wrote: You pass it the name of the element, and whatever the data inside. You do not need to add other sub-elements to it automatically, as you would need to be searching through the elements later for the right data. Whatever your need is - it's a good idea using arrays, and add other arrays into it. But, it is a bad idea cloning variables and auto-assign array's elements when you know that you will need that specific piece you store alone. -- Maxim Maletsky [EMAIL PROTECTED] John Kenyon [EMAIL PROTECTED] wrote... : See below: MM class Example { MM var $array = array(); MM function add2array($element_name, $val){ MM $this-$array[$element_name] = $val; MM } MM } MM $t = new Example(); $t-add2array('array1',25); $t-add2array('array2',26); $t-add2array('array3',Hello); MM echo 'pre'; MM print_r($t); MM echo '/pre'; MM Cleaner and more scalable, no? Yes and to fit the original 3 seperate arrays it would be function add2array($element_name, $val){ $this-$array[$element_name][] = $val; } No, because you pass it the name and data. This way every name will become element's name containing the relevant data. Your way just makes it an associative array without a way of directly accessing it. -- Maxim Maletsky [EMAIL PROTECTED] But my problem is that I have several arrays already and I want to be able to act on a specific array depending on the name I pass in. I don't see how your solution solves that issue. jck -- 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] Code Advice
At 20:13 06.11.2002, Jason Young spoke out and said: [snip] Hmm.. So then can anyone tell me why its working so far? ;) I am trying out every single function in this page in hopes to catch something, but so far I don't see any breakage - I can see there are a few ways to skin this cat.. the original code I posted DOES work.. I still may be blind to any future breakings.. that's why I posted it. Unfortunately, I'm getting responses saying that this code won't work at all - when it does.. :-/ [snip] Well - it's a miracle... I just tried the code you posted, and indeed PHP (v.4.2.2) allows numeric identifiers - BUT ONLY as long as you're accessing it indirectly. Example: $key = 0; $$key = 'some data';// works echo $$key; // works echo Key 0: $0// prints $0, not the content (wrong) echo $0;// error unexpected T_DNUMBER -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
Re: [PHP] Code Advice
It's probably working becuase you have register_globals = ON in your php.ini and those variable names are being set by default. Your posted code is actually doing nothing. What I can't figure is why you're not getting any errors. :-\ -Kevin - Original Message - From: Jason Young [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 12:13 PM Subject: Re: [PHP] Code Advice Hmm.. So then can anyone tell me why its working so far? ;) I am trying out every single function in this page in hopes to catch something, but so far I don't see any breakage - I can see there are a few ways to skin this cat.. the original code I posted DOES work.. I still may be blind to any future breakings.. that's why I posted it. Unfortunately, I'm getting responses saying that this code won't work at all - when it does.. :-/ Mike Ford wrote: -Original Message- From: Kevin Stone [mailto:kevin;helpelf.com] Sent: 06 November 2002 18:50 To: [EMAIL PROTECTED] Subject: Re: [PHP] Code Advice All I have to go by is what I see. The method was this.. ? $get_allow = array('foo', 'bar', 'add', 'takeovertheworld'); while (list($key,$val)=each($get_allow)) { if (isset($_GET[$key])) $$key = $val; } ? The array $get_allow has numerical indicies. Looping through that in the method described is going to set an integer to $key. So your first error is going to be that $_GET[0] is Undefined. Second error is going to be $$key is an invalid variable name. Mea culpa -- you're quite right, and I should read more carefully! (Well, it is 7pm and going home time) This should, of course, be done like this: $get_allow = array(..); foreach ($get_allow as $key): if (isset($_GET($key)): $$key = $_GET[$key]; endif; endforeach; Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Trouble with php-4.2.3, apache-1.3.27, sablotron 0.96
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Nope... same error. Patch worked perfectly, LDFLAGS=-lstdc++ did too. End result: same error. Any other ideas??? On Wednesday 06 November 2002 09:09 am, you wrote: Hi, Wednesday, November 6, 2002, 2:50:42 PM, you wrote: EN -BEGIN PGP SIGNED MESSAGE- EN Hash: SHA1 EN I'm trying to get XSLT working with PHP, and after slowly working my way EN through several other problems, I've found one that I can't figure out. EN Software: EN PHP 4.2.3 EN Apache 1.3.27 EN Sablotron 0.96 EN GCC 3.2 EN Linux 2.4.19-lsm1 EN ./configure \ EN - --enable-xml \ EN - --enable-xslt \ EN - --enable-ftp \ EN - --enable-sockets \ EN - --enable-pcntl \ EN - --with-apxs=/usr/local/apache/bin/apxs \ EN - --with-xslt-sablot \ EN make \ EN sudo make install EN Everything seems to work fine (except for a lot of EN cc1: warning: changing search order for system directory /usr/local/include EN cc1: warning: as it has already been specified as a non-system directory EN 's that appear when using gcc-3.2), but when I try to EN /usr/local/apache/bin/apachectl restart, I get this: EN Syntax error on line 205 of /usr/local/apache/conf/httpd.conf: EN Cannot load /usr/local/apache/libexec/libphp4.so into server: EN /usr/local/lib/libsablot.so.0: undefined symbol: __gxx_personality_v0 EN /usr/local/apache/bin/apachectl start: httpd could not be started EN Any ideas??? EN -BEGIN PGP SIGNATURE- EN Version: GnuPG v1.0.7 (GNU/Linux) EN iD8DBQE9yJ/J/rncFku1MdIRAkhnAKClykcWMUwiWbslAYklx3xm1qsjSQCdFAXh EN roJ+kMyayqdY1UXxL6S5xuQ= EN =1Zaw EN -END PGP SIGNATURE- You probably need this patch http://download-2.gingerall.cz/download/sablot/Sablot-0.96.1.patch You can also use LDFLAGS=-lstdc++ before configuring PHP more info at http://php.benscom.com/manual/en/ref.xslt.php - -- Jesus Christ: Imaginary Playmate to Millions of Adults! - -Unknown -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9yW8T/rncFku1MdIRAhMXAKCFp4MyUAp2/oLVIwcXS4L0utNOVgCglIPf 5qP6pDQ/mrNX+CT5pV7X6oc= =wdaO -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code Advice
On Wed, 6 Nov 2002, Jason Young wrote: So then can anyone tell me why its working so far? ;) It doesn't work at all like you want it to. I assume you've already put this script up on a web server to test, so watch this: After this line: $$key = $val; Insert this line for debugging: echo $key . -- . $val . br\n; Then visit the script: scriptname.php?foo=22=1 You've created something far worse than register globals. Someone already posted a decent solution, something like this: foreach( $get_allow as $get_key = $get_val ){ if( isset( $_GET[$get_val] ) ){ ${$get_val} = $_GET[$get_val]; echo $get_val . -- . $_GET[$get_val] . br\n; } } g.luck, ~Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code Advice
Oh ho! Good call Mr. Vogelsinger. I would never have guessed. So infact the code DOES work. My apologies Jason, I guess ya learn something new every day. ;-) -Kevin - Original Message - From: Ernest E Vogelsinger [EMAIL PROTECTED] To: Jason Young [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 12:31 PM Subject: Re: [PHP] Code Advice At 20:13 06.11.2002, Jason Young spoke out and said: [snip] Hmm.. So then can anyone tell me why its working so far? ;) I am trying out every single function in this page in hopes to catch something, but so far I don't see any breakage - I can see there are a few ways to skin this cat.. the original code I posted DOES work.. I still may be blind to any future breakings.. that's why I posted it. Unfortunately, I'm getting responses saying that this code won't work at all - when it does.. :-/ [snip] Well - it's a miracle... I just tried the code you posted, and indeed PHP (v.4.2.2) allows numeric identifiers - BUT ONLY as long as you're accessing it indirectly. Example: $key = 0; $$key = 'some data';// works echo $$key; // works echo Key 0: $0// prints $0, not the content (wrong) echo $0;// error unexpected T_DNUMBER -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] To Move Recordset back to initial position
Hi All: I am having a problem in MySQL records,If i used the record set once and later on if i want to use the same record set in some oteher place in the same page its behive like an empty recordset, I want to know is there any method to (recordset.moveFirst or some thing) move the cursor towards the initial position? Thanks in advance Prad __ Do you Yahoo!? HotJobs - Search new jobs daily now http://hotjobs.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code Advice
register_globals is definately off.. Maybe its a PHP miracle, as Ernest suggested.. maybe Rasmus or someone else on the PHP dev team has something to say about it, but it works.. maybe you all could use it :-D Hopefully I didn't find a bug :-o -J Kevin Stone wrote: It's probably working becuase you have register_globals = ON in your php.ini and those variable names are being set by default. Your posted code is actually doing nothing. What I can't figure is why you're not getting any errors. :-\ -Kevin - Original Message - From: Jason Young [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 12:13 PM Subject: Re: [PHP] Code Advice Hmm.. So then can anyone tell me why its working so far? ;) I am trying out every single function in this page in hopes to catch something, but so far I don't see any breakage - I can see there are a few ways to skin this cat.. the original code I posted DOES work.. I still may be blind to any future breakings.. that's why I posted it. Unfortunately, I'm getting responses saying that this code won't work at all - when it does.. :-/ Mike Ford wrote: -Original Message- From: Kevin Stone [mailto:kevin;helpelf.com] Sent: 06 November 2002 18:50 To: [EMAIL PROTECTED] Subject: Re: [PHP] Code Advice All I have to go by is what I see. The method was this.. ? $get_allow = array('foo', 'bar', 'add', 'takeovertheworld'); while (list($key,$val)=each($get_allow)) { if (isset($_GET[$key])) $$key = $val; } ? The array $get_allow has numerical indicies. Looping through that in the method described is going to set an integer to $key. So your first error is going to be that $_GET[0] is Undefined. Second error is going to be $$key is an invalid variable name. Mea culpa -- you're quite right, and I should read more carefully! (Well, it is 7pm and going home time) This should, of course, be done like this: $get_allow = array(..); foreach ($get_allow as $key): if (isset($_GET($key)): $$key = $_GET[$key]; endif; endforeach; Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql list
if anyone is on the mysql list why do i keep getting this , i can post anything dammit Your message cannot be posted because it appears to be either spam or simply off topic to our filter. To bypass the filter you must include one of the following words in your message: sql,query If you just reply to this message, and include the entire text of it in the reply, your reply will go through. However, you should first review the text of the message to make sure it has something to do with MySQL. Just typing the word MySQL once will be sufficient, for example. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] publishing php mysql website on cd-rom
Thinking about this more A U.K. based electronics company has a CD which is Databse driven. It is compleatly searchable etc I think its either RS or Maplin.or it might be someone else ;-) but its a company like them.. John - Original Message - From: ROBERT MCPEAK [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: GUY CHALK [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 6:23 PM Subject: Re: [PHP] publishing php mysql website on cd-rom It's a database site, containing thousands of records, similar to a products catalog like Amazon, for example. Publishing as static pages is not a viable option, and would greatly limit the search functionality. There must be a way to do this! Thanks for all the feedback. Maxim Maletsky [EMAIL PROTECTED] 11/06/02 12:10PM Theoretically it is possible, but fact stays - you won't ever make it work well. So, try to find an alternative for this. Usually, this choice is made by the managers that know nothing about how webcontent works. -- Maxim Maletsky [EMAIL PROTECTED] ROBERT MCPEAK [EMAIL PROTECTED] wrote... : My organization has a need to publish some of our web content on a CD-ROM. I'm in search of suggestions on how to publish our dynamic content (php/mysql templates) in some sort of runtime configuration that would let users browse the site from cd. What's involved with this? Is there such a thing as runtime mySQL? What would it take to serve PHP from a CD? Help! I don't know where to begin and am looking for advice. Thanks, Bob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] installing PHP with netscape on Sun Solaris
Hello, installing PHP with netscape on Sun Solaris Iplanet webserver 4.1 Sun Solaris 2.7 followed instruction as published at http://www.php.net/manual/sv/install.netscape-enterprise.php Onstep 6 of Basic install during netscape server configuration it errors out. Attached is the config.log. gcc3.2 which comes with libgcc-3.2 ia installed, even then the errors are displayed. Screen shot of error intranet{ghoshj}64: ./configure --with-nsapi=/export/webtools/netscape/server4 - -enable-track-vars --enable-libgcc loading cache ./config.cache checking for Cygwin environment... no checking for mingw32 environment... no checking host system type... sparc-sun-solaris2.7 checking for a BSD compatible install... ./install-sh -c checking whether build environment is sane... yes checking whether make sets ${MAKE}... yes checking for working aclocal... found checking for working autoconf... found checking for working automake... found checking for working autoheader... found checking for working makeinfo... missing checking whether to enable maintainer-specific portions of Makefiles... no checking for gcc... gcc checking whether the C compiler (gcc ) works... no configure: error: installation or configuration problem: C compiler cannot creat e executables. thanks in advance for your suggestion. Joydeep config.log Description: application/unknown-content-type-txtfile -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code Advice
At 20:40 06.11.2002, Jason Young spoke out and said: [snip] register_globals is definately off.. Maybe its a PHP miracle, as Ernest suggested.. maybe Rasmus or someone else on the PHP dev team has something to say about it, but it works.. maybe you all could use it :-D [snip] Jason, as Chris already pointed out, this code doesn't do what you intend to do. You don't get an error because you do not access the variable name directly - at least not the variable your code generates (which is $0, $1, $2, etc). If you did you'd get a decent parser error - but unfortunately your data hides behind these identifiers. If register_globals is off I have absolutely no idea why you still have them available. Please recheck your testing code - I'm sure you'll notice the glitch... -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
[PHP] Help Needed with PhpMailer
Hi , I am using PhpMailer in my mail application. I keep getting this error when I run the application Message was not sent Mailer Error: SMTP Error: Could not authenticate Here is the code that I am using : ?php require(class.phpmailer.php); //require(class.smtp.php); $mail = new phpmailer(); $mail-IsSMTP(); // telling the class to use SMTP $mail-Host = smtp.abs.adelphia.net;smtp.dc2.adelphia.net; // SMTP server $mail-SMTPAuth = true; // turn on SMTP authentication $mail-Username = my_login; // SMTP username $mail-Password = my_password; // SMTP password $mail-From = [EMAIL PROTECTED]; $mail-FromName = Pushpinder Singh Garcha; $mail-AddAddress([EMAIL PROTECTED]); $mail-Subject = This is a Test Mail; $mail-Body = hi ! \n\n I am really very very anxious to see if this works or not !; $mail-WordWrap = 20; if(!$mail-Send()) { echo Message was not sent\n\n; echo Mailer Error: . $mail-ErrorInfo; } else { echo Message has been sent; } ? Pushpinder Singh Garcha _ Web Developer T. Falcon Napier and Associates, Inc. Off : 704 987 6500 Cell : 704 236 2939 Fax : 704 987 5002 _ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] To Move Recordset back to initial position
I believe it is mysql_data_seek($result, 0); -Kevin - Original Message - From: ppf [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 12:38 PM Subject: [PHP] To Move Recordset back to initial position Hi All: I am having a problem in MySQL records,If i used the record set once and later on if i want to use the same record set in some oteher place in the same page its behive like an empty recordset, I want to know is there any method to (recordset.moveFirst or some thing) move the cursor towards the initial position? Thanks in advance Prad __ Do you Yahoo!? HotJobs - Search new jobs daily now http://hotjobs.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] To Move Recordset back to initial position
You mean like php.net/mysql-data-seek ??? On Wednesday 06 November 2002 11:38 am, ppf wrote: Hi All: I am having a problem in MySQL records,If i used the record set once and later on if i want to use the same record set in some oteher place in the same page its behive like an empty recordset, I want to know is there any method to (recordset.moveFirst or some thing) move the cursor towards the initial position? Thanks in advance Prad __ Do you Yahoo!? HotJobs - Search new jobs daily now http://hotjobs.yahoo.com/ -- Christianity is the enemy of liberty civilization -August Bebel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code Advice
I just saw that post... I feel completely stupid at this point, might I point out. You're right - register_globals is by default 'on' on this particular server Im working on (I don't do a lot of PHP work on it), cuz its an older version and I haven't been bothered enough to upgrade it... I haven't tested it on something that has register_globals set to on. So yes.. indeed my code did absolutely nothing. Who wants to hire me? hah. Thanks for all the help, though.. I definately learned a few things and got some decent code in return to fiddle with! Thanks to all, apologies for the brain-death. -Jason Ernest E Vogelsinger wrote: At 20:40 06.11.2002, Jason Young spoke out and said: [snip] register_globals is definately off.. Maybe its a PHP miracle, as Ernest suggested.. maybe Rasmus or someone else on the PHP dev team has something to say about it, but it works.. maybe you all could use it :-D [snip] Jason, as Chris already pointed out, this code doesn't do what you intend to do. You don't get an error because you do not access the variable name directly - at least not the variable your code generates (which is $0, $1, $2, etc). If you did you'd get a decent parser error - but unfortunately your data hides behind these identifiers. If register_globals is off I have absolutely no idea why you still have them available. Please recheck your testing code - I'm sure you'll notice the glitch... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql list
[snip] if anyone is on the mysql list why do i keep getting this , i can post anything dammit To bypass the filter you must include one of the following words in your message: sql,query [/snip] Follow the directions to make sure the message gets to the list. My original reply to this got bounced from the PHP list. HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fw: [PHP] mysql list
Yes that has happened to me before. I don't know why it's so strict becuase you can bet your bouncing booty there are ways around it. But did you heed their advice and put MySQL somewhere in your message? -Kevin - Original Message - From: electroteque [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 12:42 PM Subject: [PHP] mysql list if anyone is on the mysql list why do i keep getting this , i can post anything dammit Your message cannot be posted because it appears to be either spam or simply off topic to our filter. To bypass the filter you must include one of the following words in your message: sql,query If you just reply to this message, and include the entire text of it in the reply, your reply will go through. However, you should first review the text of the message to make sure it has something to do with MySQL. Just typing the word MySQL once will be sufficient, for example. -- 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] Help Needed with PhpMailer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Are you sure your SMTP requires authentication? If so, have you checked the username and password you supplied? On Wednesday 06 November 2002 11:19 am, Pushpinder Sngh Garcha wrote: Hi , I am using PhpMailer in my mail application. I keep getting this error when I run the application Message was not sent Mailer Error: SMTP Error: Could not authenticate Here is the code that I am using : ?php require(class.phpmailer.php); //require(class.smtp.php); $mail = new phpmailer(); $mail-IsSMTP(); // telling the class to use SMTP $mail-Host = smtp.abs.adelphia.net;smtp.dc2.adelphia.net; // SMTP server $mail-SMTPAuth = true; // turn on SMTP authentication $mail-Username = my_login; // SMTP username $mail-Password = my_password; // SMTP password $mail-From = [EMAIL PROTECTED]; $mail-FromName = Pushpinder Singh Garcha; $mail-AddAddress([EMAIL PROTECTED]); $mail-Subject = This is a Test Mail; $mail-Body = hi ! \n\n I am really very very anxious to see if this works or not !; $mail-WordWrap = 20; if(!$mail-Send()) { echo Message was not sent\n\n; echo Mailer Error: . $mail-ErrorInfo; } else { echo Message has been sent; } ? - -- I distrust those people who know so well what God wants them to do because I notice it always coincides with their own desires. - -Susan B. Anthony -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9yXUF/rncFku1MdIRAvhzAJ92qdrlSCZ3mFkFR5wymfzIXubG6gCbBozS WZ9ibUvKiifEm7yz8CSKHT0= =tv3g -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] generically accessing member variables problem
Ok. I think I got it. Now I have to look at my code again to see if I can implement it. Thanks for your time. jck Maxim Maletsky wrote: Well, if, say, one class has this function: function inherit($class_name, $pointer) { $this-objects[$class_name] = $pointer; } then you end up knowing that, whenever you need to access an instance for a class, you can use $this-objects['that_class']-that_array. What I picked on, was that you were assigning keys automatically with ($array[] = ...) and that makes it impossible pointing to the right element directly without having to loop the whole array, which is an overkill. The rest of your logic is pretty complex but doable. As long as you plan off well the complete OOD for that. So, my conclusion is: It is OK storing all objects in one single array, but name then the way you can find them later. If you have multiple instances of the same class, use numeric keys but assign them under a certain logic - not automatically, so you can find/use/destroy them at any point. can't give you more info here as that is all I know of it. Check out the CVs tree for ZoomStats - www.zoomstats.org, it is a 100% OOP PHP app and can give you some hints. -- Maxim Maletsky [EMAIL PROTECTED] John Kenyon [EMAIL PROTECTED] wrote... : I am not really sure I understand what you are saying here, and I would like to. Let me first say that I think the syntax you came up with earlier will solve my immediate problem, but if I could design this in a better way I'd like to know. Let me give you a few more details: I have a large class that contains multiple instances of various different classes, in turn, each of these instances could contain multiple instances of other classes. A big tree. In order to keep track of the various instances of the classes I use arrays, so each class that contains instances of other classes keeps like classes within an array. Sometimes a class has multiple arrays, each holding instances of a different type of class. Each of these classes is being used to generate html forms and I want to have a way to have the user check a checkbox and remove a particular instance of a class. I want to have one function that I can plop into each class (in some cases it may be possible to have children inherit the function from a parent class) and which will delete the correct instance of the correct class by passing in the name of the array the instance is held in and its index in that array. I hope this provides you with a little more context and if your advice still pertains, please explain it if you would. jck Maxim Maletsky wrote: You pass it the name of the element, and whatever the data inside. You do not need to add other sub-elements to it automatically, as you would need to be searching through the elements later for the right data. Whatever your need is - it's a good idea using arrays, and add other arrays into it. But, it is a bad idea cloning variables and auto-assign array's elements when you know that you will need that specific piece you store alone. -- Maxim Maletsky [EMAIL PROTECTED] John Kenyon [EMAIL PROTECTED] wrote... : See below: MM class Example { MM var $array = array(); MM function add2array($element_name, $val){ MM $this-$array[$element_name] = $val; MM } MM } MM $t = new Example(); $t-add2array('array1',25); $t-add2array('array2',26); $t-add2array('array3',Hello); MM echo 'pre'; MM print_r($t); MM echo '/pre'; MM Cleaner and more scalable, no? Yes and to fit the original 3 seperate arrays it would be function add2array($element_name, $val){ $this-$array[$element_name][] = $val; } No, because you pass it the name and data. This way every name will become element's name containing the relevant data. Your way just makes it an associative array without a way of directly accessing it. -- Maxim Maletsky [EMAIL PROTECTED] But my problem is that I have several arrays already and I want to be able to act on a specific array depending on the name I pass in. I don't see how your solution solves that issue. jck -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Getting Newest
I have three tables with certain content in each that's added almost daily. I want to get the most recent, out of those three tables, and then display it. How would I do that without changing the structure of my tables? (My current structure is this: id, date, name, text) Thanks, Stephen Craton http://www.melchior.us Life is a gift from God. Wasting it is like destroying your favorite item you received from the person you love most. -- www.melchior.us
Re: [PHP] Getting Newest
That depends on what DBMS you are using. Which one is it? Marco -- php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmer Come visit us at http://www.phparch.com! ---BeginMessage--- I have three tables with certain content in each that's added almost daily. I want to get the most recent, out of those three tables, and then display it. How would I do that without changing the structure of my tables? (My current structure is this: id, date, name, text) Thanks, Stephen Craton http://www.melchior.us Life is a gift from God. Wasting it is like destroying your favorite item you received from the person you love most. -- www.melchior.us ---End Message--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting Newest
Sorry, I'm using MySQL. - Original Message - From: Marco Tabini [EMAIL PROTECTED] To: Stephen [EMAIL PROTECTED] Cc: PHP List [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 4:00 PM Subject: Re: [PHP] Getting Newest That depends on what DBMS you are using. Which one is it? Marco -- php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmer Come visit us at http://www.phparch.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] fopen() with permissions?
Hello, Well, I'm able to make an empty file with fopen(ftp://username:password;domain.com/folder/file.prefs, w) However, I'm still nowhere because this file belongs to the user and her group, not to Apache, so I still can't write to it. Here's what I have to work with: -- I have the user's FTP username and password, which is necessary to install the software. -- The provider does not allow the backticks (``) operator, system(), exec(), passthru() or dl() for security reasons, and I assume this is the case with most people's service providers. I'm starting to think that PHP, although a great choice for anything but in-house software, may not be the right choice for a product aimed at non- technical people. Is there a PHPriest in the house? -- Charles Wiltgen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fopen() with permissions?
Charles, can you not create and write the file locally and then upload it directly via ftp? I'm not much of a PHPriest, but I love PHP because it's the first web scripting language that I have encountered that actually make sense, is coincise and very powerful. It's the old question--do we make computers dumber or users smarter? :-) -- php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmer Come visit us at http://www.phparch.com! ---BeginMessage--- Hello, Well, I'm able to make an empty file with fopen(ftp://username:password;domain.com/folder/file.prefs, w) However, I'm still nowhere because this file belongs to the user and her group, not to Apache, so I still can't write to it. Here's what I have to work with: -- I have the user's FTP username and password, which is necessary to install the software. -- The provider does not allow the backticks (``) operator, system(), exec(), passthru() or dl() for security reasons, and I assume this is the case with most people's service providers. I'm starting to think that PHP, although a great choice for anything but in-house software, may not be the right choice for a product aimed at non- technical people. Is there a PHPriest in the house? -- Charles Wiltgen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting Newest
I know that you can select data from multiple tables, but when I do that I get an error. The error is this: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /usr/local/plesk/apache/vhosts/melchior.us/httpdocs/live/all.php on line 17 - Original Message - From: Marco Tabini [EMAIL PROTECTED] To: Stephen [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 4:44 PM Subject: Re: [PHP] Getting Newest I think you would need to make three queries, since Mysql doesn't support subqueries... or am I wrong? Marco -- php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmer Come visit us at http://www.phparch.com! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting Newest
That's probably because you can't do it in a single SQL statement, but have to use three separate ones and build the logic to check which one is the most recent in PHP. Try outputting the query and posting it to the list, or try inserting a line like this: echo mysql_error(); after you execute your query--that will print out what the MySQL server thinks is wrong with your current query. Hope this helps! Cheers, Marco -- php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmer Come visit us at http://www.phparch.com! ---BeginMessage--- I know that you can select data from multiple tables, but when I do that I get an error. The error is this: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /usr/local/plesk/apache/vhosts/melchior.us/httpdocs/live/all.php on line 17 - Original Message - From: Marco Tabini [EMAIL PROTECTED] To: Stephen [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 4:44 PM Subject: Re: [PHP] Getting Newest I think you would need to make three queries, since Mysql doesn't support subqueries... or am I wrong? Marco -- php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmer Come visit us at http://www.phparch.com! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting Newest
Are all three tables the same? Same columns and everything? ---John Holmes... - Original Message - From: Stephen [EMAIL PROTECTED] To: PHP List [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 4:10 PM Subject: [PHP] Getting Newest I have three tables with certain content in each that's added almost daily. I want to get the most recent, out of those three tables, and then display it. How would I do that without changing the structure of my tables? (My current structure is this: id, date, name, text) Thanks, Stephen Craton http://www.melchior.us Life is a gift from God. Wasting it is like destroying your favorite item you received from the person you love most. -- www.melchior.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fopen() with permissions?
At 22:48 06.11.2002, Charles Wiltgen said: [snip] Well, I'm able to make an empty file with fopen(ftp://username:password;domain.com/folder/file.prefs, w) However, I'm still nowhere because this file belongs to the user and her group, not to Apache, so I still can't write to it. [snip] Why don't you do it this way: $fp = fopen(ftp://username:password;domain.com/folder/file.prefs, w); if ($fp) { // now write whatever you want to fwrite($fp, 'Some content', 12); fclose($fp); } else die('Can\'t create target file'); I don't see a reason why you shouldn't directly use the file handle returned by fopen - that's why the PHP god has created it :) See this sample code how to achieve this (substitute any necessary data). Note that when opening a file using the FTP protocol you cannot truncate/replace an existing file, you need to delete it first (this is dictated by the FTP protocol AFAIK). ?php // --- configure this $user = '**user**'; $pass = '**pass**'; $ftphost = 'ftp_upload_host'; $wwwhost = 'webhost_to_test'; $ftpfile = '/www/sample.html'; $wwwfile = '/sample.html'; // -- end configure $time = strftime('%D %T'); $link = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']; $x = EOF html head meta http-equiv=Pragma content=no-cache meta http-equiv=Cache content=none title**By PHP** $wwwhost$wwwfile **By PHP**/title /head body h1Created by PHP via FTP/h1 Creation time: $timep a href=$linkTest/a /body /html EOF; error_reporting(E_ALL); $fp = ftp_connect($ftphost); if ($fp) { $login = ftp_login ($fp, $user, $pass); ftp_delete ($fp, $ftpfile); ftp_quit($fp); } else die('Cannot connect to FTP'); $fp = fopen(ftp://$user:$pass;$ftphost$ftpfile, 'w'); if ($fp) { fwrite($fp, $x, strlen($x)); fclose($fp); header(Location: http://$wwwhost$wwwfile;); } else die('Cannot create file via FTP'); ? -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting Newest
Yes, same columns, everything the same except names and content. - Original Message - From: 1LT John W. Holmes [EMAIL PROTECTED] To: Stephen [EMAIL PROTECTED]; PHP List [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 5:31 PM Subject: Re: [PHP] Getting Newest Are all three tables the same? Same columns and everything? ---John Holmes... - Original Message - From: Stephen [EMAIL PROTECTED] To: PHP List [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 4:10 PM Subject: [PHP] Getting Newest I have three tables with certain content in each that's added almost daily. I want to get the most recent, out of those three tables, and then display it. How would I do that without changing the structure of my tables? (My current structure is this: id, date, name, text) Thanks, Stephen Craton http://www.melchior.us Life is a gift from God. Wasting it is like destroying your favorite item you received from the person you love most. -- www.melchior.us -- 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] fopen() with permissions?
Marco Tabini wrote... I'm not much of a PHPriest, but I love PHP because it's the first web scripting language that I have encountered that actually make sense, is coincise and very powerful. Yes, I'm a big fan. I was going to do this in .NET, which I'm more familiar with http://wiltgen.net/articles/dotnet/, but I've developed a crush on PHP. It's the old question--do we make computers dumber or users smarter? :-) What, no make computers smarter option? :O) Seriously, if this was for people who knew what a shell prompt was, I would've gone with putting the burden on the user. -- Charles Wiltgen Well, once again my friend, we find that science is a two-headed beast. One head is nice, it gives us aspirin and other modern conveniences... but the other head of science is bad! Oh beware the other head of science...it bites! -- The Tick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fopen() with permissions?
Ernest E Vogelsinger wrote... Why don't you do it this way: $fp = fopen(ftp://username:password;domain.com/folder/file.prefs, w); fwrite($fp, 'Some content', 12); fclose($fp); I don't see a reason why you shouldn't directly use the file handle returned by fopen - that's why the PHP god has created it :) A very good point, and this will work for me. I mentioned in my first note that I'm afraid that this is about 1,000 times slower than creating/writing a local file, but I don't see that I have an option. Thank you! -- Charles Wiltgen Well, once again my friend, we find that science is a two-headed beast. One head is nice, it gives us aspirin and other modern conveniences... but the other head of science is bad! Oh beware the other head of science...it bites! -- The Tick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Anyone used Phpmailer()
Hello Everyone I am unable to send mail using the SMTP mode in phpmailer. I keep getting Error: Could not authenticate I am determined to find out why this keeps on happening...the mail() function works fine though. Many Thanks, -Pushpinder Pushpinder Singh Garcha _ Web Developer T. Falcon Napier and Associates, Inc. Off : 704 987 6500 Cell : 704 236 2939 Fax : 704 987 5002 _ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fopen() with permissions?
Ernest E Vogelsinger wrote... $fp = ftp_connect($ftphost); if ($fp) { $login = ftp_login ($fp, $user, $pass); ftp_delete ($fp, $ftpfile); ftp_quit($fp); } else die('Cannot connect to FTP'); So, DreamHost doesn't appear to have compiled PHP with FTP support. Can anyone recommend a great FTP class? (I'm not exciting about doing this via sockets, but I will if I have to...) Thanks! -- Charles -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fopen() with permissions?
At 00:08 07.11.2002, Charles Wiltgen said: [snip] So, DreamHost doesn't appear to have compiled PHP with FTP support. Can anyone recommend a great FTP class? (I'm not exciting about doing this via sockets, but I will if I have to...) [snip] Would curl be an option? Do they have this? You could, however, always write a tempfile, then exec your ftp client for a transfer... -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fopen() with permissions?
Ernest E Vogelsinger wrote... So, DreamHost doesn't appear to have compiled PHP with FTP support. Can anyone recommend a great FTP class? (I'm not exciting about doing this via sockets, but I will if I have to...) Would curl be an option? Do they have this? You could, however, always write a tempfile, then exec your ftp client for a transfer... No curl, no exec. :^) I'm using sockets, and everything working except I can't CD to a directory with a period in it (which is, of course, what I need to do). Does I need to escapte this somehow for fputs()? -- Charles -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fopen() with permissions?
Charles Wiltgen wrote... I'm using sockets, and everything working except I can't CD to a directory with a period in it (which is, of course, what I need to do). Does I need to escapte this somehow for fputs()? Sorry, I'm an idiot...I went back to the FTP RFC and everything's working fine. -- Charles -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting Newest
you could make a union of all the records, and order by newest date first: (select id, date, name, text from table1) union (select id, date, name, text from table2) union (select id, date, name, text from table3) order by date desc then select the first record /nick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Trouble with php-4.2.3, apache-1.3.27, sablotron 0.96
Hi, Thursday, November 7, 2002, 5:35:10 AM, you wrote: EN -BEGIN PGP SIGNED MESSAGE- EN Hash: SHA1 EN Nope... same error. Patch worked perfectly, LDFLAGS=-lstdc++ did too. End EN result: same error. Any other ideas??? EN On Wednesday 06 November 2002 09:09 am, you wrote: Hi, Wednesday, November 6, 2002, 2:50:42 PM, you wrote: EN -BEGIN PGP SIGNED MESSAGE- EN Hash: SHA1 EN I'm trying to get XSLT working with PHP, and after slowly working my way EN through several other problems, I've found one that I can't figure out. EN Software: EN PHP 4.2.3 EN Apache 1.3.27 EN Sablotron 0.96 EN GCC 3.2 EN Linux 2.4.19-lsm1 EN ./configure \ EN - --enable-xml \ EN - --enable-xslt \ EN - --enable-ftp \ EN - --enable-sockets \ EN - --enable-pcntl \ EN - --with-apxs=/usr/local/apache/bin/apxs \ EN - --with-xslt-sablot \ EN make \ EN sudo make install EN Everything seems to work fine (except for a lot of EN cc1: warning: changing search order for system directory /usr/local/include EN cc1: warning: as it has already been specified as a non-system directory EN 's that appear when using gcc-3.2), but when I try to EN /usr/local/apache/bin/apachectl restart, I get this: EN Syntax error on line 205 of /usr/local/apache/conf/httpd.conf: EN Cannot load /usr/local/apache/libexec/libphp4.so into server: EN /usr/local/lib/libsablot.so.0: undefined symbol: __gxx_personality_v0 EN /usr/local/apache/bin/apachectl start: httpd could not be started EN Any ideas??? EN -BEGIN PGP SIGNATURE- EN Version: GnuPG v1.0.7 (GNU/Linux) EN iD8DBQE9yJ/J/rncFku1MdIRAkhnAKClykcWMUwiWbslAYklx3xm1qsjSQCdFAXh EN roJ+kMyayqdY1UXxL6S5xuQ= EN =1Zaw EN -END PGP SIGNATURE- You probably need this patch http://download-2.gingerall.cz/download/sablot/Sablot-0.96.1.patch You can also use LDFLAGS=-lstdc++ before configuring PHP more info at http://php.benscom.com/manual/en/ref.xslt.php EN - -- EN Jesus Christ: Imaginary Playmate to Millions of Adults! EN - -Unknown EN -BEGIN PGP SIGNATURE- EN Version: GnuPG v1.0.7 (GNU/Linux) EN iD8DBQE9yW8T/rncFku1MdIRAhMXAKCFp4MyUAp2/oLVIwcXS4L0utNOVgCglIPf EN 5qP6pDQ/mrNX+CT5pV7X6oc= EN =wdaO EN -END PGP SIGNATURE- Make sure you rm config.cache in the PHP source directory then do LDFLAGS=-lstdc++;./configure ...options then make install ect and in apache do ./configure again as well before making -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP wrapper around binary CGI app
I have a binary (non-modifiable) CGI program that does form processing. It gets form data by HTTP POST and outputs the results to Apache. Is there any way to make a PHP wrapper around the program, so that the form data will be submitted to my script, which in turn will send the data to the program and get back the results? In other words, how can I POST to the program without opening an HTTP connection and how do I read the program's output in my script? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Code help
I am fairly new to the PHP language and have built a website with it before, but nothing very complicated. Is there anyway of grabbing information from the browser as to where a user may have come from (referring page, search engine, etc.)? And if so, how would I go about getting it? William -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Code help
CAUTION: It's not reliable you can use $HTTP_REFERER (or, I think's it's under $_SERVER, $_SERVER[HTTP_REFERER]) -Original Message- From: William Holroyd [mailto:w.holroyd;versity-cobalt.com] Sent: Thursday, November 07, 2002 12:42 PM To: [EMAIL PROTECTED] Subject: [PHP] Code help I am fairly new to the PHP language and have built a website with it before, but nothing very complicated. Is there anyway of grabbing information from the browser as to where a user may have come from (referring page, search engine, etc.)? And if so, how would I go about getting it? William -- 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] Getting Newest
So for my SQL statement I put this? $sql = select id, date, name, text from table1 union; $sql2 = select id, date, name, text from table2 union; $sql3 = select id, date, name, text from table3 order by date desc; - Original Message - From: Nick Eby [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 7:57 PM Subject: Re: [PHP] Getting Newest you could make a union of all the records, and order by newest date first: (select id, date, name, text from table1) union (select id, date, name, text from table2) union (select id, date, name, text from table3) order by date desc then select the first record /nick -- 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] Getting Newest
$sql = select id, date, name, text from table1 union; $sql2 = select id, date, name, text from table2 union; $sql3 = select id, date, name, text from table3 order by date desc; No, it's all one query. $sql = select id, date, name, text from table1 union .select id, date, name, text from table2 union .select id, date, name, text from table3 order by date desc; ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Getting Newest
UNION is implemented in MySQL 4.0.0, btw. -Original Message- From: Stephen [mailto:webmaster;melchior.us] Sent: Wednesday, November 06, 2002 9:33 PM To: PHP List Subject: Re: [PHP] Getting Newest So for my SQL statement I put this? $sql = select id, date, name, text from table1 union; $sql2 = select id, date, name, text from table2 union; $sql3 = select id, date, name, text from table3 order by date desc; - Original Message - From: Nick Eby [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 7:57 PM Subject: Re: [PHP] Getting Newest you could make a union of all the records, and order by newest date first: (select id, date, name, text from table1) union (select id, date, name, text from table2) union (select id, date, name, text from table3) order by date desc then select the first record /nick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting Newest
Oh, well, now I'm getting this error: You have an error in your SQL syntax near 'union select * from church union select * from misc order by date desc limit 1' at line 1 Here's what I did for the SQL $sql = select * from school union ; $sql .= select * from church union ; $sql .= select * from misc order by date desc limit 1; - Original Message - From: John W. Holmes [EMAIL PROTECTED] To: 'Stephen' [EMAIL PROTECTED]; 'PHP List' [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 9:43 PM Subject: RE: [PHP] Getting Newest UNION is implemented in MySQL 4.0.0, btw. -Original Message- From: Stephen [mailto:webmaster;melchior.us] Sent: Wednesday, November 06, 2002 9:33 PM To: PHP List Subject: Re: [PHP] Getting Newest So for my SQL statement I put this? $sql = select id, date, name, text from table1 union; $sql2 = select id, date, name, text from table2 union; $sql3 = select id, date, name, text from table3 order by date desc; - Original Message - From: Nick Eby [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 7:57 PM Subject: Re: [PHP] Getting Newest you could make a union of all the records, and order by newest date first: (select id, date, name, text from table1) union (select id, date, name, text from table2) union (select id, date, name, text from table3) order by date desc then select the first record /nick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Getting Newest
Read my last post and then run SELECT VERSION() in MySQL. I really doubt you're running 4.0. ---John Holmes... -Original Message- From: Stephen [mailto:webmaster;melchior.us] Sent: Wednesday, November 06, 2002 9:57 PM To: PHP List Subject: Re: [PHP] Getting Newest Oh, well, now I'm getting this error: You have an error in your SQL syntax near 'union select * from church union select * from misc order by date desc limit 1' at line 1 Here's what I did for the SQL $sql = select * from school union ; $sql .= select * from church union ; $sql .= select * from misc order by date desc limit 1; - Original Message - From: John W. Holmes [EMAIL PROTECTED] To: 'Stephen' [EMAIL PROTECTED]; 'PHP List' [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 9:43 PM Subject: RE: [PHP] Getting Newest UNION is implemented in MySQL 4.0.0, btw. -Original Message- From: Stephen [mailto:webmaster;melchior.us] Sent: Wednesday, November 06, 2002 9:33 PM To: PHP List Subject: Re: [PHP] Getting Newest So for my SQL statement I put this? $sql = select id, date, name, text from table1 union; $sql2 = select id, date, name, text from table2 union; $sql3 = select id, date, name, text from table3 order by date desc; - Original Message - From: Nick Eby [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 7:57 PM Subject: Re: [PHP] Getting Newest you could make a union of all the records, and order by newest date first: (select id, date, name, text from table1) union (select id, date, name, text from table2) union (select id, date, name, text from table3) order by date desc then select the first record /nick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] Trouble with php-4.2.3, apache-1.3.27, sablotron 0.96
Same error. On Wednesday 06 November 2002 05:40 pm, you wrote: Hi, Thursday, November 7, 2002, 5:35:10 AM, you wrote: EN -BEGIN PGP SIGNED MESSAGE- EN Hash: SHA1 EN Nope... same error. Patch worked perfectly, LDFLAGS=-lstdc++ did too. End EN result: same error. Any other ideas??? EN On Wednesday 06 November 2002 09:09 am, you wrote: Hi, Wednesday, November 6, 2002, 2:50:42 PM, you wrote: EN -BEGIN PGP SIGNED MESSAGE- EN Hash: SHA1 EN I'm trying to get XSLT working with PHP, and after slowly working my way EN through several other problems, I've found one that I can't figure out. EN Software: EN PHP 4.2.3 EN Apache 1.3.27 EN Sablotron 0.96 EN GCC 3.2 EN Linux 2.4.19-lsm1 EN ./configure \ EN - --enable-xml \ EN - --enable-xslt \ EN - --enable-ftp \ EN - --enable-sockets \ EN - --enable-pcntl \ EN - --with-apxs=/usr/local/apache/bin/apxs \ EN - --with-xslt-sablot \ EN make \ EN sudo make install EN Everything seems to work fine (except for a lot of EN cc1: warning: changing search order for system directory /usr/local/include EN cc1: warning: as it has already been specified as a non-system directory EN 's that appear when using gcc-3.2), but when I try to EN /usr/local/apache/bin/apachectl restart, I get this: EN Syntax error on line 205 of /usr/local/apache/conf/httpd.conf: EN Cannot load /usr/local/apache/libexec/libphp4.so into server: EN /usr/local/lib/libsablot.so.0: undefined symbol: __gxx_personality_v0 EN /usr/local/apache/bin/apachectl start: httpd could not be started EN Any ideas??? EN -BEGIN PGP SIGNATURE- EN Version: GnuPG v1.0.7 (GNU/Linux) EN iD8DBQE9yJ/J/rncFku1MdIRAkhnAKClykcWMUwiWbslAYklx3xm1qsjSQCdFAXh EN roJ+kMyayqdY1UXxL6S5xuQ= EN =1Zaw EN -END PGP SIGNATURE- You probably need this patch http://download-2.gingerall.cz/download/sablot/Sablot-0.96.1.patch You can also use LDFLAGS=-lstdc++ before configuring PHP more info at http://php.benscom.com/manual/en/ref.xslt.php EN - -- EN Jesus Christ: Imaginary Playmate to Millions of Adults! EN - -Unknown EN -BEGIN PGP SIGNATURE- EN Version: GnuPG v1.0.7 (GNU/Linux) EN iD8DBQE9yW8T/rncFku1MdIRAhMXAKCFp4MyUAp2/oLVIwcXS4L0utNOVgCglIPf EN 5qP6pDQ/mrNX+CT5pV7X6oc= EN =wdaO EN -END PGP SIGNATURE- Make sure you rm config.cache in the PHP source directory then do LDFLAGS=-lstdc++;./configure ...options then make install ect and in apache do ./configure again as well before making -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Running functions as other than nobody
Marco Tabini wrote... I need to chmod files which are owned by a nother user than nobody with a php script runing from a browser. lets say i have a file called image.gif and I want to chmod(imgage.gif, 0777); and I want to run it as user: myuser with passwd: passwd. Can I do this? There was actually a brief thread about this last night. If you're using Apache, you could look into suexec--this may or may not be a possibility depending on the degree of control that you have on your server. The short answer is no. My provider uses suexec, but that just means that Apache and its processes run as (in my case) dhapache instead of nobody, putting you in the same boat with the same paddle. I'm not sure why PHP doesn't let you fopen() with a user name and password. It seems obvious, so I assume there are technical issues that prevent this from happening. My solution (for now) was to use FTP, since I will have the user's FTP username/password. Worse, I can't depend on the FTP commands (my provider's PHP doesn't have them), so I'm using fsockopen() to speak FTP to do things like delete files I've created with fopen(). This is far slower and more error-prone, and I'm very, VERY interested in other portable solutions. Please post whatever you find about this to the list, and I'll do the same. -- Charles Wiltgen Well, once again my friend, we find that science is a two-headed beast. One head is nice, it gives us aspirin and other modern conveniences... but the other head of science is bad! Oh beware the other head of science...it bites! -- The Tick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] File locking problem
Hello, I'm having file locking problems. I'm using fopen() to write a file via FTP. At the end, I'm doing... fflush($fp); fclose($fp); ...and then I include it immediately after. But many times I only get part of what I wrote to the file, which suggests that it wasn't really flushed and closed properly. What else can I do? Thanks, -- Charles Wiltgen Well, once again my friend, we find that science is a two-headed beast. One head is nice, it gives us aspirin and other modern conveniences... but the other head of science is bad! Oh beware the other head of science...it bites! -- The Tick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Foreach ...... Help
Parse error: parse error, unexpected '=' in /home/intra/Inventroot/software/savedata.php on line 35 ?php $vary(100); $i = 0; foreach($InputY as $y){ $vary($i) = $y; -line 35 $i++; } foreach($Nama_Software as $x){ $insertq = Insert into NSoftware (X, Y) values ('$InputX','$vary($i)'); echo $insertq.br; mysql_query($insertq); $i++; } ? Thank's Jon Haworth writes: Hi Remon, I try this script with php, but i found an Error. It would be helpful if you could show us this error message. $vary(100); At the very least, you should change this line to $vary = array(); Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Foreach ...... Help
Your code is bogus. You probably want: $vary[$i] = $y; And $vary(100) also makes no sense. Also, why are you looping through the $InputY array and putting all the values into $vary? Why not just do $vary = $InputY; ? If it is because you need to renumber the indices, have a look at the array_values() function. -Rasmus On Thu, 7 Nov 2002, Remon Redika wrote: Parse error: parse error, unexpected '=' in /home/intra/Inventroot/software/savedata.php on line 35 ?php $vary(100); $i = 0; foreach($InputY as $y){ $vary($i) = $y; -line 35 $i++; } foreach($Nama_Software as $x){ $insertq = Insert into NSoftware (X, Y) values ('$InputX','$vary($i)'); echo $insertq.br; mysql_query($insertq); $i++; } ? Thank's Jon Haworth writes: Hi Remon, I try this script with php, but i found an Error. It would be helpful if you could show us this error message. $vary(100); At the very least, you should change this line to $vary = array(); Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File locking problem
Just a (possibly stupid) suggestion--is it possible that the file is being overwritten by another instance of your script that's run in the meantime? - php|architect -- The Magazine for PHP Professionals Check us out on the web at http://www.phparch.com On Wed, 2002-11-06 at 23:06, Charles Wiltgen wrote: Hello, I'm having file locking problems. I'm using fopen() to write a file via FTP. At the end, I'm doing... fflush($fp); fclose($fp); ...and then I include it immediately after. But many times I only get part of what I wrote to the file, which suggests that it wasn't really flushed and closed properly. What else can I do? Thanks, -- Charles Wiltgen Well, once again my friend, we find that science is a two-headed beast. One head is nice, it gives us aspirin and other modern conveniences... but the other head of science is bad! Oh beware the other head of science...it bites! -- The Tick -- 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] Help Needed for Project
Is There anyone that I can chat with in reatlime About the project I need help with for my fantasy football League. Karl
Re: [PHP] File locking problem
Marco Tabini wrote... Just a (possibly stupid) suggestion--is it possible that the file is being overwritten by another instance of your script that's run in the meantime? This may also be a problem at some point, but currently I'm just trying to get it working in an test environment where only one instance is running. I know I can just use another empty file as a semaphore, but my performance is already killed by having to use FTP to create and delete files with PHP, and I need to do whatever I can do avoid it. Basically, it appears that using fflush() and fclose() is no guarantee that a file is completely written, and I'm wondering what I can do besides insert sleep() statements. -- Charles Wiltgen Love is a snowmobile racing across the tundra and then suddenly it flips over, pinning you underneath. At night, the ice weasels come. - Nietzsche (Groening) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Foreach ...... Help
Sorry before. I Just to try to Explain my Problem may be this my reason .. I have Two Text Fields The First Text Field i call it InputX input type='text' name='InputX' size='50' and The Second Text Field I Call it InputY, Generatable Field (using javascripts), if User Click the Button (AddRow's Button) for Generated / produce the InputY, may be like the sample.. Blabla.innerHTML = input type='text' name='InputY' size='50' ; I need to insert data from Fields to the server, the Code will Post the value of Fields (InputX and InputY(s)) by once submit to the server, and amount of value of data saved depent on how many InputY I have, or how many times User click my AddRow Button and fill Text Fields. This The sample result data will send to server in once post data, if user click 5 Times AddRow's Button. and fill it's with these value INPUTXVALUE INPUTYVALUE INDEXSUB1 INDEXSUB2 INDEXSUB3 INDEXSUB4 INDEXSUBX i have done before with my asp code. and it's Worked. % i = 0 Inputx = request(Inputx) dim vary(100) for each y in request(InputY) vary(i) = y i = i + 1 next for each x in request(inputY) insertq = Insert into Nsoftware(X, Y) values (' Inputx ',' vary(i) ') set save = conn.execute(insertq) i = i + 1 next % I just to translate from asp code to php code I try this code with php, but i still found an Error. ?php //$vary(100); $i = 0; foreach($InputY as $y){ $vary[$i] = $y; $i++; } foreach($InputX as $x){ $insertq = Insert into NSoftware (X, Y) values ('$InputX','$vary[$i]'); echo $insertq.br; mysql_query($insertq); $i++; } ? --- 55 Parse error: parse error, unexpected $ in /home/intra/Inventroot/software/savedata.php on line 55 i got error out of range of my code.., or may be these not a good idea to translate my asp code to php?? sorry about my english Rasmus Lerdorf writes: Your code is bogus. You probably want: $vary[$i] = $y; And $vary(100) also makes no sense. Also, why are you looping through the $InputY array and putting all the values into $vary? Why not just do $vary = $InputY; ? If it is because you need to renumber the indices, have a look at the array_values() function. -Rasmus On Thu, 7 Nov 2002, Remon Redika wrote: Parse error: parse error, unexpected '=' in /home/intra/Inventroot/software/savedata.php on line 35 ?php $vary(100); $i = 0; foreach($InputY as $y){ $vary($i) = $y; -line 35 $i++; } foreach($Nama_Software as $x){ $insertq = Insert into NSoftware (X, Y) values ('$InputX','$vary($i)'); echo $insertq.br; mysql_query($insertq); $i++; } ? Thank's Jon Haworth writes: Hi Remon, I try this script with php, but i found an Error. It would be helpful if you could show us this error message. $vary(100); At the very least, you should change this line to $vary = array(); Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[4]: [PHP] Trouble with php-4.2.3, apache-1.3.27, sablotron 0.96
Hi, Thursday, November 7, 2002, 1:11:43 PM, you wrote: EN Same error. As a test try compiling statically into apache...That is the way I have php at the moment. -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session vs. header
huge junk mail wrote: Can someone tell me why I can't have $_SESSION['foo'] = 'content of foo'; following by header('Location: http://www.mysite.com'); Someone from www.php.net told me that it can confuse browser (http://bugs.php.net/19991). But, still I can't the idea why it can happen. Does register session means sending a 'header: location' too? You can, and you should not get any errors from PHP. The reason someone suggested that this can confuse the browser is as follows: 1. When you initiate a session, PHP tells Apache to send a Set-Cookie header (assuming you are using the default session settings). 2. When you manually set a Location header, the HTTP response status code changes from 200 OK to 302 Moved Temporarily. So, at least in the past, some Web browsers would ignore Set-Cookie headers that are sent in a response that basically says, Hey, that thing you are looking for is over here now. Also, in some scripting languages (I believe in PHP as well, but I am not positive), the Set-Cookie headers would not even be included when you changed the status code like this, so it didn't matter what the browser thought. I have found that this problem appears to be fading fast, and I have recently used this combination without any user complaints (yet). :-) What problem are you experiencing? Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Delete a file via FTP (without PHP FTP support)
// Delete a file via FTP function deleteFileViaFTP($ftpServer, $user, $password, $ftpDir, $ftpFile) { $error = FALSE; // Open connection to FTP port $ftp = fsockopen($ftpServer,21); $foo = fgets($ftp); if (!ereg(^220*, $foo)) { $error = *** Error! FTP service not ready ***\r\n; } // Submit user name and password fputs($ftp,USER $user\r\n); $foo = fgets($ftp); if (!ereg(^331*, $foo)) { $error = *** Error! USER commend unsuccessful ***\r\n; } fputs($ftp,PASS $password\r\n); $foo = fgets($ftp); if (!ereg(^230*, $foo)) { $error = *** Error! PASS command unsuccessful ***\r\n; } // Change to the proper directory fputs($ftp,CWD $ftpDir\r\n); $foo = fgets($ftp); if (!ereg(^250*, $foo)) { $error = *** Error! CWD command unsuccessful ***\r\n; } // Delete the file fputs($ftp,DELE $ftpFile\r\n); $foo = fgets($ftp); if (!ereg(^250*, $foo)) { $error = *** Error! DELEte command unsuccessful\r\n; } // Wrap it up fputs($ftp,QUIT\r\n); $foo = fgets($ftp); if (!ereg(^221*, $foo)) { $error = *** Error! FTP service closed abnormally *** \r\n; } fclose($ftp); // Return TRUE if the file has been deleted $fileUri = ftp://$user:$password;$ftpServer/$ftpDir/$ftpFile; $fp = fopen($fileUri, r); if (!$fp) { return TRUE; } else { return FALSE; } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Regular Expression
Hi, I have this ereg call ereg(([-d])[rwxst-]{9}.* [0-9]* [a-zA-Z]+ [0-9: ]* (.+),$dirline,$regs); This regular expressions parses the following line: drwxrwxrwx 1 ownergroup 0 Nov 5 23:19 fantasy to return: fantasy (or in general any filename/directory name) The above regular expression works fine in every except when the filename is something like this: drwxrwxrwx 1 ownergroup 0 Nov 5 23:19 6 fantasy Notice in this case the filename is 6 fantasy however $regs[1] returns only: fantasy Can anyone help me to fix this problem. Thanks a bunch -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Convince teh boss
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Okay, it took me a long (expletive deleted) time, so I figured I should share. Here is a list of popular web sites running Apache, PHP, MySQL, and Linux. If there are any errors, I apologize. This is not meant to be a definitive work. In fact, I wasn't even planning on posting it... until i looked at the clock ;) This list is designed to convice teh boss (no type-o). If your boss is a bandwagon kind of guy, afraid to take risks, this is for you- er- him. And you. Him in that he can read it, you in that if he accepts LAMP, you're life will be a much more joyous existance ;) - Apache: By far the most popular web server, with 60.54% market share. Its closest competitor, Microsoft's IIS, has 28.89%. If all variants of each server are counted, Apache's install base increases to 62.17%, while IIS manages 29.42%). Statistics are from http://www.netcraft.net/survey Apache users: Yahoo! Amazon.com AltaVista BBC mp3.com SlashDot HP W3C IBM Verizon FEMA Infoseek PHP: In April 2002, PHP overtook ASP as the #1 server-side scripting language on the internet. In April, PHP was used by 24% of the sites on the Internet. Over the past two years PHP has averaged a 6.5% monthly growth rate. Source: zend.com/news/zendpr.php?id=49 PHP users: Cisco CMG Vodafone Motorola Siemens Ericsson CBS Unilever Philips BMC NTT Air Canada Lufthansa OnVista Lycos Europe Deutsche Bank NASA W3C MySQL: It isn't as easy to determine which database a site uses, but here is a list of sites that do use MySQL, according to MySQL.com: Yahoo! Finance Texas Instruments U.S. Census Bureau NASA Omaha Steaks Slashdot Cross Media Marketing Corp Powell's Books Department of Academic Information Systems Avacom Net Services Blue World Communications CoreSense Ericsson handy.de mobile.de Nemo-Q Silicon Storage Technology, Inc. Virage Linux: I can't find a list for this... I figured these out by trying big sites that came to mind. I didn't encounter a single Microsoft site, but I did get a few *BSD sites, and several Solaris sites. FBI Google Amazon AltaVista Slashdot Verizon FEMA CNN Security: Here's a list of security companies/groups that run any LAMP component: Security Focus (LA) Symantec(L) CERT(LA) Packet Storm(A) FBI (L) OSVDB (LA) At Stake(LA) Netcraft(LA) TESO(L) Phenoelit (LA) Doxpara (LAP) NGS Software(LAMP) PivX(LAP) Grey Magic (LAMP) Phrack (AP) *** It should be noted that just because a component doesn't appear in the list doesn't mean it's not running. The only way I could figure out MySQL was sending a SYN to TCP/3306. If I got a SYN|ACK, I put an M. MySQL could be (should be) firewalled off, and infosec people know this. Also, infosec people tend to play with banners (hehe look TESO's - teso.scene.at), so it's entirely possible they're hiding something... Out of all the infosec sites I tried, I managed to find two Microsofts: NAI and Verisign. I didn't bother with ntbugtraq, windowssecurity, etc- then again, I didn't bother with linuxsecurity, root prompt, etc. Only went with groups who pay attention to all OS's... Phrack and OSVDB are a little biased, but they are still cross-platform. -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9ygtO/rncFku1MdIRAmQpAJ9d+KkYSLhMriuZtI9jsjp3CAmZrACfaWJK Tf0R0hEMSICjAi6v9nz67GU= =Jj3Q -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Convince teh boss
Thats a very nice research. Thanks you. -- M.CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com Hébergement de sites internets. Evan Nemerson [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Okay, it took me a long (expletive deleted) time, so I figured I should share. Here is a list of popular web sites running Apache, PHP, MySQL, and Linux. If there are any errors, I apologize. This is not meant to be a definitive work. In fact, I wasn't even planning on posting it... until i looked at the clock ;) This list is designed to convice teh boss (no type-o). If your boss is a bandwagon kind of guy, afraid to take risks, this is for you- er- him. And you. Him in that he can read it, you in that if he accepts LAMP, you're life will be a much more joyous existance ;) - Apache: By far the most popular web server, with 60.54% market share. Its closest competitor, Microsoft's IIS, has 28.89%. If all variants of each server are counted, Apache's install base increases to 62.17%, while IIS manages 29.42%). Statistics are from http://www.netcraft.net/survey Apache users: Yahoo! Amazon.com AltaVista BBC mp3.com SlashDot HP W3C IBM Verizon FEMA Infoseek PHP: In April 2002, PHP overtook ASP as the #1 server-side scripting language on the internet. In April, PHP was used by 24% of the sites on the Internet. Over the past two years PHP has averaged a 6.5% monthly growth rate. Source: zend.com/news/zendpr.php?id=49 PHP users: Cisco CMG Vodafone Motorola Siemens Ericsson CBS Unilever Philips BMC NTT Air Canada Lufthansa OnVista Lycos Europe Deutsche Bank NASA W3C MySQL: It isn't as easy to determine which database a site uses, but here is a list of sites that do use MySQL, according to MySQL.com: Yahoo! Finance Texas Instruments U.S. Census Bureau NASA Omaha Steaks Slashdot Cross Media Marketing Corp Powell's Books Department of Academic Information Systems Avacom Net Services Blue World Communications CoreSense Ericsson handy.de mobile.de Nemo-Q Silicon Storage Technology, Inc. Virage Linux: I can't find a list for this... I figured these out by trying big sites that came to mind. I didn't encounter a single Microsoft site, but I did get a few *BSD sites, and several Solaris sites. FBI Google Amazon AltaVista Slashdot Verizon FEMA CNN Security: Here's a list of security companies/groups that run any LAMP component: Security Focus (LA) Symantec (L) CERT (LA) Packet Storm (A) FBI (L) OSVDB (LA) At Stake (LA) Netcraft (LA) TESO (L) Phenoelit (LA) Doxpara (LAP) NGS Software (LAMP) PivX (LAP) Grey Magic (LAMP) Phrack (AP) *** It should be noted that just because a component doesn't appear in the list doesn't mean it's not running. The only way I could figure out MySQL was sending a SYN to TCP/3306. If I got a SYN|ACK, I put an M. MySQL could be (should be) firewalled off, and infosec people know this. Also, infosec people tend to play with banners (hehe look @ TESO's - teso.scene.at), so it's entirely possible they're hiding something... Out of all the infosec sites I tried, I managed to find two Microsofts: NAI and Verisign. I didn't bother with ntbugtraq, windowssecurity, etc- then again, I didn't bother with linuxsecurity, root prompt, etc. Only went with groups who pay attention to all OS's... Phrack and OSVDB are a little biased, but they are still cross-platform. -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9ygtO/rncFku1MdIRAmQpAJ9d+KkYSLhMriuZtI9jsjp3CAmZrACfaWJK Tf0R0hEMSICjAi6v9nz67GU= =Jj3Q -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help me learn! with an explanation of these two functions.
My second query still doesn't return anything? Even with $orderid = $row removed as Jason suggested. This is my current function. function get_order_numbers() { $conn = db_connect(); $query = select orders.orderid from orders, email where orders.orderid = email.orderid and email.checked='no'; $result = mysql_query($query) or die(Error: cannot select orderidBR$queryBR.mysql_error()); while( $row = mysql_fetch_array($result)) { extract($row); //$orderid = $row; print_r($row); $query2 = SELECT * FROM orders WHERE orderid=\$orderid\; $result2 = mysql_query($query2) or die(Error: cannot fetch orderBR$query2BR.mysql_error()); extract(mysql_fetch_array($result2)); } } What I want the function to do is say OK where the orderid's match pull out all the address details for each orderid and display what I want displayed accordingly. At the moment I get this array returned by using print_r($row). Array ( [0] = 100040 [orderid] = 100040 ) Array ( [0] = 100041 [orderid] = 100041 ) Array ( [0] = 100043 [orderid] = 100043 ) Array ( [0] = 100044 [orderid] = 100044 ) Array ( [0] = 100046 [orderid] = 100046 ) Array ( [0] = 100050 [orderid] = 100050 ) Array ( [0] = 100051 [orderid] = 100051 ) Array ( [0] = 100052 [orderid] = 100052 ) Where do I go from here? Well, like I said in my previous post if you remove the line: $orderid = $row; then your second query *should* work. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Convince teh boss
hi, thanx for that list it's really convincing for these Microsofts :) just something i wanted to ask about, is it a good thing or better for security to hide the script name from the address bar, through that list i found all the PHP pages hidden with HTML names, i don't know the technique exactly, but is it useful? Note: I have found simens website using JSP ;) don't worry i won't tell any one :) khalid _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php