Re: [PHP] Re: httpd.conf - php entry?
Ryan Vennell wrote: h ok i did a searh in it and found no reference to php. is there anywhere else i would find a place in apache settings that would be telling it where to find php? Thanks If you are using RH 8 its not in httpd.conf but /etc/httpd/conf.d/php.conf. HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ^M
Liam Gibbs wrote: So which is it that will keep my files from having ^M after PHP is finished fopen(), fputs(), and fclose() with them? \n, \r, and \n\r all seem to reinsert ^M at the ends of all my lines. It looks like you are viewing a dos/windows file on unix. The ^M is carriage return, which is needed as part of a dos/window end of line sequence (carriage return, line feed) whereas unix uses just line feed. On unix (well, a full install of linux) there are the conversion programs dos2unix and unix2dos. If transferring by ftp, use ASCII not BINARY transfer. I'm not sure how to help more, as it is not clear what you are trying to do. HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] need help widh comparing dates
I need to compare dates which opens commenting system. For example: If show starts 2003.05.01 20:00 then I need that only from that date and time the commenting system apears on my site ant would be there all the time from the start of the show. But in my code the commenting system opens only for one hour, take a look: - $year_now = date("Y",$timelt); $month_now = date("m",$timelt); $day_now = date("d",$timelt); $hour_now = date("H",$timelt); $minute_now = date("i",$timelt); $year_show = $row['year']; $month_show = $row['month']; $day_show = $row['day']; $hour_show = $row['hour']; $minute_show = $row['minute']; if ($year_now >= $year_show && $month_now >= $month_show && $day_now && $day_show $hour_now = $hour_show && $minute_now >= $minute_show) { COMMENTING SYSTEM OPENED { else { COMMENTING SYSTEM CLOSED } - What SOLUTION would solve the problem? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] chill out
Well, you could do what the sunmanagers mailing list does...every so often (every month? every other month?) a 95KB FAQ is sent to all subscribers. However, the main problem is getting people to READ it. And those people likely to read it are probably the same people who'd do the requisite documentation/web search first anyway. I suppose you could set it up so that only new subscribers got the FAQ. Or if you want to be really ambitious/annoying, new subscribers would get the FAQ, then - to activate them on the mailing list - they'd have to take a short web-based quiz on the contents of the FAQ before they are allowed to post. However, as others have said, the signal-to-noise ratio of this list is pretty high, easiest thing is just to tolerate/ignore the inappropriate questions... -steve At 2:21 PM +0500 4/4/03, Haseeb Iqbal wrote: hi all, just like to add something here, (which i recmended before) there should be a automated way to email all the new users about what php is, that explain them that php is server side and it can't do client side, just a plain email will do this will certinaly minimize the no of off topic posts,what you people think? i think it will help Friendship is always a sweet responsibility, never an opportunity. HaSeEb IqBaL. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- ++ | Steve Edberg [EMAIL PROTECTED] | | University of California, Davis (530)754-9127 | | Programming/Database/SysAdmin http://pgfsun.ucdavis.edu/ | ++ | [EMAIL PROTECTED]: 1001 Work units on 23 oct 2002 | | 3.152 years CPU time, 3.142 years SETI user... and STILL no aliens... | ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File Download?
On Friday 04 April 2003 15:29, b b wrote: > It would be: > href="downloadFile.php?daFile=path/fileName">path/fileName > > I tried to print the _GET['daFile'] however if I am > using the header function in the same file then it > won't print a thing. Well, disable the file downloading section for the moment. > In fact it starts downloading. > The only thing is that it doesn't catch the correct > file name (though it downloads the actual daFile). I don't quite understand this bit -- could you clarify? One thing that you should do when passing values through the URL is to urlencode() them. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] need help widh comparing dates
Sorry for mistakes. It should be: ... if ($year_now >= $year_show && $month_now >= $month_show && $day_now >= $day_show && $hour_now == $hour_show && $minute_now >= $minute_show) { COMMENTING SYSTEM OPENED { else { COMMENTING SYSTEM CLOSED } ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] REPLY NEEDED
Hi, Message of Friday, 4th April 2003, 12:28:44: PK> STRICTLY CONFIDENTIAL PK> WE ARE MEMBERS OF A SPECIAL COMMITTEE FOR BUDGET AND PLANNING OF PK> THE NIGERIAN NATIONAL PETROLEUM CORPORATION (NNPC). THIS COMMITTEE PK> IS PRINCIPALLY CONCERNED WITH CONTRACT AWARDS AND APPROVAL. PK> WITH OUR POSITIONS, WE HAVE SUCCESSFULLY SECURED FOR OURSELVES THE PK> SUM OF THIRTY ONE MILLION, FIVE HUNDRED THOUSAND UNITED STATES PK> DOLLARS (US$31.5M). THIS AMOUNT WAS CAREFULLY MANIPULATED BY PK> OVER-INVOICING OF AN OLD CONTRACT. PK> BASED ON INFORMATION GATHERED ABOUT YOU, WE BELIEVE YOU WOULD BE PK> IN A POSITION TO HELP US IN TRANSFERING THIS FUND (US$31.5M) INTO PK> A SAFE ACCOUNT. IT HAS BEEN AGREED THAT THE OWNER OF THE ACCOUNT PK> WILL BE COMPENSATED WITH 30% OF THE REMITTED FUNDS, WHILE WE KEEP PK> 60% AS THE INITIATORS AND 10% WILL BE SET ASIDE TO OFFSET EXPENSES PK> AND PAY THE NECESSARY TAXES. PK> ALL MODALITIES OF THIS TRANSACTION HAVE BEEN CAREFULLY WORKED OUT PK> AND ONCE STARTED WILL NOT TAKE MORE THAN SEVEN (7) WORKING DAYS, PK> WITH YOUR FULL SUPPORT. THIS TRANSACTION IS 100% RISK FREE.BE PK> REST ASSURED OF SUCCESS. PK> IF THIS PROPOSAL SATISFIES YOU, PLEASE REACH US ONLY BY EMAIL FOR PK> MORE INFORMATION. PLEASE, TREAT AS URGENT AND VERY IMPORTANT. PK> YOURS FAITHFULLY, PK> DR.PATRICK KOFI. Apart from this being as Off-topic as I have ever seen, I think we should help him: So that he doesn't have to spend his valuable funds and time for coping with spam, we should all get his address out of the lists of those spammers... (you know, "klick here if you don't want to receive this newsletter anymore"). That way, he can perhaps get a grip on his situation himself. Timo -- This mail was printed on 100% recycled spam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Why PHP reads local php.ini?
I mean than when you run PHP in CGI mode, PHP doesn´t read default php.ini location. It first to look php in your actual path. An example... ecazfe04:/home3/www# php -v PHP 4.3.1 (cgi), Copyright (c) 1997-2002 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies ecazfe04:/home3/www# export REQUEST_METHOD="POST" // Now we are in CGI mode as if it was called from Apache. ecazfe04:/home3/www# export REDIRECT_STATUS="200" // To avoid force-cgi-redirect ecazfe04:/home3/www# php -v Content-type: text/html X-Powered-By: PHP/4.3.1 No input file specified. // Ok, we are in CGI mode and it looks for a file. /home3/www# cd /home3/www# php index.php Everithings gos OK, except that if exists php.ini in PHP uses it. That overrides default compilation option. You can see it if you use phpinfo() in 'index.php'. I think this shouldn´t be the correct way of reading php.ini, but maybe I´m wrong. Can anybody help me? I run a webserver (Apache+PHP) that hosts some virtualhosts and I don´t won´t that my customers could use an alternate php.ini. PS: Sorry, I´m Spanish and I don´t know if my explanation is clear enough. José Luis Pérez Ruiz Arrakis Servicios y Comunicaciones S.L.U. Edificio Expo, C/ Inca Garcilaso s/n Isla de la Cartuja 41092 Sevilla Telefono: 955 550 509 ** Noticia legal Este mensaje electrónico contiene información de BT Ignite España S.A.U. que es privada y confidencial, siendo para el uso exclusivo de la persona (s) o entidades arriba mencionadas. Si usted no es el destinatario señalado, le informamos que cualquier divulgación, copia, distribución o uso de los contenidos está prohibida. Si usted ha recibido este mensaje por error, por favor borre su contenido lo antes posible. Gracias. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mimetpye of remote file
hi guys apart for getimagesize for images is there a way to get mimetypes for other files ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] automatic link execution after form submit
Hallo, > -Original Message- > From: Fritz [mailto:[EMAIL PROTECTED] > Sent: Saturday, March 29, 2003 8:26 PM > Subject: [PHP] automatic link execution after form submit > I am stuck on "executing" automaticaly > a URL-string to be sent to a perl-script. 1) Redirect, using HTTP functionality: header('Location: '.$strURL, true); // Redirect browser exit(); // Make sure that code below does not get executed when we redirect. This is used if user should get the response of the redirected page/script. 2) Use CURL, see PHP documentation of CURL. This can be used if user shouldn't get the response of the redirected page/script. Regards, Jens BTW: Sun is shining bright, otherwise I would say: RTFM ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] window size...
Hi, Is there anyway to define a fixed window size using PHP as we do with JavaScript? Regards, DT -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: httpd.conf - php entry?
Ryan Vennell <[EMAIL PROTECTED]> escribió en el mensaje de noticias > h ok i did a searh in it and found no reference to php. is there anywhere else i would find a place in apache settings that would be telling it where to find php? Thanks > > -Ryan > Hi Ryan. Remember to check a phpinfo() script. All useful info is usually there. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] window size...
No. Niklas -Original Message- From: Deependra b. Tandukar [mailto:[EMAIL PROTECTED] Sent: 4. huhtikuuta 2003 12:45 To: Justin French; Diana Castillo; [EMAIL PROTECTED] Subject: [PHP] window size... Hi, Is there anyway to define a fixed window size using PHP as we do with JavaScript? Regards, DT -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ### This message has been scanned by F-Secure Anti-Virus for Internet Mail. For more information, connect to http://www.F-Secure.com/ ### This message has been scanned by F-Secure Anti-Virus for Internet Mail. For more information, connect to http://www.F-Secure.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Why PHP reads local php.ini?
What´s wrong with my question?, can anybody help me? -Mensaje original- De: Jose Luis Pérez Ruiz [mailto:[EMAIL PROTECTED] Enviado el: viernes 4 de abril de 2003 10:57 Para: [EMAIL PROTECTED] Asunto: [PHP] Why PHP reads local php.ini? I mean than when you run PHP in CGI mode, PHP doesn´t read default php.ini location. It first to look php in your actual path. An example... ecazfe04:/home3/www# php -v PHP 4.3.1 (cgi), Copyright (c) 1997-2002 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies ecazfe04:/home3/www# export REQUEST_METHOD="POST" // Now we are in CGI mode as if it was called from Apache. ecazfe04:/home3/www# export REDIRECT_STATUS="200" // To avoid force-cgi-redirect ecazfe04:/home3/www# php -v Content-type: text/html X-Powered-By: PHP/4.3.1 No input file specified. // Ok, we are in CGI mode and it looks for a file. /home3/www# cd /home3/www# php index.php Everithings gos OK, except that if exists php.ini in PHP uses it. That overrides default compilation option. You can see it if you use phpinfo() in 'index.php'. I think this shouldn´t be the correct way of reading php.ini, but maybe I´m wrong. Can anybody help me? I run a webserver (Apache+PHP) that hosts some virtualhosts and I don´t won´t that my customers could use an alternate php.ini. PS: Sorry, I´m Spanish and I don´t know if my explanation is clear enough. José Luis Pérez Ruiz Arrakis Servicios y Comunicaciones S.L.U. Edificio Expo, C/ Inca Garcilaso s/n Isla de la Cartuja 41092 Sevilla Telefono: 955 550 509 ** Noticia legal Este mensaje electrónico contiene información de BT Ignite España S.A.U. que es privada y confidencial, siendo para el uso exclusivo de la persona (s) o entidades arriba mencionadas. Si usted no es el destinatario señalado, le informamos que cualquier divulgación, copia, distribución o uso de los contenidos está prohibida. Si usted ha recibido este mensaje por error, por favor borre su contenido lo antes posible. Gracias. -- 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] uploading entire directory, with or without compression...
David T-G wrote: It's certainly a start :-) Remember that your clients would have to install the java application on their computer, because java applets (the one running from web) don't have permission to access files on local computer. The same limitation has javascript. I have heard about a signed ActiveX component that can do this, I think it is that signed components are enabled (or must be confirmed) by default in IE. % % http://support.softartisans.com/docs/JFile/prog_g_recursive.htm I'll definitely check it out! % % hope you find it useful % -awlad Thanks so much :-) HAND :-D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] window size...
What window? Do you mean the one in the server room? ;-) Simply echo javascript code that will do it. Remember: php runs on the server, if you want to do something within the browser without interacting with the server, use javascript. Deependra b. Tandukar wrote: Hi, Is there anyway to define a fixed window size using PHP as we do with JavaScript? Regards, DT -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] uploading entire directory, with or without compression ...
oo bugger is there an open source version ? -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 8:05 PM To: David T-G Cc: PHP General list; Awlad Hussain Subject: Re: [PHP] uploading entire directory, with or without compression ... David T-G wrote: >It's certainly a start :-) > > Remember that your clients would have to install the java application on their computer, because java applets (the one running from web) don't have permission to access files on local computer. The same limitation has javascript. I have heard about a signed ActiveX component that can do this, I think it is that signed components are enabled (or must be confirmed) by default in IE. > >% >% http://support.softartisans.com/docs/JFile/prog_g_recursive.htm > >I'll definitely check it out! > > >% >% hope you find it useful >% -awlad > >Thanks so much :-) > > >HAND > >:-D > > -- 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] Why PHP reads local php.ini?
Jose luis pérez ruiz <[EMAIL PROTECTED]> escribió > > What´s wrong with my question?, can anybody help me? Hola Jose Luis. Nothing's wrong with your post. Personally I can't help because I havn't any experience at using php as a cgi module. PS-Deberías esperar a la tarde-noche, cuando se conectan más usuarios americanos que saben mucho más de esto. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uploading entire directory, with or without compression...
If there is it would not be signed :-( Dan Rossi wrote: oo bugger is there an open source version ? -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 8:05 PM To: David T-G Cc: PHP General list; Awlad Hussain Subject: Re: [PHP] uploading entire directory, with or without compression ... David T-G wrote: It's certainly a start :-) Remember that your clients would have to install the java application on their computer, because java applets (the one running from web) don't have permission to access files on local computer. The same limitation has javascript. I have heard about a signed ActiveX component that can do this, I think it is that signed components are enabled (or must be confirmed) by default in IE. % % http://support.softartisans.com/docs/JFile/prog_g_recursive.htm I'll definitely check it out! % % hope you find it useful % -awlad Thanks so much :-) HAND :-D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Submit Image Button
Even if it would be fixed right now, you cannot count on it for several years ;-) Daevid Vincent wrote: Anyone know if this annoying behaviour will ever be 'fixed' in future HTML specs? I can't believe what a glaring oversight this is that the 'value' doesn't get GET/POSTED like with a normal 'submit' button... WTF were they thinking? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: Stuck
Thank you to Rich who saved me from going nuts. Have now got my members registration and login working. Also thank you to Janet and Ed who kindly offered to help. I would like to build an admin area allowing users to upload course work when completed, so don't think you have heard the last from me :o) In fact I have another question but I will post it separate from this. Thank you guys! Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Individual member pages
How could I have individual pages for each member who registers? (ie) Pages only that member can see. Would this be easy(ish) to do or should I study PHP a little more first? Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] uploading entire directory, with or without compression ...
hmm what do u mean y signed ? applets simply load dont they ? also maye activex is the way to go ? -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 8:17 PM To: Dan Rossi Cc: PHP General list Subject: Re: [PHP] uploading entire directory, with or without compression ... If there is it would not be signed :-( Dan Rossi wrote: >oo bugger is there an open source version ? > >-Original Message- >From: Marek Kilimajer [mailto:[EMAIL PROTECTED] >Sent: Friday, April 04, 2003 8:05 PM >To: David T-G >Cc: PHP General list; Awlad Hussain >Subject: Re: [PHP] uploading entire directory, with or without >compression ... > > > > >David T-G wrote: > > > >>It's certainly a start :-) >> >> >> >> >Remember that your clients would have to install the java application on >their computer, because java applets (the one running from web) don't >have permission to access files on local computer. The same limitation >has javascript. I have heard about a signed ActiveX component that can >do this, I think it is that signed components are enabled (or must be >confirmed) by default in IE. > > > >>% >>% http://support.softartisans.com/docs/JFile/prog_g_recursive.htm >> >>I'll definitely check it out! >> >> >>% >>% hope you find it useful >>% -awlad >> >>Thanks so much :-) >> >> >>HAND >> >>:-D >> >> >> >> > > > > -- 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] magic quotes
> -Original Message- > From: Chris Hewitt [mailto:[EMAIL PROTECTED] > Sent: 03 April 2003 09:26 > To: Justin French [snip] > > What I have done is to do the addslashes/stripslashes assuming > magic_quotes_runtime is off then force it off within my code > beforehand > with: > > if (ini_get('magic_quotes_runtime') == 1) > { > if (ini_set('magic_quotes_runtime','Off') == false) > { > echo "ERROR: Could not turn off > magic_quotes_runtime\n"; > } > } > > I found that ini_set would through an error if the seting was already > made, hence the initial check. So far this seems OK, but it was only > yesterday... Something bugged me about this code and comment when I very first read it, but it's taken an overnight cogitate to work out what it was. Dare I venture that your previous code, which sometimes appeared to throw an error, was simply: if (ini_set('magic_quotes_runtime','Off') == false) { echo "ERROR: Could not turn off magic_quotes_runtime\n"; } ? If so, there's a fundamental flaw here: as ini_set is defined to return the previous value of the setting, or FALSE if it fails, a simple equality comparison (==) to FALSE will succeed whenever the ini_set fails *or when the previous value was 0 (off)*. To echo your error only when ini_set() genuinely returns FALSE, you must do an identity comparison (===). It can *never* be good practice to make an equality (==) or non-equality (!=) comparison with TRUE or FALSE. Not only is this bad style, but it is also inefficient. Consider: if ($x==TRUE) (where $x can be any arbitrary expression). PHP must first retrieve the value of $x, convert it to Boolean (giving TRUE or FALSE) and then compare it to TRUE -- yielding TRUE if $x was, er, TRUE and FALSE if $x was, duh, FALSE. That's a whole extra unnecessary comparison, plus some obfuscation for humans reading the code. So just use: if ($x) Taking the converse: if ($x==FALSE) this isn't quite so clear-cut. PHP will retrieve the Boolean value of $x (TRUE or FALSE), then compare it to FALSE, yielding TRUE if $x was FALSE, FALSE if it was TRUE. It's not immediately clear, but this comparison will usually be more expensive than just doing a Boolean not (!) on the expression. Stylistically, it's usually also clearer to read as if (!$x) -- IMO, it's better to have the clue that you're looking for the inverse value at the front, and read it as "if not $x". (Well, I suppose you could also write "if (FALSE==$x)", but personally I think that's just as bad as the other way round!) Finally, if you never have an == or != comparison to TRUE or FALSE, the rare occasion when you actually need to do an === or !== test will be very obvious and will alert someone reading the code (yes, even yourself several months later!) that something special is going on. 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[2]: [PHP] Submit Image Button
Hi -{, Nachricht vom Donnerstag, 3. April 2003, 16:27:56: > If(!$_GET['sub_x'] && !$_GET['sub_y']) { > // display form > } else { > // it was submitted Use "isset" to test the variables... it is cleaner code. PHP will complain if you do not. (Except of course if you silence it and turn warnings of.) I have started to to to develop with error_reporting(E_ALL); set. This way, PHP complains about every unclean bit in code, like reading from unset variables. Makes you write cleaner/less bug-prone code. If ((!isset($_GET['sub_x'])) and (!isset($_GET['sub_y']))) { // display form } else { // it was submitted } BTW, in my experience it is enough to check one of these values with isset, even if this one is 0, it will be SET to 0. You wont catch a click at the coordinates x=0/y=0 with your code (don't know if that is even possible, will have to read the specs...) Timo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uploading entire directory, with or without compression...
They are signed by a trusted authority (micro$oft) that grants that they are secure to use and therefore can use features (file access) that would be otherwise forbiden (if the user chooses to trust it). The integrity of the component is also ensured. Dan Rossi wrote: hmm what do u mean y signed ? applets simply load dont they ? also maye activex is the way to go ? -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 8:17 PM To: Dan Rossi Cc: PHP General list Subject: Re: [PHP] uploading entire directory, with or without compression ... If there is it would not be signed :-( Dan Rossi wrote: oo bugger is there an open source version ? -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 8:05 PM To: David T-G Cc: PHP General list; Awlad Hussain Subject: Re: [PHP] uploading entire directory, with or without compression ... David T-G wrote: It's certainly a start :-) Remember that your clients would have to install the java application on their computer, because java applets (the one running from web) don't have permission to access files on local computer. The same limitation has javascript. I have heard about a signed ActiveX component that can do this, I think it is that signed components are enabled (or must be confirmed) by default in IE. % % http://support.softartisans.com/docs/JFile/prog_g_recursive.htm I'll definitely check it out! % % hope you find it useful % -awlad Thanks so much :-) HAND :-D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Database Question
Sorry I wasn't clear before. It goes like this. I have a Virtual Airline and I have a DB called pilots with these tables: pilot_id, pilot_name, ivao, vatsim, status Also have a report DB which contains these tables: pilot_id, pilot_name, aircraft, flight_time, origin, destination, originweather, destinationweather, etc., etc., (<--- this is per report) I want to get all the information from these tables, for each pilot, since a pilot has many reports there are many lines in the Report DB. Now I need to create a page showing the all the current pilots that active (stated in the status table of the PILOT DB), and next to that show their TOTAL reports filed and TOTAL hours flown for the company. The PILOT_ID must link to another page which will show all the reports in detail for that pilot. I down't know if this is possible or adviseable, but I have about 20 pilots sending 2-3 report per day, you can imagine how confusing the REPORT section is now, since it has all the report for all the pilots ordered by pilot_idI have about 160 reports so far, and I'm going nuts Thanks in advance. Joe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mimetpye of remote file
string *mime_content_type* ( string filename) Dan Rossi wrote: hi guys apart for getimagesize for images is there a way to get mimetypes for other files ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Individual member pages
On Fri, 4 Apr 2003 11:16:49 +0100, you wrote: >How could I have individual pages for each member who registers? >(ie) Pages only that member can see. > >Would this be easy(ish) to do or should I study PHP a little more first? This is a very general question. Yes it's possible, and yes you should do some research on PHP - what it can do and how it does it. Some links you might find useful: The manual: http://www.php.net/manual/en/ especially the session management functions, which allow you to recognise individual users (among other things) http://www.php.net/manual/en/ref.session.php Tutorials. Many, many tutorials http://directory.google.com/Top/Computers/Programming/Languages/PHP/Tutorials/ And one specifically on session management http://www.phpfreaks.com/tutorials/41/0.php Once you know enough to ask more specific questions, I'm sure the people here will be happy to help you. But what you just asked is something akin to "my computer is broken. how do I fix it?" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] isp configuratuion error
When calling up a page on my web with the extension of .php, I presently get the following notice. (please see below) Before yesterday, I had been able to load any .php page on my web. The ISP which hosts this web is on NT. Please advise. Thank you. Tony Ritter . Security Alert! The PHP CGI cannot be accessed directly. This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive. For more information as to why this behaviour exists, see the manual page for CGI security. For more information about changing this behaviour or re-enabling this webserver, consult the installation file that came with this distribution, or visit the manual page. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: [newbie] embed php in html file
Take a look at auto_prepend_file within php.ini Bobby Rahman wrote: *** This Message Was Virus Checked With : SAVI 3.66 February 2003 Last Updated 2nd April 2003 *** Hiya I need advice for an optimum solution to display the username that is logged in on every html form page of my application. I have a header.php : session_start(); echo "Logged in as: ".$_SESSION['curr_user'].""; ?> Now I have many html forms which user's see What I want to know is how to include the header.php into every html form page. One way is to rename the html file with extension .php then This seems a bit wasteful for one line of php to change all the forms to .php. Is there any other ways of embedding the header.php file in html forms.The reason I am so keen on keeping html and php files seperate is thus to make debugging easier and maintain a kinda three tier design. Any suggestions will be much appreciated Bob _ Use MSN Messenger to send music and pics to your friends http://www.msn.co.uk/messenger -- -- www.curvedvision.com -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Database Question
José Pereira wrote: Sorry I wasn't clear before. It goes like this. I have a Virtual Airline and I have a DB called pilots with these tables: To make it cleaner: database has tables, tables have columns, pilots and report are tables, these are columns: pilot_id, pilot_name, ivao, vatsim, status Also have a report DB which contains these tables: pilot_id, pilot_name, aircraft, flight_time, origin, destination, originweather, destinationweather, etc., etc., (<--- this is per report) Add report_id here (INT PRIMARY autoincrement) I want to get all the information from these tables, for each pilot, since a pilot has many reports there are many lines in the Report DB. Now I need to create a page showing the all the current pilots that active (stated in the status table of the PILOT DB), and next to that show their TOTAL reports filed and TOTAL hours flown for the company. SELECT *, COUNT(report_id) count, # nuber of reports SUM(flight_time) as total_time # total time FROM pilots p LEFT JOIN report r ON p.pilot_d=r.pilot_id # left join so even pilots with no report show up WHERE p.status=1 # only active pilots GROUP BY p.pilot_id # this magic alows us to get info from pilot table together with grouping info (COUNT, SUM...) from reports table ORDER BY pilot_name # order it The PILOT_ID must link to another page which will show all the reports in detail for that pilot. so be it I down't know if this is possible or adviseable, but I have about 20 pilots sending 2-3 report per day, you can imagine how confusing the REPORT section is now, since it has all the report for all the pilots ordered by pilot_idI have about 160 reports so far, and I'm going nuts Thanks in advance. Joe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Database Question
Ok, but won't this count ALL the reports and ALL the hours together??? "Marek Kilimajer" <[EMAIL PROTECTED]> escreveu na mensagem news:[EMAIL PROTECTED] José Pereira wrote: >Sorry I wasn't clear before. It goes like this. > >I have a Virtual Airline and I have a DB called pilots with these tables: > To make it cleaner: database has tables, tables have columns, pilots and report are tables, these are columns: >pilot_id, pilot_name, ivao, vatsim, status > >Also have a report DB which contains these tables: > >pilot_id, pilot_name, aircraft, flight_time, origin, destination, >originweather, destinationweather, etc., etc., (<--- this is per report) > Add report_id here (INT PRIMARY autoincrement) > >I want to get all the information from these tables, for each pilot, since a >pilot has many reports there are many lines in the Report DB. > >Now I need to create a page showing the all the current pilots that active >(stated in the status table of the PILOT DB), and next to that show their >TOTAL reports filed and TOTAL hours flown for the company. > SELECT *, COUNT(report_id) count, # nuber of reports SUM(flight_time) as total_time # total time FROM pilots p LEFT JOIN report r ON p.pilot_d=r.pilot_id # left join so even pilots with no report show up WHERE p.status=1 # only active pilots GROUP BY p.pilot_id # this magic alows us to get info from pilot table together with grouping info (COUNT, SUM...) from reports table ORDER BY pilot_name # order it > >The PILOT_ID must link to another page which will show all the reports in >detail for that pilot. > so be it > >I down't know if this is possible or adviseable, but I have about 20 pilots >sending 2-3 report per day, you can imagine how confusing the REPORT section >is now, since it has all the report for all the pilots ordered by >pilot_idI have about 160 reports so far, and I'm going nuts > >Thanks in advance. >Joe > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] isp configuratuion error
Anthony Ritter wrote: [ snip ] . Security Alert! The PHP CGI cannot be accessed directly. This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive. For more information as to why this behaviour exists, see the manual page for CGI security. For more information about changing this behaviour or re-enabling this webserver, consult the installation file that came with this distribution, or visit the manual page. You need to edit the php.ini file (or if this is hosted, have your host change the php.ini file). The setting you want is : force-cgi-redirect You need to change this to false (0) for it to work on IIS. IIRC, it says something along those lines in the default php.ini-recommended that comes with the package. I'm not on my php box or else would give you the exact line to change, but I know its the force-cgi-redirect (might be cgi_force_redirect) setting that's causing this problem (had similar issue with local IIS install) -- Burhan Khalid phplist[at]meidomus[dot]com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Database Question
No, because the query specifies SELECT *, COUNT ... ^ and GROUP BY p.pilot_id Just try it José Pereira wrote: Ok, but won't this count ALL the reports and ALL the hours together??? "Marek Kilimajer" <[EMAIL PROTECTED]> escreveu na mensagem news:[EMAIL PROTECTED] José Pereira wrote: Sorry I wasn't clear before. It goes like this. I have a Virtual Airline and I have a DB called pilots with these tables: To make it cleaner: database has tables, tables have columns, pilots and report are tables, these are columns: pilot_id, pilot_name, ivao, vatsim, status Also have a report DB which contains these tables: pilot_id, pilot_name, aircraft, flight_time, origin, destination, originweather, destinationweather, etc., etc., (<--- this is per report) Add report_id here (INT PRIMARY autoincrement) I want to get all the information from these tables, for each pilot, since a pilot has many reports there are many lines in the Report DB. Now I need to create a page showing the all the current pilots that active (stated in the status table of the PILOT DB), and next to that show their TOTAL reports filed and TOTAL hours flown for the company. SELECT *, COUNT(report_id) count, # nuber of reports SUM(flight_time) as total_time # total time FROM pilots p LEFT JOIN report r ON p.pilot_d=r.pilot_id # left join so even pilots with no report show up WHERE p.status=1 # only active pilots GROUP BY p.pilot_id # this magic alows us to get info from pilot table together with grouping info (COUNT, SUM...) from reports table ORDER BY pilot_name # order it The PILOT_ID must link to another page which will show all the reports in detail for that pilot. so be it I down't know if this is possible or adviseable, but I have about 20 pilots sending 2-3 report per day, you can imagine how confusing the REPORT section is now, since it has all the report for all the pilots ordered by pilot_idI have about 160 reports so far, and I'm going nuts Thanks in advance. Joe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] image
dear all, hi! i am creating an html file through a php script. i am drawing a table in one of whose cells i want to include and image. but this image does not appear when i open the html page in internet explorer. i think the syntax is correct and the picture is very much present in the given destination. what can be the problem? thanks, diksha. '; $string.=$wname; $string.=' ___ Odomos - the only mosquito protection outside 4 walls - Click here to know more! http://r.rediff.com/r?http://clients.rediff.com/odomos/Odomos.htm&&odomos&&wn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] newbie help, pressing the submit button returns nothing
Hi all, I have a real quick question. I'm trying to learn PHP and right now im working with variables, anyway, I cannot get the code below to work correctly, could anyone help me out here the problem is, when you submit the name, the name will not appear at all. Name: Your name is: -- David M. Edification Web Solutions http://www.edificationweb.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] isp configuratuion error
Burhan Khalid" wrote in message: > You need to edit the php.ini file (or if this is hosted, have your host > change the php.ini file). > > The setting you want is : force-cgi-redirect > > You need to change this to false (0) for it to work on IIS. > > IIRC, it says something along those lines in the default > php.ini-recommended that comes with the package. > > I'm not on my php box or else would give you the exact line to change, > but I know its the force-cgi-redirect (might be cgi_force_redirect) > setting that's causing this problem (had similar issue with local IIS > install) . Thank you BK. TR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie help, pressing the submit button returns nothing
Your problem is not with PHP but with basic HTML. Your tag needs an action="www.somepage.com" in order to "do" something. With PHP, you can call the same page back onto itself. On Fri, 2003-04-04 at 14:37, David McGlone wrote: > Hi all, I have a real quick question. I'm trying to learn PHP and right now im > working with variables, anyway, I cannot get the code below to work > correctly, could anyone help me out here the problem is, when you submit the > name, the name will not appear at all. > > > > > > Name: > > > > > Your name is: > > echo ($UserName); > ?> > > > -- > David M. > Edification Web Solutions > http://www.edificationweb.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] is register globals off ready for prime time
Working on a project where we have an off shore developer. We are runnig 4.3 and have turned register globals off. He says that this option is not ready for production use and breaks php internally. I have never heard this before. Has anyone heard this, or experienced this. -- Ray Todd Stevens Specialists in Network and Security Consulting Senior ConsultantSoftware audit service available Stevens Services Suite 21 3754 Old State Rd 37 N Bedford, IN 47421 (812) 279-9394 [EMAIL PROTECTED] Thought for the day: Dictatorship (n): a form of government under which everything which is not prohibited is compulsory. For PGP public key send message with subject please send PGP key If this message refers to an attachment the attachment may arrive as a seperate mail message depending on the type of mail client and gateway software you are using. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] REPLY NEEDED
On Friday 04 April 2003 03:56 am, Timo Boettcher wrote: > Hi, > > Message of Friday, 4th April 2003, 12:28:44: > Apart from this being as Off-topic as I have ever seen, I think we > should help him: > So that he doesn't have to spend his valuable funds and time for > coping with spam, we should all get his address out of the lists of > those spammers... (you know, "klick here if you don't want to receive > this newsletter anymore"). That way, he can perhaps get a grip on his > situation himself. Clicking on those links does not help the situation, it only verifies to the spammer that the E-mail address was indeed valid and they've found the prefect person to spam. -- David M. Edification Web Solutions http://www.edificationweb.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] is register globals off ready for prime time
> Working on a project where we have an off shore developer. We > are runnig 4.3 and have turned register globals off. He says that > this option is not ready for production use and breaks php internally. > I have never heard this before. Has anyone heard this, or > experienced this. Ummm... no. That's not true. It may break certain programs that were written and are expecting register_globals to be on, but that's it. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] REPLY NEEDED
I know this is OT, but I caught a story somewhere about the American Embassy in Nigeria actually having to REGULARLY rescue Americans who go over there to claim their moneythat's just sad. -Original Message- From: Leif K-Brooks [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2003 8:48 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] REPLY NEEDED Based on the information gathered about thousands of people, you believe they would all be in a position to help you? :) PATRICK KOFI wrote: >BASED ON INFORMATION GATHERED ABOUT YOU, WE BELIEVE YOU WOULD BE IN A POSITION TO HELP US IN TRANSFERING THIS FUND (US$31.5M) INTO A SAFE ACCOUNT. IT HAS BEEN AGREED THAT THE OWNER OF THE ACCOUNT WILL BE COMPENSATED WITH 30% OF THE REMITTED FUNDS, WHILE WE KEEP 60% AS THE INITIATORS AND 10% WILL BE SET ASIDE TO OFFSET EXPENSES AND PAY THE NECESSARY TAXES. > -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- 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] newbie help, pressing the submit button returns nothing
> Hi all, I have a real quick question. I'm trying to learn PHP and right > now im > working with variables, anyway, I cannot get the code below to work > correctly, could anyone help me out here the problem is, when you submit > the > name, the name will not appear at all. > > > > > > Name: > > > > > Your name is: > > echo ($UserName); > ?> Use $_POST['UserName'] instead of just $UserName and do a search on register_globals to find out why. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie help, pressing the submit button returns nothing
Petre Agenbag wrote: Your problem is not with PHP but with basic HTML. Your tag needs an action="www.somepage.com" in order to "do" something. With PHP, you can call the same page back onto itself. On Fri, 2003-04-04 at 14:37, David McGlone wrote: Hi all, I have a real quick question. I'm trying to learn PHP and right now im working with variables, anyway, I cannot get the code below to work correctly, could anyone help me out here the problem is, when you submit the name, the name will not appear at all. Name: Your name is: echo ($UserName); ?> The action attribute is an excellent suggestion ( I do believe that if no action is given, the form defaults to the same file its being submitted from ). Anyhow, My guess is register_globals is off in your PHP setup. Depending on your PHP version, replace your $UserName with : PHP version < 4.1 = $HTTP_POST_VARS['UserName'] PHP version > 4.1 = $_POST['UserName'] -- Burhan Khalid phplist[at]meidomus[dot]com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Q. Adding line numbers to highlighted source
> I've been trying to add line-numbers to my source code, but can't seem to > work out how to do it. This works. The line numbers end up colored the same as the line, though. ","1 ",$h_file); $count=2; $nh_file = preg_replace("//e",'"".$count++." "',$h_file); echo $nh_file; ?> ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] newbie help, pressing the submit button returns nothing
If no action tag is specified, it'll default to the current page. Just FYI. It's up to the browser, though, so some may decide not to do anything... ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ > -Original Message- > From: Petre Agenbag [mailto:[EMAIL PROTECTED] > Sent: Friday, April 04, 2003 7:43 AM > To: David McGlone > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] newbie help, pressing the submit button returns nothing > > Your problem is not with PHP but with basic HTML. > Your tag needs an action="www.somepage.com" in order to "do" > something. With PHP, you can call the same page back onto itself. > > On Fri, 2003-04-04 at 14:37, David McGlone wrote: > > Hi all, I have a real quick question. I'm trying to learn PHP and right > now im > > working with variables, anyway, I cannot get the code below to work > > correctly, could anyone help me out here the problem is, when you submit > the > > name, the name will not appear at all. > > > > > > > > > > > > Name: > > > > > > > > > > Your name is: > > > > > echo ($UserName); > > ?> > > > > > > -- > > David M. > > Edification Web Solutions > > http://www.edificationweb.com > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is register globals off ready for prime time
At 09:51 04.04.2003, Ray Todd Stevens said: [snip] >Working on a project where we have an off shore developer. We >are runnig 4.3 and have turned register globals off. He says that >this option is not ready for production use and breaks php internally. >I have never heard this before. Has anyone heard this, or >experienced this. [snip] Maybe it breaks _his_ code, but it is off by default since I believe 4.1.0, and IMHO _should_ remain off at all times. Too easy to inject into your code as to MHO.# Either this guy is trying to deceive his own weak code, or he doesn't have a clue of how PHP works. I'd reconsider hiring such a "developer". -- >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] MySQL Insert with Auto-Increment
Ok, here's what I have. I want to insert some values into a table with an auto_increment field, but I want to get the Serial of the record I just inserted so I can name an image $Serial.jpg. I could just select the serial of the last record entered but what happens (and I know it's unlikely but could happen) if someone else inserted another record a half a second after this one? Anyone have any ideas? Thanks! Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Individual member pages
Relatively easy-ish. . But you'll have to study PHP a bit more. This is a situation where sessions work really well - read up on them in the manual. Authenticate the user by means of a login page, which establishes the session. Then put something like the following at the top of each page. session_register( "origin" ); $origin=$PHP_SELF; if( $HTTP_SERVER_VARS[ "PHP_AUTH_USER" ] !="lancelot" && $HTTP_SERVER_VARS[ "PHP_AUTH_PW" ] !="grail" ) { if( !session_is_registered( "member_id" ) ) { header("Location: user_logon2.php\n"); } } All the above was one long strinb in the source, at the very top of the page, ahead of EVERYTHING else. You can ignore the bit about "lancelot" and "grail", that was built-in so that htdig could index the pages. The key bit is this: if( !session_is_registered( "member_id" ) // note the " ! " which negates the test If the user is not authenticated, i.e. the member_id does not exist, the user is redirected to the user_logn2.php, otherwise the rerest of the page loads. Why is this one line at the very top of each member page? Because the header() is function is called and there can be no output at all before that function. How you authenticate is up to you, but there's a good start, if I remember correctly, at http://www.thickbook.com, or Devshed, Webmonkey, etc. There are a couple of good articles/tutorials on session at those sites as well. HTH - Miles Thompson At 11:16 AM 4/4/2003 +0100, Andrew wrote: How could I have individual pages for each member who registers? (ie) Pages only that member can see. Would this be easy(ish) to do or should I study PHP a little more first? Andrew -- 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] MySQL Insert with Auto-Increment
use mysql_insert_id(), it keeps its value per connection so you don't need to worry about anything [EMAIL PROTECTED] wrote: Ok, here's what I have. I want to insert some values into a table with an auto_increment field, but I want to get the Serial of the record I just inserted so I can name an image $Serial.jpg. I could just select the serial of the last record entered but what happens (and I know it's unlikely but could happen) if someone else inserted another record a half a second after this one? Anyone have any ideas? Thanks! Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie help, pressing the submit button returns nothing
On Friday 04 April 2003 07:43 am, Petre Agenbag wrote: > Your problem is not with PHP but with basic HTML. > Your tag needs an action="www.somepage.com" in order to "do" > something. With PHP, you can call the same page back onto itself. Hi Petre, Thanks for the reply, I have actually tried this too and all the output I get is "Welcome !" but the username that was entered into the form box should appear between the Welcome and !, Please take a look at the code below: >>First page named: jobapp.html - Practice app Fill in the name and echo it back to the user. Please enter your name: --- >>Second page: named jobapp_action.php Welcome ! -- David M. Edification Web Solutions http://www.edificationweb.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQL Insert with Auto-Increment
Wonderful! Thanks! -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 8:18 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] MySQL Insert with Auto-Increment use mysql_insert_id(), it keeps its value per connection so you don't need to worry about anything [EMAIL PROTECTED] wrote: >Ok, here's what I have. I want to insert some values into a table with >an auto_increment field, but I want to get the Serial of the record I >just inserted so I can name an image $Serial.jpg. I could just select >the serial of the last record entered but what happens (and I know it's >unlikely but could happen) if someone else inserted another record a >half a second after this one? Anyone have any ideas? Thanks! > >Brian > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Q. Adding line numbers to highlighted source
Hi Alan, Another solution is to use the HighlightParser that comes with phpDocumentor (http://www.phpdoc.org) Regards, Greg -- phpDocumentor http://www.phpdoc.org Alan McFarlane wrote: I've been trying to add line-numbers to my source code, but can't seem to work out how to do it. As an example, I tried the following: function addPrefix( $matches ) { static $line = 1; return $line++ . $matches[0]; } $url = split("\?", $_GET['url']); $source = highlight_file($url[0], true); $source = preg_replace_callback("`\`U", "addPrefix", $source); echo $source; ?> which is called whenever the use user on a link like Show Source The problem is that my regex does not correcly match the lines. Anyone got any bright ideas? -- Alan McFarlane -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php5 writeup
just found this http://talks.php.net/show.php/php5intro/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] BIT OT - preventing double submit
i've seen this mentioned here a few times , ok its jsript , but i dont think there is anyone here who doesnt use any jscript or even html ?? heh basically all u do is disable the button once pressed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] BIT OT - preventing double submit
Isn't it easy just to do an "onClick Disable Button" kinda thing? > i've seen this mentioned here a few times , ok its jsript , but i dont > think there is anyone here who doesnt use any jscript or even html ?? > heh > > basically all u do is disable the button once pressed > > > > > > > > > -- > 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] BIT OT - preventing double submit
What happens when the refresh? How about this...when the form loads the first time it generates a unique_id, and when you submit the form it has to match that unique_id. That would stop people from being able to refresh because once the unique_id is submitted, it won't accept any more submissions with that unique_id. It makes sense to me, but this is my Friday ramblings -Original Message- From: Randum Ian [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 9:11 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] BIT OT - preventing double submit Isn't it easy just to do an "onClick Disable Button" kinda thing? > i've seen this mentioned here a few times , ok its jsript , but i dont > think there is anyone here who doesnt use any jscript or even html ?? > heh > > basically all u do is disable the button once pressed > > > > > > > > > -- > 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] php5 writeup
http://talks.php.net/show/php5intro/3 : Parse error: parse error in /local/Web/sites/talks/presentations/slides/php5intro/namespace.php on line 2* *Is this how it should work? ;-)* * Dan Rossi wrote: just found this http://talks.php.net/show.php/php5intro/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: image
Try to put your image into your web directory "Diksha Neel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > dear all, > > hi! > i am creating an html file through a php script. > i am drawing a table in one of whose cells i want > to include and image. > but this image does not appear when i open the html page > in internet explorer. > i think the syntax is correct and the picture is very much > present in the given destination. > what can be the problem? > > thanks, > diksha. > > > > src="C:\Documents and Settings\mangesh\My Documents\My > Pictures\sample.jpg">'; >$string.=$wname; >$string.=' > > > > ___ > Odomos - the only mosquito protection outside 4 walls - > Click here to know more! > http://r.rediff.com/r?http://clients.rediff.com/odomos/Odomos.htm&&odomos&&w n > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie help, pressing the submit button returns nothing
At 08:24 04-04-03 -0500, you wrote: On Friday 04 April 2003 07:43 am, Petre Agenbag wrote: > Your problem is not with PHP but with basic HTML. > Your tag needs an action="www.somepage.com" in order to "do" > something. With PHP, you can call the same page back onto itself. Hi Petre, Thanks for the reply, I have actually tried this too and all the output I get is "Welcome !" but the username that was entered into the form box should appear between the Welcome and !, Please take a look at the code below: >>First page named: jobapp.html - Practice app Fill in the name and echo it back to the user. Please enter your name: --- >>Second page: named jobapp_action.php Welcome ! Unless your register_globals is set to on, you should be using instead Eugene - Eugene Mah, M.Sc., DABR [EMAIL PROTECTED] Medical Physicist/Misplaced Canuck[EMAIL PROTECTED] Department of Radiology "For I am a Bear of Very Little Medical University of South Carolina Brain, and long words Bother Charleston, South Carolina me." Winnie the Pooh http://www.netcom.com/~eugenem/ PGP KeyID = 0x1F9779FD, 0x319393F4 PGP keys available on request ICQ 3113529 O- - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] chill out
You aren't required to be subscribed to post to the list, so if you are not subscribed you will not see the FAQ or the discussion about how to post properly. You could make it be sent in the confirmation email when someone first posts to the email address but then you are making the mail bigger and deluding yourself into thinking they will read it :) Mostly I see people get flamed when they ask a question (sometimes off topic) and them flame and otherwise insult the person that tried to help them, in which case I believe they deserve a thrashing :-). I found this list to be an excellent resource when I first started in PHP and I still find it to be a good resource (though the mail traffic has increased significantly). I empathize with people who are frustrated with users posting questions to the list such as how do I use n function, that could easily be answered by reading the manual, I emailed a person who sent multiple mails to the list with extremely simple questions and his response was "I know about the manual but it is easier and faster just to ask you guys" Something to think about. Jason Steve Edberg wrote: Well, you could do what the sunmanagers mailing list does...every so often (every month? every other month?) a 95KB FAQ is sent to all subscribers. However, the main problem is getting people to READ it. And those people likely to read it are probably the same people who'd do the requisite documentation/web search first anyway. I suppose you could set it up so that only new subscribers got the FAQ. Or if you want to be really ambitious/annoying, new subscribers would get the FAQ, then - to activate them on the mailing list - they'd have to take a short web-based quiz on the contents of the FAQ before they are allowed to post. However, as others have said, the signal-to-noise ratio of this list is pretty high, easiest thing is just to tolerate/ignore the inappropriate questions... -steve At 2:21 PM +0500 4/4/03, Haseeb Iqbal wrote: hi all, just like to add something here, (which i recmended before) there should be a automated way to email all the new users about what php is, that explain them that php is server side and it can't do client side, just a plain email will do this will certinaly minimize the no of off topic posts,what you people think? i think it will help Friendship is always a sweet responsibility, never an opportunity. HaSeEb IqBaL. -- 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] php5 writeup
If anyone's intersted, I've got that same presentation in .pdf format available. Just send me an email and I'll send you the link to it. -- Burhan Khalid phplist[at]meidomus[dot]com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ^M
> It looks like you are viewing a dos/windows file on unix. The ^M is > carriage return, which is needed as part of a dos/window end of line > sequence (carriage return, line feed) whereas unix uses just line feed. Nope. They're UNIX-created and UNIX-modified. Does it matter if I downloaded them onto my PC and then back onto the server? I don't think it should, since I did a global search-and-replace of all those suckers. > On unix (well, a full install of linux) there are the conversion > programs dos2unix and unix2dos. If transferring by ftp, use ASCII not > BINARY transfer. Yeah, I had this problem a little while ago, and it's back, but doesn't seem to be solvable this time for some reason. Someone suggested that last time, as well, and I haven't been able to get onto it (the server isn't under my control right now, and I'm still trying to get a gd/imagemagick on there). Someone suggested posting some example code so I can show what's going on. I'm going to do that when I have a little more time. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php5 writeup
Clint Tredway wrote: I would like it -Original Message- From: Burhan Khalid [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 8:02 AM To: Marek Kilimajer; [EMAIL PROTECTED] Subject: Re: [PHP] php5 writeup If anyone's intersted, I've got that same presentation in .pdf format available. Just send me an email and I'll send you the link to it. -- Burhan Khalid phplist[at]meidomus[dot]com You can find the .pdf from my reference downloader at http://www.meidomus.com (top left dropdown box). Any comments on that site -- please email me off list :) -- Burhan Khalid phplist[at]meidomus[dot]com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Html forms to php scripts
I have registered_globals on so this shouldn't matter, but: echo $_POST['ttt']; returns the same problem as simple echo $ttt; Here is my phpinfo(); http://psyche.govst.edu/test.php I'm in the process of upgrading to apache 2.0.45 and php 4.3.1, so maybe that will fix things as I have heard that 4.2.2 doesn't like apache2. Tim Van Zee ITS Network Specialist Governors State University -Original Message- From: Tim Burden [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 11:07 AM To: VanZee, Timothy Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Html forms to php scripts What version of Apache are you using? Can you point us to a phpinfo() file? - Original Message - From: "Timothy Vanzee" <[EMAIL PROTECTED]> Newsgroups: php.general To: <[EMAIL PROTECTED]> Sent: Wednesday, April 02, 2003 11:31 AM Subject: FW: [PHP] Html forms to php scripts I have the following issue between my html forms and php scripts. Html file (input.html) looks like this: Php file (input.php) looks like this: I can input text (i.e. superman) and then click submit. The resulting php page returns: supermanttt=superman It seems to me that it must be something in the php.ini file that needs to be changed, but I can't identify what exactly. Any help would be appreciated. php 4.2.2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Auto-Date Select Box
Does anyone know how I can make a PHP form select box that has the dates in it for the next 7 days including today and the remaining days from this week? eg: Friday, April 5 Saturday, April 6 Sunday, April 7 Monday, April 8 Tuesday, April 9 Wednesday, April 10 Thursday, April 11 Friday, April 12 Saturday, April 13 Sunday, April 14 Jay Fitzgerald, Design Director Bayou Internet - http://www.bayou.com Toll Free: 888.30.BAYOU (22968) Vox: 318.338.2034 / Fax: 318.338.2506 E-Mail: [EMAIL PROTECTED] ICQ: 38823829 / AIM: bayoujf / MSN: bayoujf / Yahoo: bayoujf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] trigger error and set error handling in an object
From a class I wrote... -- snip -- // hack to work around the inability to use a method as // a callback for the set_error_handler function // NOTE: if you forget the '&', then all of the settings // to class properties will be lost $GLOBALS['_ERROR_HANDLER_OBJECT'] = &$this; $GLOBALS['_ERROR_HANDLER_METHOD'] = 'error_handler'; // inside function to handle the redirection to a class method function eh($type, $message, $file=null, $line=null, $vars=null) { return $GLOBALS['_ERROR_HANDLER_OBJECT']-> $GLOBALS['_ERROR_HANDLER_METHOD']($type, $message, $file, $line, $vars); } // start handling errors set_error_handler('eh'); -- snip -- This uses a trick wrapping the actual callback in an inside function. HTH. Pete. Dan Rossi wrote: hi guys i am having an issue getting a set error handler to get a function within a class, i am also having problems trying to trigger the error, i dont want fatals or the error handler wont catch it anyway , but user or message picks up annoying messages like undefined index on variable , how can i achieve this properly this seems to work within the constructor set_error_handler(array(&$this, 'myErrorHandler')); but this way only works in 4.3 ? i need it backwards compatible trigger_error ("Cannot divide by zero", E_USER_WARNING); this is the trigger function myErrorHandler ($errno, $errstr, $errfile, $errline, $context) { plus this , is errrno supposed to return the error type or a code sorry to e vague its late -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Auto-Date Select Box
> -Original Message- > From: Jay Fitzgerald [mailto:[EMAIL PROTECTED] > Sent: Friday, April 04, 2003 9:17 AM > Subject: [PHP] PHP Auto-Date Select Box > > > Does anyone know how I can make a PHP form select box that > has the dates in > it for the next 7 days including today and the remaining days > from this week? > > eg: > > Friday, April 5 > Saturday, April 6 > Sunday, April 7 > Monday, April 8 > Tuesday, April 9 > Wednesday, April 10 > Thursday, April 11 > Friday, April 12 > Saturday, April 13 > Sunday, April 14 > I'd use date() and time() and a function such as Function buildSelect($howMany,$name) { $str = "\n"; $t = time(); For (i=0;$i<$howMany;$i++) { $str .= '' $str .= date('your verbose format string',$t) . "\n";; $t += 86400; } $str .= "/SELECT>\n"; return $str; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Auto-Date Select Box
for($i = 0; $i <= 7; $i++) { $day=strtotime("+$i day"); echo ''. date(' *your format here* ',$day).''; } Jay Fitzgerald wrote: Does anyone know how I can make a PHP form select box that has the dates in it for the next 7 days including today and the remaining days from this week? eg: Friday, April 5 Saturday, April 6 Sunday, April 7 Monday, April 8 Tuesday, April 9 Wednesday, April 10 Thursday, April 11 Friday, April 12 Saturday, April 13 Sunday, April 14 Jay Fitzgerald, Design Director Bayou Internet - http://www.bayou.com Toll Free: 888.30.BAYOU (22968) Vox: 318.338.2034 / Fax: 318.338.2506 E-Mail: [EMAIL PROTECTED] ICQ: 38823829 / AIM: bayoujf / MSN: bayoujf / Yahoo: bayoujf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ^M
\r shows up as ^M in many unix editors, so if you don't want ^M there, don't put \r into the file Liam Gibbs wrote: It looks like you are viewing a dos/windows file on unix. The ^M is carriage return, which is needed as part of a dos/window end of line sequence (carriage return, line feed) whereas unix uses just line feed. Nope. They're UNIX-created and UNIX-modified. Does it matter if I downloaded them onto my PC and then back onto the server? I don't think it should, since I did a global search-and-replace of all those suckers. On unix (well, a full install of linux) there are the conversion programs dos2unix and unix2dos. If transferring by ftp, use ASCII not BINARY transfer. Yeah, I had this problem a little while ago, and it's back, but doesn't seem to be solvable this time for some reason. Someone suggested that last time, as well, and I haven't been able to get onto it (the server isn't under my control right now, and I'm still trying to get a gd/imagemagick on there). Someone suggested posting some example code so I can show what's going on. I'm going to do that when I have a little more time. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP syntax colouring on documentation
Hi there, I am currently writing a number of guides on PHP, SMARTY and Syntax and I was wondering if there is a set schema for the colouring of code within these guides. Is there a website that can give me an idea? Regards, Ian. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cookies not being read - begging php 4 chapter 8 pg 283
I am working through the beginning php 4 book by wrox and I can not get the example to work. It is reading and passing the form data but the cookies is not being written or read here is my code. Also why can I not place these variables in line with the echo statement. If I do it doesn't work. I thought I could just echo "face=$_POST['type_sel'] " <- but it does not work. if ( $_POST['type_sel'] ) echo "face=" . $_POST['type_sel'] . " "; if ( $_POST['size_sel'] ) echo "size=" . $_POST['size_sel'] . " "; Paul Kraus Code Testing Cookies Testing Cookies PHP What font type would you like to use? default $var"); ?> What font size would you like to use? default $var" ); ?> Your cookies say: " ); echo ( "\$font['type'] = $font['type']" ); echo ( "\$font['size'] = $font['size']" ); echo ( "" ); ?> Your form variables say: " ); echo "type_sel = " . $_POST['type_sel'] . ""; echo "size_sel = " . $_POST['size_sel'] . ""; echo ( "" ); ?> mailto:[EMAIL PROTECTED]"> Last modified: Thu Apr 03 21:58:00 Eastern Standard Time 2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Cookies not being read - begging php 4 chapter 8 pg 283
Also when I first run this at the top I get this error... Notice: Undefined index: typeset in c:\inetpub\wwwroot\testing\cookies.php on line 4 Notice: Undefined index: size_sel in c:\inetpub\wwwroot\testing\cookies.php on line 5 I assume its because the var have not been filled but I still need the lines there do I need to turn of warnings or something? Paul -Original Message- From: Paul Kraus [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 9:42 AM To: [EMAIL PROTECTED] Subject: [PHP] Cookies not being read - begging php 4 chapter 8 pg 283 I am working through the beginning php 4 book by wrox and I can not get the example to work. It is reading and passing the form data but the cookies is not being written or read here is my code. Also why can I not place these variables in line with the echo statement. If I do it doesn't work. I thought I could just echo "face=$_POST['type_sel'] " <- but it does not work. if ( $_POST['type_sel'] ) echo "face=" . $_POST['type_sel'] . " "; if ( $_POST['size_sel'] ) echo "size=" . $_POST['size_sel'] . " "; Paul Kraus Code Testing Cookies Testing Cookies PHP What font type would you like to use? default $var"); ?> What font size would you like to use? default $var" ); ?> Your cookies say: " ); echo ( "\$font['type'] = $font['type']" ); echo ( "\$font['size'] = $font['size']" ); echo ( "" ); ?> Your form variables say: " ); echo "type_sel = " . $_POST['type_sel'] . ""; echo "size_sel = " . $_POST['size_sel'] . ""; echo ( "" ); ?> mailto:[EMAIL PROTECTED]"> Last modified: Thu Apr 03 21:58:00 Eastern Standard Time 2003 -- 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] ^M
At 16:16 4-4-2003, you wrote: > It looks like you are viewing a dos/windows file on unix. The ^M is > carriage return, which is needed as part of a dos/window end of line > sequence (carriage return, line feed) whereas unix uses just line feed. Nope. They're UNIX-created and UNIX-modified. Does it matter if I downloaded them onto my PC and then back onto the server? I don't think it should, since I did a global search-and-replace of all those suckers. Not 'Nope'. It really does matter and it was one of the reasons I abandoned Perl, cuz that happened all the time. My files would look good and work on my pc and after upload they would not work and give a 500 server error. It had to do with the way the FTP programme send the file: as binary or as text file. So the global search&replace was made undone when you uploaded as binary. I quote from argentavis.hypermart.net/perl/dosunix.html: " There is only a small difference between the two text format. For example, when you press Enter on a Unix type machine, a single newline character is printed to the file. In DOS, two characters are printed, a carriage return and a newline character. So when you make a Perl script in Notepad, and you upload it binary to a Unix type machine, this will immediately result in a compilation error. This compilation error will always return a 500 Internal Server Error. This is the reason why you should upload your scripts in ASCII format." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ^M
Liam Gibbs wrote: It looks like you are viewing a dos/windows file on unix. The ^M is carriage return, which is needed as part of a dos/window end of line sequence (carriage return, line feed) whereas unix uses just line feed. Nope. They're UNIX-created and UNIX-modified. Does it matter if I downloaded them onto my PC and then back onto the server? I don't think it should, since I did a global search-and-replace of all those suckers. As long as both transfers were done BINARY or ASCII then it should be the same when you get the file back. Just a thought, how are you generating these files? If you are doing it from code then \r \n will give you carriage return and line feed. On *nix you just need \n (there is the odd exception like mail() which should use both). HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] newbie help, pressing the submit button returns nothing
Chances are register_globals is off... Try using $_POST['UserName'] instead of $UserName John -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- John Coggeshall john at coggeshall dot org http://www.coggeshall.org/ -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- >-Original Message- >From: David McGlone [mailto:[EMAIL PROTECTED] >Sent: Friday, April 04, 2003 7:38 AM >To: [EMAIL PROTECTED] >Subject: [PHP] newbie help, pressing the submit button returns nothing > > >Hi all, I have a real quick question. I'm trying to learn PHP >and right now im >working with variables, anyway, I cannot get the code below to work >correctly, could anyone help me out here the problem is, when >you submit the >name, the name will not appear at all. > > > > > >Name: > > > > >Your name is: > >echo ($UserName); >?> > > >-- >David M. >Edification Web Solutions >http://www.edificationweb.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] is register globals off ready for prime time
He's wrong. John -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- John Coggeshall john at coggeshall dot org http://www.coggeshall.org/ -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- >-Original Message- >From: Ray Todd Stevens [mailto:[EMAIL PROTECTED] >Sent: Friday, April 04, 2003 7:47 AM >To: [EMAIL PROTECTED] >Subject: [PHP] is register globals off ready for prime time > > >Working on a project where we have an off shore developer. We >are runnig 4.3 and have turned register globals off. He says that >this option is not ready for production use and breaks php >internally. >I have never heard this before. Has anyone heard this, or >experienced this. > >-- >Ray Todd Stevens Specialists in Network and Security >Consulting >Senior ConsultantSoftware audit service available >Stevens Services >Suite 21 >3754 Old State Rd 37 N >Bedford, IN 47421 >(812) 279-9394 >[EMAIL PROTECTED] > >Thought for the day: >Dictatorship (n): a form of government under which everything >which is not prohibited is compulsory. > > >For PGP public key send message with subject >please send PGP key > >If this message refers to an attachment the attachment >may arrive as a seperate mail message depending on the >type of mail client and gateway software you are using. > > >-- >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] php5 writeup
>Parse error: parse error in >/local/Web/sites/talks/presentations/slides/php5intro/namespace.php on >line 2* > >*Is this how it should work? ;-)* In Sterling's Defense, the server running this code isn't PHP5 :) Hence, some of the examples don't work. John -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- John Coggeshall john at coggeshall dot org http://www.coggeshall.org/ -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- >-Original Message- >From: Marek Kilimajer [mailto:[EMAIL PROTECTED] >Sent: Friday, April 04, 2003 8:48 AM >To: Dan Rossi >Cc: Php-General >Subject: Re: [PHP] php5 writeup > > >http://talks.php.net/show/php5intro/3 : > >Parse error: parse error in >/local/Web/sites/talks/presentations/slides/php5intro/namespace.php on >line 2* > >*Is this how it should work? ;-)* >* >Dan Rossi wrote: > >>just found this http://talks.php.net/show.php/php5intro/ >> >> >> > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP syntax colouring on documentation
check phpinfo()... it lists the colors that highlight_file()/show_source() uses. Better yet, here's the values: highlight.bg#FF #FF highlight.comment #FF9900 #FF9900 highlight.default #CC #CC highlight.html #00 #00 highlight.keyword #006600 #006600 highlight.string#CC #CC HTH. Pete Randum Ian wrote: Hi there, I am currently writing a number of guides on PHP, SMARTY and Syntax and I was wondering if there is a set schema for the colouring of code within these guides. Is there a website that can give me an idea? Regards, Ian. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP syntax colouring on documentation
Good stuff thanks Pete. > check phpinfo()... it lists the colors that > highlight_file()/show_source() uses. > > Better yet, here's the values: > > highlight.bg #FF #FF > highlight.comment #FF9900 #FF9900 > highlight.default #CC #CC > highlight.html#00 #00 > highlight.keyword #006600 #006600 > highlight.string #CC #CC > > HTH. > Pete > > Randum Ian wrote: >> Hi there, I am currently writing a number of guides on PHP, SMARTY and >> Syntax and I was wondering if there is a set schema for the colouring >> of code within these guides. Is there a website that can give me an >> idea? >> >> Regards, Ian. >> >> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php5 writeup
Yes, I got that, the correct link is http://ny1.php.net/talks/show.php/php5intro - it runs on php5 ;-) John Coggeshall wrote: Parse error: parse error in /local/Web/sites/talks/presentations/slides/php5intro/namespace.php on line 2* *Is this how it should work? ;-)* In Sterling's Defense, the server running this code isn't PHP5 :) Hence, some of the examples don't work. John -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- John Coggeshall john at coggeshall dot org http://www.coggeshall.org/ -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 8:48 AM To: Dan Rossi Cc: Php-General Subject: Re: [PHP] php5 writeup http://talks.php.net/show/php5intro/3 : Parse error: parse error in /local/Web/sites/talks/presentations/slides/php5intro/namespace.php on line 2* *Is this how it should work? ;-)* * Dan Rossi wrote: just found this http://talks.php.net/show.php/php5intro/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP syntax colouring on documentation
Randum Ian wrote: Hi there, I am currently writing a number of guides on PHP, SMARTY and Syntax and I was wondering if there is a set schema for the colouring of code within these guides. Is there a website that can give me an idea? Regards, Ian. RTFM http://www.php.net/manual/en/function.highlight-string.php http://www.php.net/manual/en/function.highlight-file.php -- Burhan Khalid phplist[at]meidomus[dot]com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Cookies not being read - begging php 4 chapter 8 pg 283
> -Original Message- > From: Paul Kraus [mailto:[EMAIL PROTECTED] > Sent: 04 April 2003 15:42 > > Also why can I not place these variables in line with the echo > statement. If I do it doesn't work. > I thought I could just echo "face=$_POST['type_sel'] " <- but it does > not work. Please read the manual at http://www.php.net/manual/en/language.types.string.php#language.types.string .parsing for *why* this doesn't work, but short answer is: if ( $_POST['type_sel'] ) echo "face={$_POST['type_sel']}"; if ( $_POST['size_sel'] ) echo "size={$_POST['size_sel']}"; 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] Cookies not being read - begging php 4 chapter 8 pg 283
> -Original Message- > From: Paul Kraus [mailto:[EMAIL PROTECTED] > Sent: 04 April 2003 15:44 > > Also when I first run this at the top I get this error... > > Notice: Undefined index: typeset in > c:\inetpub\wwwroot\testing\cookies.php on line 4 > Notice: Undefined index: size_sel in > c:\inetpub\wwwroot\testing\cookies.php on line 5 > > I assume its because the var have not been filled but I still need the > lines there do I need to turn of warnings or something? Use isset(): if (isset($_POST['type_sel'])) etc... 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] PHP Email Attachment problem
Just tried the example and i can upload a file to a directory on my server. So i can do both uploads and attachments seperately, now it's just a matter of doing them at the same time. -Mike - Original Message - From: "Jason Wong" <[EMAIL PROTECTED]> Newsgroups: php.general To: <[EMAIL PROTECTED]> Sent: Friday, April 04, 2003 1:36 AM Subject: Re: [PHP] PHP Email Attachment problem > On Friday 04 April 2003 06:10, Michael Arena wrote: > > Made some progress today. Found an attachment script in the archives. I > > was able to send an email attachment if it was already on the server. now i > > just need the file to come from a form instead of already being on the > > server but that's not working yet. > > It sounds to me you've definitely got an upload problem. > > Try the upload example in the manual and let us know if you can get that > working. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > -- > Search the list archives before you post > http://marc.theaimsgroup.com/?l=php-general > -- > /* > Rainy days and automatic weapons always get me down. > */ > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Cookies not being read - begging php 4 chapter 8 pg 283
Long... I have included everything in an attempt not to leave anything out. I think this book is dated and causing me some issues. Following is data before and after form data My source Code The php generated source code. Paul Kraus I have made the changes. Here is my output before any form data is sent. Before form data - Notice: Undefined index: type_sel in c:\inetpub\wwwroot\testing\cookies.php on line 4 Notice: Undefined index: size_sel in c:\inetpub\wwwroot\testing\cookies.php on line 5 Testing Cookies PHP What font type would you like to use? What font size would you like to use? Your cookies say: font Notice: Undefined variable: font in c:\inetpub\wwwroot\testing\cookies.php on line 46 type= Notice: Undefined variable: font in c:\inetpub\wwwroot\testing\cookies.php on line 47 Notice: Undefined variable: font in c:\inetpub\wwwroot\testing\cookies.php on line 48 >bugger Notice: Undefined variable: font in c:\inetpub\wwwroot\testing\cookies.php on line 50 $font['type'] = Notice: Undefined variable: font in c:\inetpub\wwwroot\testing\cookies.php on line 51 $font['size'] = Your form variables say: Notice: Use of undefined constant type_sel - assumed 'type_sel' in c:\inetpub\wwwroot\testing\cookies.php on line 58 Notice: Undefined index: type_sel in c:\inetpub\wwwroot\testing\cookies.php on line 58 Notice: Use of undefined constant size_sel - assumed 'size_sel' in c:\inetpub\wwwroot\testing\cookies.php on line 59 Notice: Undefined index: size_sel in c:\inetpub\wwwroot\testing\cookies.php on line 59 > Notice: Undefined index: 'type_sel' in c:\inetpub\wwwroot\testing\cookies.php on line 61 $_POST['type_sel'] = Notice: Undefined index: 'size_sel' in c:\inetpub\wwwroot\testing\cookies.php on line 62 $_POST['size_sel'] = Last modified: Thu Apr 03 21:58:00 Eastern Standard Time 2003 After Form data --- Testing Cookies PHP - Beginning PHP4 Ch8 pg 283 What font type would you like to use? What font size would you like to use? Your cookies say: Notice: Undefined variable: font in c:\inetpub\wwwroot\testing\cookies.php on line 40 type=> Notice: Undefined variable: font in c:\inetpub\wwwroot\testing\cookies.php on line 44 $font['type'] = Notice: Undefined variable: font in c:\inetpub\wwwroot\testing\cookies.php on line 45 $font['size'] = Your form variables say: type_sel = sans-serif size_sel = 2 Last modified: Thu Apr 03 21:58:00 Eastern Standard Time 2003 Code - Testing Cookies Testing Cookies PHP - Beginning PHP4 Ch8 pg 283 What font type would you like to use? default $var"); ?> What font size would you like to use? default $var" ); ?> Your cookies say: " ); echo ( "\$font['type'] = {$font['type']}" ); echo ( "\$font['size'] = {$font['size']}" ); echo ( "" ); ?> Your form variables say: " ); echo "type_sel = {$_POST['type_sel']}"; echo "size_sel = {$_POST['size_sel']}"; echo ( "" ); ?> mailto:[EMAIL PROTECTED]"> Last modified: Thu Apr 03 21:58:00 Eastern Standard Time 2003 Php Generated Source Notice: Undefined index: type_sel in c:\inetpub\wwwroot\testing\cookies.php on line 4 Notice: Undefined index: size_sel in c:\inetpub\wwwroot\testing\cookies.php on line 5 Testing Cookies Testing Cookies PHP What font type would you like to use? default arialhelveticasans-serifcourier What font size would you like to use? default 1234 567 Your cookies say: font Notice: Undefined variable: font in c:\inetpub\wwwroot\testing\cookies.php on line 46 type= Notice: Undefined variable: font in c:\inetpub\wwwroot\testing\cookies.php on line 47 Notice: Undefined variable: font in c:\inetpub\wwwroot\testing\cookies.php on line 48 >bugger Notice: Undefined variable: font in c:\inetpub\wwwroot\testing\cookies.php on line 50 $font['type'] = Notice: Undefined variable: font in c:\inetpub\wwwroot\testing\cookies.php on line 51 $font['size'] = Your form variables say: Notice: Use of undefined constant type_sel - assumed 'type_sel' in c:\inetpub\wwwroot\testing\cookies.php on line 58 Notice: Undefined index: type_sel in c:\inetpub\wwwroot\testing\cookies.php on line 58 Notice: Use of undefined constant size_sel - assumed 'size_sel' in c:\inetpub\wwwroot\testing\cookies.php on line 59 Notice: Undefined index: size_sel in c:\inetpub\wwwroot\testing\cookies.php on line 59 > Notice: Undefined index: 'type_sel' in c:\inetpub\wwwroot\testing\cookies.php on line 61 $_POST['type_sel'] = Notice: Undefined index: 'size_sel' in c:\inetpub\wwwroot\testing\
Re: [PHP] Menu from Directory
Ben Whitehead wrote: Having looked at it, it seems to be along the lines of what I was thinking of... I would be very grateful if you could post the code, since I do think it will be very useful. The main difference I was thinking of was to have a menu in the form of a page of links, rather than a drop-down menu, but having seen that, I would much prefer the drop-down menu approach!!! Thanks very much, Ben. Sorry I didn't get to this in a while -- had to fix my filters :) Anyhow, the functions that I used to create my drop down box : function getSubDir($rootdirpath) { if ($dir = @opendir($rootdirpath)) { $array[] = $rootdirpath; while (($file = readdir($dir)) !== false) { if (is_dir($rootdirpath."/".$file) && $file != "." && $file != "..") { $array = array_merge($array,getSubDir($rootdirpath."/".$file)); } } closedir($dir); } return $array; } function getFiles($dirname) { $handle=opendir($dirname); while ($file = readdir($handle)) { if($file=='.'||$file=='..') continue; else $result_array[]=$file; } closedir($handle); return $result_array; } The first function returns all the subdirs in a directory (given as $rootdirpath). The second functions returns an array of all files in a directory. Simply combine these two functions to get a listing of all files in subdirectories : $subdirs = getSubDir("/path/to/main"); //no trailing / array_shift($subdirs); //gets rid of the parent dir $count = 0; while (list(,$val) = each($subdirs)) { $files[substr(strrchr($val,"/"),1,strlen(strrchr($val,"/")))] = getFiles($val); $count += count(getFiles($val)); } This while loop gets a list of all the files and counts the total number of files in the subdirs. The list of files is in an array called $files. Now, to build the drop down : while(list($key,$val) = each($files)) { echo "Section $key :\n"; while(list(,$name) = each ($val)) { echo " -=> "; echo substr($name,0,strlen($name)-4); echo "\n"; } echo "\n"; // space } I hope this helps you out. Let me know if you can't understand anything :) -- Burhan Khalid phplist[at]meidomus[dot]com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] magic quotes
Ford, Mike [LSS] wrote: -Original Message- From: Chris Hewitt [mailto:[EMAIL PROTECTED] Sent: 03 April 2003 09:26 To: Justin French [snip] What I have done is to do the addslashes/stripslashes assuming magic_quotes_runtime is off then force it off within my code beforehand with: if (ini_get('magic_quotes_runtime') == 1) { if (ini_set('magic_quotes_runtime','Off') == false) { echo "ERROR: Could not turn off magic_quotes_runtime\n"; } } I found that ini_set would through an error if the seting was already made, hence the initial check. So far this seems OK, but it was only yesterday... Something bugged me about this code and comment when I very first read it, but it's taken an overnight cogitate to work out what it was. Dare I venture that your previous code, which sometimes appeared to throw an error, was simply: if (ini_set('magic_quotes_runtime','Off') == false) { echo "ERROR: Could not turn off magic_quotes_runtime\n"; } ? If so, there's a fundamental flaw here: as ini_set is defined to return the previous value of the setting, or FALSE if it fails, a simple equality comparison (==) to FALSE will succeed whenever the ini_set fails *or when the previous value was 0 (off)*. To echo your error only when ini_set() genuinely returns FALSE, you must do an identity comparison (===). Yes, that was my previous code and you are right, its not right! I'll change it and thanks for letting me know. Regards Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP syntax colouring on documentation
> Randum Ian wrote: > > [ snip ] > >>> >>>RTFM >>> >>>http://www.php.net/manual/en/function.highlight-string.php >>>http://www.php.net/manual/en/function.highlight-file.php >>> >> >> Hi Burhan, >> >> I wasn't wanting to highlight anything like that, I am writing a guide >> which will be printed out in colour and wanted to highlight the code >> appropriately. Thanks for replying. >> >> Regards, Ian. > > Apologies Ian -- I am still on first cup of coffee. > > I don't suppose there is a standard scheme for highlighting such > matters, but I think that since its dealing with PHP, you would be > better off sticking with the default color highlighting that comes with > PHP. > > To find out what colors are used for what, check your friendly php.ini > :) > > Again, I apologize for my rash post earlier. > > -- > Burhan Khalid > phplist[at]meidomus[dot]com Don't worry about it mate, I understand how p* off experienced coders can get with the young ones! I have had a look at the phpinfo() file and it has come up with what it uses to highlight code so I might as well just use that! Regards, Ian. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php5 writeup
what exactly do namespaces do , i can sorta see whats its doin and this is what i want !! getMessage(); echo "\n\n"; } ?> function __construct() { echo "peel..peel.."; echo "\n\n"; } cool when is this actually used ? function __destruct() { echo "slip... crack!"; echo "\n\n"; } yep this is cool i've already tested it out and it works , but what is the whole point of private and protected again ? i've been reading the java intro on the sun site and it goes into detail about it http://ny1.php.net/talks/show.php/php5intro/13 hmm i soughta found php4 cant do this function add_agent($name) { array_push($this->agents, $name); } } class cia_administration extends cia { function __construct() { $this->add_agent('Sterling'); $this->add_agent('Zeev'); $this->add_agent('Andi'); $this->add_agent('Rasmus'); $this->add_agent('Thies'); } } i had to call the parent class constructor into the base constructor first to use its functions ?>? i dont get this http://ny1.php.net/talks/show.php/php5intro/25 wots the point of this ? http://ny1.php.net/talks/show.php/php5intro/28 ahh my brain hurts i got lost after this but i am so excited , i have 5 running i should start doing some OO experiments. -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Saturday, April 05, 2003 1:10 AM To: John Coggeshall Cc: 'Dan Rossi'; 'Php-General' Subject: Re: [PHP] php5 writeup Yes, I got that, the correct link is http://ny1.php.net/talks/show.php/php5intro - it runs on php5 ;-) John Coggeshall wrote: >>Parse error: parse error in >>/local/Web/sites/talks/presentations/slides/php5intro/namespace.php on >>line 2* >> >>*Is this how it should work? ;-)* >> >> > >In Sterling's Defense, the server running this code isn't PHP5 :) Hence, >some of the examples don't work. > >John > > >-~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- >John Coggeshall >john at coggeshall dot org http://www.coggeshall.org/ >-~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~- > > > > >>-Original Message- >>From: Marek Kilimajer [mailto:[EMAIL PROTECTED] >>Sent: Friday, April 04, 2003 8:48 AM >>To: Dan Rossi >>Cc: Php-General >>Subject: Re: [PHP] php5 writeup >> >> >>http://talks.php.net/show/php5intro/3 : >> >>Parse error: parse error in >>/local/Web/sites/talks/presentations/slides/php5intro/namespace.php on >>line 2* >> >>*Is this how it should work? ;-)* >>* >>Dan Rossi wrote: >> >> >> >>>just found this http://talks.php.net/show.php/php5intro/ >>> >>> >>> >>> >>> >>-- >>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] PHP Rounding Time
I apologize in advance for my constant nub questions.. How can I round the current time up or down to the nearest 1/2 hour? eg: timeranges: 0900 through 0915 == 0900 0916 through 0930 == 0930 0931 through 0945 == 0930 0946 through 1000 == 1000 Jay Fitzgerald, Design Director Bayou Internet - http://www.bayou.com Toll Free: 888.30.BAYOU (22968) Vox: 318.338.2034 / Fax: 318.338.2506 E-Mail: [EMAIL PROTECTED] ICQ: 38823829 / AIM: bayoujf / MSN: bayoujf / Yahoo: bayoujf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php5 writeup
On Fri, 2003-04-04 at 10:45, Dan Rossi wrote: > what exactly do namespaces do , i can sorta see whats its doin > > and this is what i want !! > > define('NUM', 10); > try { > if (NUM < 20) { > throw new Exception( > NUM . " is too small!" > ); > } > } catch (Exception $e) { > echo $e->getMessage(); > echo "\n\n"; > } > ?> > > > function __construct() { > echo "peel..peel.."; > echo "\n\n"; > } > > cool > > when is this actually used ? > function __destruct() { > echo "slip... crack!"; > echo "\n\n"; > } > > yep this is cool i've already tested it out and it works , but what is the > whole point of private and protected again ? i've been reading the java > intro on the sun site and it goes into detail about it > http://ny1.php.net/talks/show.php/php5intro/13 > > hmm i soughta found php4 cant do this > > function add_agent($name) { > array_push($this->agents, $name); > } > } > > class cia_administration extends cia { > function __construct() { > $this->add_agent('Sterling'); > $this->add_agent('Zeev'); > $this->add_agent('Andi'); > $this->add_agent('Rasmus'); > $this->add_agent('Thies'); > } > } > > i had to call the parent class constructor into the base constructor first > to use its functions ?>? Constructors in PHP5 are unified. This means you don't have to be aware of your parent class name while coding (so, for example, if you change what class you inherit, you don't have to dig to find where the parent constructor was called. > > i dont get this http://ny1.php.net/talks/show.php/php5intro/25 > It misses something without my explanation. :) PHP5 has native support for overloading access to properties and methods. Take the following: overloads = array( "name" => "Sterling", "address" => "More Spam Mail", "email" => "Even More Spam Mail" ); } function __get($name) { return $this->overloads[$name]; } function __set($name, $value) { $this->overloads[$name] = $value; } } $f = new foo; // undefined, __get method will be called, and it will // return the appropriate entry from overloads var_dump($f->address); ?> > wots the point of this ? http://ny1.php.net/talks/show.php/php5intro/28 > Abstract allows you to define certain methods that *must* be implemented in child classes. It also makes sure you can't instantiate parent classes (as they are incomplete). Its really a good way of passing interface contracts onto child classes. Take the example in my presentation, and copy it into your editor. Then remove the paint() method, and the corresponding method call from the child class. Without abstract being specified, this would still work; with abstract, watch what happens. -sterling -- Good judgement comes from experience, and experience comes from bad judgement. - Fred Brooks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Html forms to php scripts
Here are the results: Array ( [ttt] => javattt=java ) Array ( [ttt] => javattt=java ) Tim Van Zee ITS Network Specialist Governors State University [ snip ] Would be curiuos to see the the results of : echo ""; print_r($_REQUEST); echo""; echo ""; print_r($_POST); echo""; That might shed some light as to what is being sent and what isn't. -- Burhan Khalid phplist[at]meidomus[dot]com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Html forms to php scripts
I though we already covered that this was an PHP / Apache 2 bug?? Stop using Apache 2 with PHP. ---John Holmes... - Original Message - From: "VanZee, Timothy" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, April 04, 2003 11:01 AM Subject: RE: [PHP] Html forms to php scripts Here are the results: Array ( [ttt] => javattt=java ) Array ( [ttt] => javattt=java ) Tim Van Zee ITS Network Specialist Governors State University [ snip ] Would be curiuos to see the the results of : echo ""; print_r($_REQUEST); echo""; echo ""; print_r($_POST); echo""; That might shed some light as to what is being sent and what isn't. -- Burhan Khalid phplist[at]meidomus[dot]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] php5 writeup
yes thats what i was thinking itd a good idea , heh well php4 OO is basically a container of functions which allows you to throw variables around the place within it , i have most my privates within underscores so a global string replace wont be so painful , i guess thats what the whole idea of functions starting with underscores anyway ? -Original Message- From: Burhan Khalid [mailto:[EMAIL PROTECTED] Sent: Saturday, April 05, 2003 2:08 AM To: Dan Rossi Subject: Re: [PHP] php5 writeup Dan Rossi wrote: > what exactly do namespaces do , i can sorta see whats its doin > > and this is what i want !! [ snip ] Namespaces are provided to add an additional "scope" to a function. For example (from C++) the cout and endl functions are in defined in the namespace std. So, say you are writing a program in which you have your own function called cout. To let the compiler know which cout you are talking about, you can use std::cout (which itendifies the namespace std). This lets the compiler know that at that point in the program, you want to reference the cout function defined in the namespace std. I always think of namespaces as another "container" for grouping functions. I know this might make hard-core OOP programmers cringe, but I have found that looking at it this way has avoided me confustion. Feel free to correct as appropriate :) > > yep this is cool i've already tested it out and it works , but what is the > whole point of private and protected again ? i've been reading the java > intro on the sun site and it goes into detail about it Private and protected are access/scope modifiers in OOP that provide for the encapsulation of objects. Generally, private members are only accessable by members of their class, and protected members are inherited by child classes. That's the q&d way of explaining it. Any good OOP reference (like the java reference you mentioned) will give you more information on the topic. [ snip ] > wots the point of this ? http://ny1.php.net/talks/show.php/php5intro/28 > If you don't get the humor, I would point to your friendly art museum guide. If you don't get the OOP ... An abstract class is one that defines functions that other classes inherit. Think of it as a "parts bin" class, from which you borrow bits to plug into other classes. I would suggest picking up a good OOP reference to find out more about inheritence, scope, etc. > ahh my brain hurts i got lost after this but i am so excited , i have 5 > running i should start doing some OO experiments. > Soon, so shall I. [ snip ] -- Burhan Khalid phplist[at]meidomus[dot]com Please trim your posts, and add a reply-to header that points to the list so that when someone replies, it goes to the list. Don't know why the list doesn't default to this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php/mysql group by headache
preface: have RTM on mysql GROUP BY I have a mysql db with a number of entries... table| id | name | info | version 1 x foo1 2 x foob 2 3 x foobar 3 my sql is similar to "select id,name,info from table GROUP BY name order by name,version desc" in an effort to only return one result of type (x), but get the most recent info (foobar) and version (3), however this isn't the case. GROUP BY returns the first info and version it comes across. Has anyone run across this issue, or know of a solution? Thanks. -- Michael Geier <[EMAIL PROTECTED]> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php/mysql group by headache
> preface: have RTM on mysql GROUP BY > > I have a mysql db with a number of entries... >table| id | name | info | version > 1 x foo1 > 2 x foob 2 > 3 x foobar 3 > > my sql is similar to > "select id,name,info from table GROUP BY name order by name,version >desc" > > in an effort to only return one result of type (x), but get the most > recent info (foobar) and version (3), however this isn't the case. > GROUP BY returns the first info and version it comes across. > > Has anyone run across this issue, or know of a solution? Thanks. Not sure what this has to do with PHP, but... I know you RTM, but here's a link from it you probably haven't read that should solve your problem: http://www.mysql.com/doc/en/example-Maximum-column-group-row.html ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
re: [PHP] PHP Rounting Time
Jay Fitzgerald wrote: > I apologize in advance for my constant nub questions.. > > How can I round the current time up or down to the nearest 1/2 hour? > > eg: > timeranges: > > 0900 through 0915 == 0900 > 0916 through 0930 == 0930 > 0931 through 0945 == 0930 > 0946 through 1000 == 1000 > > I'm sure there's a better way to do this, but : $time = {any range} if (substr($time,2,1) > 3) { $time = "0".substr($time,0,1)+1."00"; } else { $time = "0".substr($time,0,1)."00"; } Untested -- Burhan Khalid phplist[at]meidomus[dot]com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Rounding Time
I haven't quite thought this through, but I think something like this: $remainder = $ts % 60; if( $remainder < 15 ) { $ts = $ts - $remainder; }else if( $remainder > 15 && $remainder < 30 ) { $ts = $ts + (30 - $remainder); }else if( $remainder > 30 && $remainder < 45 ) { $ts = $ts - ($remainder - 30); }else if( $remainder >= 45 ) { $ts = $ts + (60 - $remainder); } something close to that I think... On Fri, 4 Apr 2003, Jay Fitzgerald wrote: > I apologize in advance for my constant nub questions.. > > How can I round the current time up or down to the nearest 1/2 hour? > > eg: > timeranges: > > 0900 through 0915 == 0900 > 0916 through 0930 == 0930 > 0931 through 0945 == 0930 > 0946 through 1000 == 1000 > > > Jay Fitzgerald, Design Director > Bayou Internet - http://www.bayou.com > Toll Free: 888.30.BAYOU (22968) > Vox: 318.338.2034 / Fax: 318.338.2506 > E-Mail: [EMAIL PROTECTED] > ICQ: 38823829 / AIM: bayoujf / MSN: bayoujf / Yahoo: bayoujf > > > > -- > 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