[PHP] Using PHP with Style Sheets
I just learned that you can even use PHP on style sheets. Can anyone here tell me how to set it up? I found a page at http://www.webdeveloper.co.nz/forum/topic/50 that apparently cites two different methods. The first is to put a php heading at the top of a style sheet, then alter a document so that your server will recognize the style sheet as a php page. But someone else said all you have to do is change the page's extension from .css to .php. I tried that, but it didn't work for me. Are you aware of any good tutorials on using PHP with style sheets? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using PHP with Style Sheets
Freedomware wrote: I just learned that you can even use PHP on style sheets. Can anyone here tell me how to set it up? I found a page at http://www.webdeveloper.co.nz/forum/topic/50 that apparently cites two different methods. The first is to put a php heading at the top of a style sheet, then alter a document so that your server will recognize the style sheet as a php page. But someone else said all you have to do is change the page's extension from .css to .php. I tried that, but it didn't work for me. Are you aware of any good tutorials on using PHP with style sheets? Thanks. If you want PHP to parse your *.css files, you need to tell your webserver software to do so. In Apache AddType application/x-httpd-php .php .css -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using PHP with Style Sheets
Hello Freedomware, Monday, January 19, 2004, 7:18:10 AM, you wrote: F I just learned that you can even use PHP on style sheets. Can anyone F here tell me how to set it up? F Are you aware of any good tutorials on using PHP with style sheets? Sorry but you haven't really stumbled onto a pot of gold here or anything. One of the methods listed just adds CSS to the PHP parsed file list (which probably isn't the most smartest idea in the world) and the other renames a CSS file to PHP - I'm dubious that you even need to bother outputting the header, but haven't ever tried it to know. Neither are exactly revolutionary and I'll doubt you'll find any tutorials on it because it's not really doing anything unique/new. PHP is a server-side language. If you use it to output some CSS then by all means feel free. Others us it to output JavaScript/HTML/Java Applet Parameters/PDF files and all kinds. -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] odd error with if !(cond){}
Hello im hoping someone might have an insight into this one im getting an odd error when I use a not condition in an if statement The code is as follows: if !(isset($_REQUEST[license])) { $license = off; } The error I am receiving is: Parse error: parse error, unexpected '!', expecting '(' in c:\inetpub\wwwroot\php\car.php on line 9 To avoid the error im simply using a script that doesnt use the ! mark but the fact that using an ! in this position is occuring is worrying.. Has anyone else encountered this? Regards Tristan Gutsche -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using PHP with Style Sheets
Sorry but you haven't really stumbled onto a pot of gold here or anything. Hmmm... it sounds like using PHP with style sheets isn't a recommended practice. John Nichel wrote: If you want PHP to parse your *.css files, you need to tell your webserver software to do so. In Apache AddType application/x-httpd-php .php .css But I'd like to give it a try. Thanks for the tips. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] odd error with if !(cond){}
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tristan Gutsche wrote: | Hello im hoping someone might have an insight into this one im getting an | odd error when I use a not condition in an if statement | | The code is as follows: | if !(isset($_REQUEST[license])) | { | $license = off; | } | | The error I am receiving is: | | Parse error: parse error, unexpected '!', expecting '(' in | c:\inetpub\wwwroot\php\car.php on line 9 | | To avoid the error im simply using a script that doesnt use the ! mark but | the fact that using an ! in this position is occuring is worrying.. Has | anyone else encountered this? Do if(!isset($_REQUEST[license])) - -- ** * ____ _ * * ___/ /__ ___ / /_(_)__ ___ __ __ ___ __ _ * * / _ / -_)_-/ __/ / _ \/ -_) // // __/ _ \/ ' \ * * \_,_/\__/___/\__/_/_//_/\__/\_, (_)__/\___/_/_/_/ * *(___/ [EMAIL PROTECTED] * ** BOFH Excuse #444: overflow error in /dev/null -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFAC5IHoAq8t3CabwcRAqKoAJ0RfFIBJJnWREgY9PUViRj8wlrcmwCgpN8d AZdz70SMYVJnNd9/C/o/KFQ= =b7NS -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to search the database?
Hello.. I made my Login and registration pages and everything is okay.. but what I want now is to know how to make this : A PHP page for the administrator.. that has a TextBox (UserName).. he will enter a user name in it.. after that he will press the button (Activate).. Now by pressing that button the PHP page will search the database (A specified table) for that username, if it is exist then search his row for a field named (Activation) and then update its value into Activated.. but if this user is not exist in that table.. a message will apear for the administrator.. Waiting your replies guys ;-) Thanks in advance... Cheers..
Re: [PHP] how to check the form filled all
Hi, Thursday, January 15, 2004, 7:33:29 PM, you wrote: SH HI, i want to check if the user filled the all inputs in the form. So, I SH checked NULL and with this function in the post receiving script. SH --- SH function is_filled_out() SH { SH // test that each variabl has a value SH foreach($_POST as $key = $value) SH { SH if(is_null($value) || $value=) SHreturn false; SH } SH return true; SH } SH - SH but when I submit the form without putting any value, it returns 'true'. SH what's wrong with my code? try if(empty($val)) -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using PHP with Style Sheets
Freedomware wrote: Sorry but you haven't really stumbled onto a pot of gold here or anything. Hmmm... it sounds like using PHP with style sheets isn't a recommended practice. I wouldn't do it unless I had a good reason to do it. The reason that's cited on the page you referred to is to have different code in Netscape 4 and real browsers. So if you have a real need to make pages pages to look gorgeous in Netscape 4, you might consider it. Or if you want to do pathologically ;-) advanced and flexible things with styles. Plain CSS is flexible enough for me most of the time, but it's a good idea to learn it properly. John Nichel wrote: If you want PHP to parse your *.css files, you need to tell your webserver software to do so. In Apache AddType application/x-httpd-php .php .css But I'd like to give it a try. Thanks for the tips. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to search the database?
RTFM and stop sending messages to this list with a high priority. The questions you are asking are answered in the first 3 chapters of any good book about php. toby - Original Message - From: Radwan Aladdin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, January 19, 2004 9:13 AM Subject: [PHP] How to search the database? Hello.. I made my Login and registration pages and everything is okay.. but what I want now is to know how to make this : A PHP page for the administrator.. that has a TextBox (UserName).. he will enter a user name in it.. after that he will press the button (Activate).. Now by pressing that button the PHP page will search the database (A specified table) for that username, if it is exist then search his row for a field named (Activation) and then update its value into Activated.. but if this user is not exist in that table.. a message will apear for the administrator.. Waiting your replies guys ;-) Thanks in advance... Cheers.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is this possible ?
An object-oriented way of doing it: keep the extra result in a member variable and get it separately. You might not find this necessary, but it gets more useful in more complex cases. class MyClass { var $num; Function MyFunc(){ if(isset($_POST['var'])){ $sql = mysql_query(select * from table_name where field=\$_POST[var]\ ); $this-num = mysql_num_rows($sql); $returnsomething =blah blah; } return $returnsomething; } function getCount() { return $this-num; } } Dave Carrera wrote: Hi List, I have a function that makes a call to mysql based on certain vars. ---example Function MyFunc(){ if(isset($_POST[var])){ $sql = mysql_query(select * from table_name where field=\$_POST[var]\ ); $returnsomething =blah blah; } return $returnsomething; } And that all works fine no probs here but. I want to use a result somewhere in my script that is not returned by return. Let me show you... ---example Function MyFunc(){ if(isset($_POST[var])){ $sql = mysql_query(select * from table_name where field=\$_POST[var]\ ); $num = mysql_num_rows($sql); // I want to use this result outside this function. $returnsomething =blah blah; } return $returnsomething; } So $num contains a number that I want to use outside the function which is not covered by return. I know return stops a script and returns what I want it to return but how do I send out of the function the var I want. I have tried $GLOBAL[var]=$num; but that dont work, but I thought I would'nt anyway just tried it and yes I know I have to declare it inside my new function using global $var; to use it. So I ask is this achiveable or how can I do this. Thank you in advance Dave C --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] odd error with if !(cond){}
Danke looks like its a simple case where the reference book had a Typo in it putting the ! on the outside of the bracket. Thanx for your help. Regards Tristan Greg Donald [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tristan Gutsche wrote: | Hello im hoping someone might have an insight into this one im getting an | odd error when I use a not condition in an if statement | | The code is as follows: | if !(isset($_REQUEST[license])) | { | $license = off; | } | | The error I am receiving is: | | Parse error: parse error, unexpected '!', expecting '(' in | c:\inetpub\wwwroot\php\car.php on line 9 | | To avoid the error im simply using a script that doesnt use the ! mark but | the fact that using an ! in this position is occuring is worrying.. Has | anyone else encountered this? Do if(!isset($_REQUEST[license])) - -- ** * ____ _ * * ___/ /__ ___ / /_(_)__ ___ __ __ ___ __ _ * * / _ / -_)_-/ __/ / _ \/ -_) // // __/ _ \/ ' \ * * \_,_/\__/___/\__/_/_//_/\__/\_, (_)__/\___/_/_/_/ * *(___/ [EMAIL PROTECTED] * ** BOFH Excuse #444: overflow error in /dev/null -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFAC5IHoAq8t3CabwcRAqKoAJ0RfFIBJJnWREgY9PUViRj8wlrcmwCgpN8d AZdz70SMYVJnNd9/C/o/KFQ= =b7NS -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using PHP with Style Sheets
On Monday, January 19, 2004, at 06:18 PM, Freedomware wrote: I just learned that you can even use PHP on style sheets. Can anyone here tell me how to set it up? Add this to your .htaccess file: Files ~ \.css$ ForceType application/x-httpd-php /Files Add this to the top of your CSS file: ? Then you can use it to do all sorts of stuff: --- ? header(Content-Type: text/css); include(../inc/colours.inc); ? body { background-color: #?=$col[1]?; color: #?=$col[1]?; } ? if(something) { ? p { font-size: 110%; } ? } ? /*etc etc*/ --- Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to search the database?
Hmmm, your problem sounds like a serious one but something everyone must know... I have found this site to be particularly useful http://php.net,as for some reason these guys seem to know what they are talking about. after going through the online manual (or downloading it...),...go to this site http://google.com and search for RTFM for a total solution to these kinds of problems. Cheers, -Ryan Hello.. I made my Login and registration pages and everything is okay.. but what I want now is to know how to make this : A PHP page for the administrator.. that has a TextBox (UserName).. he will enter a user name in it.. after that he will press the button (Activate).. Now by pressing that button the PHP page will search the database (A specified table) for that username, if it is exist then search his row for a field named (Activation) and then update its value into Activated.. but if this user is not exist in that table.. a message will apear for the administrator.. Waiting your replies guys ;-) Thanks in advance... Cheers.. -- 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] How to search the database?
you should try to figure parts of it out before just asking. By us just giving you the answer means that you aren't going to learn anything. TRy and battle but when you get it working you will feel as if you've accomplished something rather than cut and paste someone else's code!! -Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: Monday, January 19, 2004 12:27 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] How to search the database? Hmmm, your problem sounds like a serious one but something everyone must know... I have found this site to be particularly useful http://php.net,as for some reason these guys seem to know what they are talking about. after going through the online manual (or downloading it...),...go to this site http://google.com and search for RTFM for a total solution to these kinds of problems. Cheers, -Ryan Hello.. I made my Login and registration pages and everything is okay.. but what I want now is to know how to make this : A PHP page for the administrator.. that has a TextBox (UserName).. he will enter a user name in it.. after that he will press the button (Activate).. Now by pressing that button the PHP page will search the database (A specified table) for that username, if it is exist then search his row for a field named (Activation) and then update its value into Activated.. but if this user is not exist in that table.. a message will apear for the administrator.. Waiting your replies guys ;-) Thanks in advance... Cheers.. -- 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 Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Technikon or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] date fiedl
Does anyone know if there is any speed advantage to saving a date as a unix timestamp or a numeric field instead of a date field? (in Mysql) thanks, -- -- Diana Castillo Global Reservas, S.L. C/Granvia 22 dcdo 4-dcha 28013 Madrid-Spain Tel : 00-34-913604039 Fax : 00-34-915228673 email: [EMAIL PROTECTED] Web : http://www.hotelkey.com http://www.destinia.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 19 Jan 2004 11:02:54 -0000 Issue 2539
php-general Digest 19 Jan 2004 11:02:54 - Issue 2539 Topics (messages 174981 through 175009): Re: Using lists over newsgroup, Problem 174981 by: Luke Re: Error Reporting help 174982 by: Chris Edwards 174984 by: Luke 174993 by: Jason Wong Re: recompiling php 174983 by: Brian V Bonini Report Server 174985 by: daniel.electroteque.org how to check the form filled all 174986 by: Sungpill Han 175001 by: Tom Rogers execute php script with crontab 174987 by: rudi 174988 by: Robert Cummings 174989 by: Jason Wong 174992 by: rudi Re: Pdfs getting corrupted during upload 174990 by: Binay Re: POST method for hyperlink 174991 by: Chris Shiflett Using PHP with Style Sheets 174994 by: Freedomware 174995 by: John Nichel 174996 by: Richard Davey 174998 by: Freedomware 175002 by: Dagfinn Reiersøl 175006 by: Justin French odd error with if !(cond){} 174997 by: Tristan Gutsche 174999 by: Greg Donald 175005 by: Tristan Gutsche How to search the database? 175000 by: Radwan Aladdin 175003 by: Toby Irmer 175007 by: Ryan A 175008 by: Angelo Zanetti Re: Is this possible ? 175004 by: Dagfinn Reiersøl date fiedl 175009 by: Diana Castillo Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- I'm successfully using Outlook Express news client to view messages and post messages, but i do get postmaster reply emails sometimes saying message sending expired, even though they show up and obviously worked as i can get replys -- Luke Siamak [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I have done whatever I could to send messages to newsgroups but messages do not appear in the list (I think server ignores them). I have set a valid email and I am using XanaNews client. I really hate to receive huge amounts of emails in my box from listserver (as I am forced now). Any solution? Mac __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus ---End Message--- ---BeginMessage--- Tried that, thanks, no joy. It's almost like it parses it before it tries to execute any lines and if a syntax error occurs, it doesn't execute any of the script. The prior version would run up until the syntax error and then give you the line if error, which usually meant the syntax error was on the previous line. Adam I Agnieszka Gasiorowski Fnord [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Chris Edwards wrote: [cut] For example if I code echo This is a syntax error because of the double quote start and the single quote end '; I just get a blank screen. I have 14 pages of PHP settings printed out, so for any kind person that can help, I can respond with their values quickly. Try putting this at the beginning of your script: ini_set('display_errors', 1); -- Seks, seksiæ, seksolatki... news:pl.soc.seks.moderowana http://hyperreal.info { iWanToDie } WiNoNa) ( http://szatanowskie-ladacznice.0-700.pl foReVeR( * ) Poznaj jej zwiewne kszta³ty... http://www.opera.com 007 ---End Message--- ---BeginMessage--- Are you using output buffering? that will stop it from being displayed (it does on mine, if thre is an error and output buffering, nothing at all shows up) So try turning output buffering off, or at the beggining somewhere put while(@ob_end_flush); -- Luke Chris Edwards [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] My hosting company recently upgraded to PHP 4.3.0. Since doing this I no longer get syntax type errors, from my typo's inside my PHP scripts. These use to come up in my browser when that page was requested and the script run. I have spent hours going through the online help, trying to set a number of the error reporting levels and parameters but cannot get to where it will report on a syntax error. For example if I code echo This is a syntax error because of the double quote start and the single quote end '; I just get a blank screen. I have 14 pages of PHP settings printed out, so for any kind person that can help, I can respond with their values quickly. Thanks Chris Edwards ---End Message--- ---BeginMessage--- On Monday 19 January 2004 07:30, Chris Edwards wrote: It's almost like it parses it before it tries to execute any lines and if a syntax error occurs, it doesn't execute any of the script. That's right. The prior version would run up until the syntax error and then give you the line if error, which usually meant the syntax error was
Re: [PHP] How to search the database?
I did a search and I found my request :) Notice : I'm sorry I didn't tell you anything about me and my brother.. So I attached with this message our CVs.. hope you will know that I'm at 9th class at school :) That why I ask very much :) Regards.. - Original Message - From: Radwan Aladdin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, January 19, 2004 3:08 PM Subject: Re: [PHP] How to search the database? I did a search and I found my request :) Notice : I'm sorry I didn't tell you anything about me and my brother.. So I attached with this message our CVs.. hope you will know that I'm at 9th class at school :) That why I ask very much :) Regards and thanks alot for your powerful help.. - Original Message - From: Angelo Zanetti [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Sent: Monday, January 19, 2004 2:38 PM Subject: RE: [PHP] How to search the database? you should try to figure parts of it out before just asking. By us just giving you the answer means that you aren't going to learn anything. TRy and battle but when you get it working you will feel as if you've accomplished something rather than cut and paste someone else's code!! -Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: Monday, January 19, 2004 12:27 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] How to search the database? Hmmm, your problem sounds like a serious one but something everyone must know... I have found this site to be particularly useful http://php.net,as for some reason these guys seem to know what they are talking about. after going through the online manual (or downloading it...),...go to this site http://google.com and search for RTFM for a total solution to these kinds of problems. Cheers, -Ryan Hello.. I made my Login and registration pages and everything is okay.. but what I want now is to know how to make this : A PHP page for the administrator.. that has a TextBox (UserName).. he will enter a user name in it.. after that he will press the button (Activate).. Now by pressing that button the PHP page will search the database (A specified table) for that username, if it is exist then search his row for a field named (Activation) and then update its value into Activated.. but if this user is not exist in that table.. a message will apear for the administrator.. Waiting your replies guys ;-) Thanks in advance... Cheers.. -- 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 Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Technikon or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- 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] unsupported operand types
why do I get this error? Fatal error: Unsupported operand types in c:\program files\apache group\apache\htdocs\web\usr\local\global\php\providers\interfaces\TouricoTes tInterface.php on line 827 the code is as follows: $price=0; foreach ($price_data as $price) { $room_price=$price-getAttribute(value); $price=$price+$room_price; -- -- Diana Castillo Global Reservas, S.L. C/Granvia 22 dcdo 4-dcha 28013 Madrid-Spain Tel : 00-34-913604039 Fax : 00-34-915228673 email: [EMAIL PROTECTED] Web : http://www.hotelkey.com http://www.destinia.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
FW: [PHP] date fiedl
I have a feeling that saving it as a numeric field would be quicker. Numeric fields are generally quicker than alphanumeric fields and the date field in mySQL has the format of -mm-dd, so it probably does some error checking/validation to see the format is correct and also it contains alphanumeric characters being -'s. The best way to probably find out is to select a large amount of records in both formats and see which is quicker. hth -Original Message- From: Diana Castillo [mailto:[EMAIL PROTECTED] Sent: Monday, January 19, 2004 1:02 PM To: [EMAIL PROTECTED] Subject: [PHP] date fiedl Does anyone know if there is any speed advantage to saving a date as a unix timestamp or a numeric field instead of a date field? (in Mysql) thanks, -- -- Diana Castillo Global Reservas, S.L. C/Granvia 22 dcdo 4-dcha 28013 Madrid-Spain Tel : 00-34-913604039 Fax : 00-34-915228673 email: [EMAIL PROTECTED] Web : http://www.hotelkey.com http://www.destinia.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Technikon or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] execute php script with crontab
Could I add a question regarding the cron command? If you automatically run a php script through the cron command is timeout taken under account or does it run through the command line which is faster (and timeout is not taken under account?) Thanks all Mario - Original Message - From: rudi [EMAIL PROTECTED] To: Jason Wong [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, January 19, 2004 7:29 AM Subject: Re: [PHP] execute php script with crontab Ok, thanks i will check it first. soon i will send mail about it. Jason Wong [EMAIL PROTECTED] wrote:On Monday 19 January 2004 12:01, rudi wrote: 01 * * * * root run-parts /usr/bin/php /var/www/html/cron/testcron.php I believe 'run-parts' takes a directory as argument. Try: 1 * * * * root /usr/bin/php /var/www/html/cron/testcron.php Also if you have: #!/usr/bin/php as the first line in testcron.php (and make it executable) then you can use simply: 1 * * * * /var/www/html/cron/testcron.php -- 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 -- /* However the modem comes set from the factory, it will be the WRONG way to work on your machine -- Murphy's Laws of BBS'ing n3 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php - Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error Reporting help
Thanks for all you replies, most of what you have suggested, I had already tried, in vain, before joining the list. I retried most of the combinations and still cannot get it to report syntax errors. If I have errors, from say undefined variables, the error handler catches those just fine. Question: when I use the ini_set, does that stay set for the lifetime of the script executing or is it set for good? The reason I ask, is I wonder if the permissions on the 'Ini file is blocking me from modifying it. All help is much appreciated. Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Monday 19 January 2004 07:30, Chris Edwards wrote: It's almost like it parses it before it tries to execute any lines and if a syntax error occurs, it doesn't execute any of the script. That's right. The prior version would run up until the syntax error and then give you the line if error, which usually meant the syntax error was on the previous line. I don't think any version of PHP has ever done that. More likely your prior version of PHP had display_errors enabled. In general you can enable and display all errors using: error_reporting (E_ALL); ini_set('display_errors', 1); But if display_errors (in php.ini) is disabled then syntax errors will not be displayed -- they can only be viewed in the error log. -- 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 -- /* Most people will listen to your unreasonable demands, if you'll consider their unacceptable offer. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unsupported operand types
Diana Castillo wrote: why do I get this error? Fatal error: Unsupported operand types in c:\program files\apache group\apache\htdocs\web\usr\local\global\php\providers\interfaces\TouricoTes tInterface.php on line 827 the code is as follows: $price=0; Here $price is an integer. foreach ($price_data as $price) { $room_price=$price-getAttribute(value); You can only use - with an object, not an integer $price=$price+$room_price; -- -- Diana Castillo Global Reservas, S.L. C/Granvia 22 dcdo 4-dcha 28013 Madrid-Spain Tel : 00-34-913604039 Fax : 00-34-915228673 email: [EMAIL PROTECTED] Web : http://www.hotelkey.com http://www.destinia.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Adding Text to .txt file
Hello, I've lost the name of the function I found in php.net some time ago. This function was able to write the text line at the end of the text file. Can you tell me the name of this function? Lab. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Adding Text to .txt file
[snip] I've lost the name of the function I found in php.net some time ago. This function was able to write the text line at the end of the text file. Can you tell me the name of this function? [/snip] http://www.php.net/fopen fopen(myFile.txt, a); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Adding Text to .txt file
And this function was differs from fopen(myFile.txt, a); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Adding Text to .txt file
[snip] And this function was differs from fopen(myFile.txt, a); [/snip] Ah well, that would leave me ignorant then. Sorry to have barfed up your day with bad information. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using PHP with Style Sheets
On Mon, 2004-01-19 at 02:18, Freedomware wrote: I just learned that you can even use PHP on style sheets. Can anyone here tell me how to set it up? I found a page at http://www.webdeveloper.co.nz/forum/topic/50 that apparently cites two different methods. The first is to put a php heading at the top of a style sheet, then alter a document so that your server will recognize the style sheet as a php page. But someone else said all you have to do is change the page's extension from .css to .php. I tried that, but it didn't work for me. Are you aware of any good tutorials on using PHP with style sheets? Just name you style sheet with a php extension. site.css.php and put a Content type header at the top of you style sheet. header(Content-type: text/css ); Then call the style sheet in one of the usual methods, link rel or @import -- BrianGnuPG - KeyID: 0x04A4F0DC | URL: www.gfx-design.com/keys Key Server: pgp.mit.edu == gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC GnuPG: http://gnupg.org http://www.biglumber.com/x/web?qs=0x2C35011004A4F0DC Linux Registered User #339825 at http://counter.li.org signature.asc Description: This is a digitally signed message part
[PHP] Debug code
Good morning! Is there any way to keep the compiler from adding 'debug code'? Example: if ($b_debug) { echo ... } Just trying to eliminate code bloat. Robin 'Sparky' Kopetzky Black Mesa Computers/Internet Service Grants, NM 87020 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Debug code
[snip] Is there any way to keep the compiler from adding 'debug code'? Example: if ($b_debug) { echo ... } Just trying to eliminate code bloat. [/snip] Which 'compiler' added debug code? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Debug code
Aye, PHP is compiled by the executable, nothing else- what are you using? - Original Message - From: Robin Kopetzky To: PHP General Sent: Monday, January 19, 2004 10:32 AM Subject: [PHP] Debug code Good morning! Is there any way to keep the compiler from adding 'debug code'? Example: if ($b_debug) { echo ... } Just trying to eliminate code bloat. Robin 'Sparky' Kopetzky Black Mesa Computers/Internet Service Grants, NM 87020 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Debug code
[snip] Well, I guess I mean the php 'interpreter'. [/snip] You mean that the 'interpreter' or 'compiler' adds code to your code? Are you by some chance using Dreamweaver? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Debug code
[snip] If PHP is interpreted, then the debug code is always there. If it's compiled, you 'should' be able to remove it with a pre-processor. Does PHP have a pre-processor or am I stuck with the bloated code? [/snip] Are you working with PHP source code? What are you doing Sparky? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Debug code
[snip] I have a large PHP application that has a ton of statements like the first email for catching problems. I would like to 'automatically' remove them before I ship the code to eliminate the extra size. I can do it in C, C++, VB but I don't know if it can be done in PHP. [/snip] Whoever created the code added the debug statements. PHP is interpreted by the Zend/PHP engine and therefore does not have a preprocessor. If you wish to remove said code you must do it by hand. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Variables not working!
Hi, I am new to PHP scripting and struggling with the following problem. I have two files, an HTML file and a PHP file. HTML file contains a form with one text field and a submit button. When a user pressed the submit button, it calls the php file (form action=test.php ...). What the php file does is just echo back the text received from html file to the user again. Name of the text field is 'fname'. When I used this variable in the php file (as $fname) it does not contain the value of the text field. Query-string appended to the url during the submission is also correct. I checked for all syntax errors, but the codings are perfect. Do I have to change php.ini file to fix this problem. Could anyone can help me to solve this problem. Kaushan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Variables not working!
Try using $_POST['fname'] instead of $fname. This just means that register_globals is probably set to off in php.ini, which is the recommended setting. Take a look at the section on predefined variables in the PHP manual for more on this: http://www.php.net/manual/en/language.variables.predefined.php -Ben Kaushan wrote: Hi, I am new to PHP scripting and struggling with the following problem. I have two files, an HTML file and a PHP file. HTML file contains a form with one text field and a submit button. When a user pressed the submit button, it calls the php file (form action=test.php ...). What the php file does is just echo back the text received from html file to the user again. Name of the text field is 'fname'. When I used this variable in the php file (as $fname) it does not contain the value of the text field. Query-string appended to the url during the submission is also correct. I checked for all syntax errors, but the codings are perfect. Do I have to change php.ini file to fix this problem. Could anyone can help me to solve this problem. Kaushan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Variables not working!
[snip] Try using $_POST['fname'] instead of $fname. [/snip] Or $_GET['fname'] depending on your form method -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] v
v -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Variables not working!
[snip] Try using $_POST['fname'] instead of $fname. [/snip] Or $_GET['fname'] depending on your form method Or even $_REQUEST['fname'], which doesn't care about which method is specified in the form. :p Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [Fwd: Delivery Report (failure) for php-general@lists.php.net]
What the heck does this mean? I've been receiving a ton of these even though I haven't sent many messages to the list. -Ben ---BeginMessage--- This report relates to your message: Subject: [PHP] Re: dynamic array creation from form elements, Message-ID: [EMAIL PROTECTED], To: [EMAIL PROTECTED], Jon Bennett [EMAIL PROTECTED] of Mon, 19 Jan 2004 15:42:40 + Your message was not delivered to: [EMAIL PROTECTED] for the following reason: Diagnostic was Unable to transfer, Message timed out Information Message timed out The Original Message follows: Reporting-MTA: x400; mta dswu232-hme1 in /ADMD= /C=WW/ Arrival-Date: Fri, 16 Jan 2004 15:41:01 + DSN-Gateway: dns; dswu232.btconnect.com X400-Conversion-Date: Mon, 19 Jan 2004 15:42:58 + X400-Content-Correlator: Subject: [PHP] Re: dynamic array creation from form elements, Message-ID: [EMAIL PROTECTED], To: [EMAIL PROTECTED], Jon Bennett [EMAIL PROTECTED] Original-Envelope-Id: [/ADMD= /C=WW/;[EMAIL PROTECTED]] X400-Content-Identifier: (091)PHP(093)... X400-Encoded-Info: ia5-text Original-Recipient: rfc822; [EMAIL PROTECTED] Final-Recipient: x400; /RFC-822=php-general(a)lists.php.net/ADMD= /C=WW/ Action: failed Status: 4.4.7 Diagnostic-Code: Reason 1 (Unable-To-Transfer); Diagnostic 5 (Maximum-Time-Expired) X400-Supplementary-Info: Message timed out X400-Originally-Specified-Recipient-Number: 1 X400-Last-Trace: Fri, 16 Jan 2004 15:41:01 + Received: from gateway.btopenworld.com (actually host 185.136.40.217.in-addr.arpa) by dswu232 with SMTP-CUST (XT-PP) with ESMTP; Fri, 16 Jan 2004 15:41:00 + Received: from gateway (127.0.0.1) by gateway.btopenworld.com (Worldmail 1.3.167); 16 Jan 2004 15:50:34 + Delivery-Date: Fri, 16 Jan 2004 15:42:17 + Received: from pb1.pair.com (actually host 4.131.92.216.in-addr.arpa) by dswu83 with SMTP (XT-PP); Fri, 16 Jan 2004 15:42:15 + Received: (qmail 72706 invoked by uid 1010); 16 Jan 2004 15:38:54 - Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:[EMAIL PROTECTED] Delivered-To: mailing list [EMAIL PROTECTED] Received: (qmail 72692 invoked by uid 1010); 16 Jan 2004 15:38:54 - Delivered-To: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED], Jon Bennett [EMAIL PROTECTED] Message-ID: [EMAIL PROTECTED] Date: Fri, 16 Jan 2004 10:38:49 -0500 From: Ben Ramsey [EMAIL PROTECTED] User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 References: [EMAIL PROTECTED] In-Reply-To: [EMAIL PROTECTED] Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 24.53.104.43 Subject: [PHP] Re: dynamic array creation from form elements ---End Message--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [Fwd: Delivery Report (failure) for php-general@lists.php.net]
As have I. -Original Message- From: Ben Ramsey [mailto:[EMAIL PROTECTED] Sent: Monday, January 19, 2004 10:59 AM To: [EMAIL PROTECTED] Subject: [PHP] [Fwd: Delivery Report (failure) for [EMAIL PROTECTED] What the heck does this mean? I've been receiving a ton of these even though I haven't sent many messages to the list. -Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [Fwd: Delivery Report (failure) for php-general@lists.php.net]
[snip] What the heck does this mean? I've been receiving a ton of these even though I haven't sent many messages to the list. [/snip] Someone's e-mail address in the list is bad. The list will keep trying to send the e-mail until it reaches a certain failure limit. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] libphp_common430 is in conflit with php-4.3.1-11mdk
Please, I´m trying to compile PHP so it´s reporting an error: Is anyone knows to solve this ? thanks any help I´m using: php-ini-4.3.0-1mdk mod_php-4.3.1-1mdk php-readline-4.3.0-1mdk php-domxml-4.3.0-2mdk php-xslt-4.3.0-3mdk php-manual-en-4.3.0-2mdk libphp_common430-430-11mdk php-gd-4.3.0-2mdk php-tclink-4.3.0_3.3.1-12mdk php-cli-4.3.1-11mdk php-cgi-4.3.1-11mdk php-mysql-4.3.0-2mdk phpgroupware-0.9.14-2mdk php-xmlrpc-4.3.0-2mdk php430-devel-430-11mdk apache2-mod_php-2.0.44_4.3.1-2mdk php-rrdtool-1.0.40-2mdk php-xml-4.3.0-2mdk -- Luiz Gustavo Sarubi Macchi [EMAIL PROTECTED] Emar Plasticos Ltda -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using PHP with Style Sheets
OK, it looks like there are at least three ways to do this. I now have an original style sheet with a .css extension and copies with .php and .css.php extensions. All three style sheets have the following code at the top: ? header(Content-Type: text/css); ? For the original style sheet, I pasted the following text into a .htaccess file: Files ~ \.css$ ForceType application/x-httpd-php /Files I haven't worked with .htaccess files before. I found one in a folder at C:/xampp/webdav/, but it sounds to me like this is something that has to be uploaded with your website, so I made a new .htaccess file with Notepad and pasted it right next to my home page. I haven't checked to see if PHP is working with any of these strategies yet, but my regular styles are still working, with the following caveats: A few styles were apparently knocked out of commision on the original style sheet - the one with the .css extension. Specifically, the appear to have lost the font-families assigned to them; they display as plain text, rather than Arial. One is on the main page, and the other two are on separate PHP includes. I suspect the problem might just be a bug with Dreamweaver; my style sheets act up every now and then. Everything looks fine with the other two style sheets, but they remove the color coding from my style sheet, except for the PHP heading at the top. That's probably not a really big deal, but it would be nice to preserve the color codes. Now I'll give all three pages a test run, after I think up a PHP function to use in them. Thanks for all the tips! Brian V Bonini wrote: Just name you style sheet with a php extension. site.css.php and put a Content type header at the top of you style sheet. header(Content-type: text/css ); Then call the style sheet in one of the usual methods, link rel or @import On Monday, January 19, 2004, at 06:18 PM, Justin wrote: Add this to your .htaccess file: Files ~ \.css$ ForceType application/x-httpd-php /Files Add this to the top of your CSS file: ? Then you can use it to do all sorts of stuff: --- ? header(Content-Type: text/css); include(../inc/colours.inc); ? body { background-color: #?=$col[1]?; color: #?=$col[1]?; } ? if(something) { ? p { font-size: 110%; } ? } ? /*etc etc*/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with preg_replace
Hi I am having some problems with preg_replace and I wondering if someone could suggest a fix or explain why it is not working. Here is the Code: * ?php $code = blah http://www.foo.com/Unsubscribe.php?EmailAddress=[MAIL] blah; $url = 'http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL]'; echo BEFORE : $codebrbr; $replace = Foo; $code = preg_replace($url,$replace,$code,1); echo AFTER: $codebr; ? ** Here is the results of the script: ** BEFORE : blah http://www.qxlmaxbid.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL] blah AFTER: blah http://www.qxlmaxbid.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL] blah ** It should give the following result: ** AFTER: blah Foo blah ** Thanks for your help Regards John Clegg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with preg_replace
On Mon, Jan 19, 2004 at 06:50:37PM +0200, John Clegg wrote: Hi I am having some problems with preg_replace and I wondering if someone could suggest a fix or explain why it is not working. Here is the Code: * ?php $code = blah http://www.foo.com/Unsubscribe.php?EmailAddress=[MAIL] blah; $url = 'http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL]'; echo BEFORE : $codebrbr; $replace = Foo; $code = preg_replace($url,$replace,$code,1); echo AFTER: $codebr; ? ** Here is the results of the script: ** BEFORE : blah http://www.qxlmaxbid.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL] blah AFTER: blah http://www.qxlmaxbid.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL] blah ** It should give the following result: ** AFTER: blah Foo blah ** preg_replace expects the first argument to be a pattern, which should be enclosed in forward slashes (//). So your $url variable should be surrounded with slashes. You have single quotes in your $url variable, but I don't think that PHP behaves like perl in letting you use whichever delimiter you choose. Try replacing the single quotes with forward slashes. Additionally, if you're only doing a simple string substitution, you should use str_replace instead: http://php.net/str_replace You won't need the / delimiters, and it will be faster than using preg_replace. joel -- [ joel boonstra | gospelcom.net ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using PHP with Style Sheets
Freedomware wrote: OK, it looks like there are at least three ways to do this. I now have an original style sheet with a .css extension and copies with .php and .css.php extensions. All three style sheets have the following code at the top: ? header(Content-Type: text/css); ? I would think that the above is going to cause problems. First, if you have something like this... html head titleMy Page/title ?php include ( style.php ); ? /head and style.php has the header call in it, you're going to get an error. Second, I don't know how much differently the browsers handle text/html and text/css, but being that the header has to be sent before any output to the browser, you will have changed the mime type of the whole document. Course, I could be wrong on all pointsit's been known to happen before. ;) -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with preg_replace
John Clegg wrote: Hi I am having some problems with preg_replace and I wondering if someone could suggest a fix or explain why it is not working. Here is the Code: * ?php $code = blah http://www.foo.com/Unsubscribe.php?EmailAddress=[MAIL] blah; $url = 'http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL]'; echo BEFORE : $codebrbr; $replace = Foo; $code = preg_replace($url,$replace,$code,1); echo AFTER: $codebr; ? ** Here is the results of the script: ** BEFORE : blah http://www.qxlmaxbid.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL] blah AFTER: blah http://www.qxlmaxbid.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL] blah ** It should give the following result: ** AFTER: blah Foo blah ** $url = /http:\/\/www.foo.com\/maxbid\/Unsubscribe.php?EmailAddress=\[MAIL\]/; Will replace http://www.foo.com/Unsubscribe.php?EmailAddress=[MAIL] only. If you're looking to replace any URL, you need a regular expression. The first argument to preg_replace is the pattern you're looking for, so you need to enclose it in slashes ( /pattern/ ), and escape out any special characters. -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using PHP with Style Sheets
On Mon, Jan 19, 2004 at 11:08:29AM -0600, John Nichel wrote: Freedomware wrote: OK, it looks like there are at least three ways to do this. I now have an original style sheet with a .css extension and copies with .php and .css.php extensions. All three style sheets have the following code at the top: ? header(Content-Type: text/css); ? I would think that the above is going to cause problems. First, if you have something like this... html head titleMy Page/title ?php include ( style.php ); ? /head and style.php has the header call in it, you're going to get an error. Second, I don't know how much differently the browsers handle text/html and text/css, but being that the header has to be sent before any output to the browser, you will have changed the mime type of the whole document. I'm guessing that the .css file will be used in the traditional way: html head titleMy Page/title style type=text/css href=path/to/stylesheet.css / /head Now, it's the browser that's fetching the .css file, so the header() call isn't a problem at all. The browser simply performs a separate request for that file, so its header() information is sent in response to that request. joel -- [ joel boonstra | gospelcom.net ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Trying again: Random(?) blank pages when using sessions
No, it's running on a FreeBSD server. I don't suppose it could have to do with the firewall or browser security settings on my machine, though ... could it? I can verify that the session file is being written to the server's tmp directory... I'm stumped. -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Matt, You're not by any chance using an Apache server on a machine that also has a firewall, are you? I've had all sorts of mysterious session-related problems when running scripts on my test server (Apache on Win2k with a ZoneAlarm firewall). Took me *ages* to zero in on the source of the problem. Now whenever I need to test a script that involves sessions, I simply disconnect from the internet and shut down my firewall. Cheers, Erik On 16 Jan 2004 at 16:32, Matt Grimm wrote: Can anyone think of ways I can troubleshoot this problem? I still haven't found a solution. I'm using non-cookie-based sessions for authentication on a page. The session is set like so, which works (these values, along with the SID, are always retrievable): $_SESSION['user'] = $_POST['UserName']; $_SESSION['time'] = time(); My problem is when I get to the protected site area, in which a header script calls session_start() at the top (first line). Seemingly randomly, while navigating links within this area, I get blank white pages. If I comment out the session_start() line, it doesn't happen. If I spit out the session variables in the resulting page, they are echoed, but that's it -- it's a blank white page otherwise. The apache error log is silent, and the access log is normal. No php errors are displayed or written to the log. Here's the real kicker -- if I refresh the page, it loads correctly. What is going on? Thank you, -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org -- 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: libphp_common430 is in conflit with php-4.3.1-11mdk
What's the error? Luiz Gustavo Sarubi Macchi wrote: Please, I´m trying to compile PHP so it´s reporting an error: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with preg_replace
Hi Joel, Thanks for the reply. I have tried using / to delimit the string and I get the following error String $url = /http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL]/;; Gives the error: *Warning*: Unknown modifier '/' in* /test.php* on line *8* I found out that I could use ' to delimit from Example 5 in the php manual page for preg_replace. Also I need to replace only one occurance of the string at a time, so I can't use str_replace :-( . Any other suggestions?? Cheers John joel boonstra wrote: On Mon, Jan 19, 2004 at 06:50:37PM +0200, John Clegg wrote: Hi I am having some problems with preg_replace and I wondering if someone could suggest a fix or explain why it is not working. Here is the Code: * ?php $code = blah http://www.foo.com/Unsubscribe.php?EmailAddress=[MAIL] blah; $url = 'http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL]'; echo BEFORE : $codebrbr; $replace = Foo; $code = preg_replace($url,$replace,$code,1); echo AFTER: $codebr; ? ** Here is the results of the script: ** BEFORE : blah http://www.qxlmaxbid.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL] blah AFTER: blah http://www.qxlmaxbid.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL] blah ** It should give the following result: ** AFTER: blah Foo blah ** preg_replace expects the first argument to be a pattern, which should be enclosed in forward slashes (//). So your $url variable should be surrounded with slashes. You have single quotes in your $url variable, but I don't think that PHP behaves like perl in letting you use whichever delimiter you choose. Try replacing the single quotes with forward slashes. Additionally, if you're only doing a simple string substitution, you should use str_replace instead: http://php.net/str_replace You won't need the / delimiters, and it will be faster than using preg_replace. joel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is this code right?
Hi all.. I made this code for the login.php page.. it will compare A value from the users machine (Serial) and with a value inside the database (In that users' row).. so after logging it will check if also this value is the same and then echo something..is the following code is right for that? : ?php $link = mysql_connect(localhost, Database username, Database password) or die(Could not connect: . mysql_error()); mysql_select_db(Table name, $link); $UserName = $_GET['UserName']; $Password = $_GET['Password']; $Serial = $_GET['Serial']; $query = SELECT Serial, Password from accounts where UserName='$UserName'; $result = mysql_query($query) or die(Query errort: . mysql_error()); $row = mysql_fetch_row($result) or die(User Not found: . mysql_error()); $Serial = htmlspecialchars($row[0]); $UserPassword = $row[1]; $UserSerial = $row[1]; mysql_close($link); if($UserSerial == $Serial){ printEND HTML BODY Right serial! /BODY/HTML END; }else{ printEND HTML BODY Sorry, wrong serial! /BODY/HTML END; } if($UserPassword == $Password){ printEND HTML BODY Logged in successfully /BODY/HTML END; }else{ printEND HTML BODY Sorry, wrong password! /BODY/HTML END; } ? Please notice : PHP: -- $UserSerial = $row[1]; -- must I put it PHP: -- $UserSerial = $row[2]; -- or something else? Regards.. Waiting your reply..
Re: [PHP] Is this code right?
Radwan Aladdin wrote: Hi all.. I made this code for the login.php page.. it will compare A value from the users machine (Serial) and with a value inside the database (In that users' row).. so after logging it will check if also this value is the same and then echo something..is the following code is right for that? : ?php $link = mysql_connect(localhost, Database username, Database password) or die(Could not connect: . mysql_error()); mysql_select_db(Table name, $link); $UserName = $_GET['UserName']; $Password = $_GET['Password']; $Serial = $_GET['Serial']; $query = SELECT Serial, Password from accounts where UserName='$UserName'; $result = mysql_query($query) or die(Query errort: . mysql_error()); $row = mysql_fetch_row($result) or die(User Not found: . mysql_error()); $Serial = htmlspecialchars($row[0]); mysql_select_db is for selecting the database and NOT the table, the SELECT statement must be something like this: select SOMETHING from TABLE where WHERE_CLAUSE -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with preg_replace
Hi I have just realised that I have to delimit the following characters so I can use preg_replace: / ? [ ] Is there any php command to delimit all of these characters as I am getting the string I am trying to replace from the database. eg. \? Any ideas John John Clegg wrote: Hi Joel, Thanks for the reply. I have tried using / to delimit the string and I get the following error String $url = /http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL]/;; Gives the error: *Warning*: Unknown modifier '/' in* /test.php* on line *8* I found out that I could use ' to delimit from Example 5 in the php manual page for preg_replace. Also I need to replace only one occurance of the string at a time, so I can't use str_replace :-( . Any other suggestions?? Cheers John joel boonstra wrote: On Mon, Jan 19, 2004 at 06:50:37PM +0200, John Clegg wrote: Hi I am having some problems with preg_replace and I wondering if someone could suggest a fix or explain why it is not working. Here is the Code: * ?php $code = blah http://www.foo.com/Unsubscribe.php?EmailAddress=[MAIL] blah; $url = 'http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL]'; echo BEFORE : $codebrbr; $replace = Foo; $code = preg_replace($url,$replace,$code,1); echo AFTER: $codebr; ? ** Here is the results of the script: ** BEFORE : blah http://www.qxlmaxbid.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL] blah AFTER: blah http://www.qxlmaxbid.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL] blah ** It should give the following result: ** AFTER: blah Foo blah ** preg_replace expects the first argument to be a pattern, which should be enclosed in forward slashes (//). So your $url variable should be surrounded with slashes. You have single quotes in your $url variable, but I don't think that PHP behaves like perl in letting you use whichever delimiter you choose. Try replacing the single quotes with forward slashes. Additionally, if you're only doing a simple string substitution, you should use str_replace instead: http://php.net/str_replace You won't need the / delimiters, and it will be faster than using preg_replace. joel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with preg_replace
On Mon, Jan 19, 2004 at 07:15:53PM +0200, John Clegg wrote: Hi Joel, Thanks for the reply. I have tried using / to delimit the string and I get the following error String $url = /http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL]/;; Gives the error: *Warning*: Unknown modifier '/' in* /test.php* on line *8* I found out that I could use ' to delimit from Example 5 in the php manual page for preg_replace. Whoops, you're totally right. The single quote should work fine. I shouldn't underestimate PHP ;) Also I need to replace only one occurance of the string at a time, so I can't use str_replace :-( . Any other suggestions?? The problem is that there are still special chars that need escaping. Specifically, the question mark (?) and the square braces ([]). Here is some modified code (apologies for poor word-wrapping): ?php $code = blah http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL] blah ; $url = 'http://www.foo.com/maxbid/Unsubscribe.php\?EmailAddress=\[MAIL\]'; echo BEFORE : $code\n\n; $replace = Foo; $code = preg_replace($url,$replace,$code,1); echo AFTER: $code\n; ? When I run this, the output is: BEFORE : blah http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL] blah AFTER: blah Foo blah Next time, I'll test out my answers before I give 'em. HTH! -- [ joel boonstra | gospelcom.net ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with preg_replace
John Clegg wrote: Hi I have just realised that I have to delimit the following characters so I can use preg_replace: / ? [ ] Is there any php command to delimit all of these characters as I am getting the string I am trying to replace from the database. eg. \? Any ideas John Maybe addslashes(), but I don't know if that will escape all the characters you need. -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with preg_replace
John Nichel wrote: John Clegg wrote: Hi I have just realised that I have to delimit the following characters so I can use preg_replace: / ? [ ] Is there any php command to delimit all of these characters as I am getting the string I am trying to replace from the database. eg. \? Any ideas John Maybe addslashes(), but I don't know if that will escape all the characters you need. Check that...addslashes() won't escape []. -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is this code right?
Oh sorry.. I didn't notice that.. anyway.. I want to know.. what to add to this code to make it also check the serial between the database (That users' row) and the GET variable before it echos anything.. so the UserName, Password and Serial must be the same for that user.. Waiting your reply.. regards.. - Original Message - From: Miguel J. Jiménez [EMAIL PROTECTED] To: Radwan Aladdin [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, January 19, 2004 9:29 PM Subject: Re: [PHP] Is this code right? Radwan Aladdin wrote: Hi all.. I made this code for the login.php page.. it will compare A value from the users machine (Serial) and with a value inside the database (In that users' row).. so after logging it will check if also this value is the same and then echo something..is the following code is right for that? : ?php $link = mysql_connect(localhost, Database username, Database password) or die(Could not connect: . mysql_error()); mysql_select_db(Table name, $link); $UserName = $_GET['UserName']; $Password = $_GET['Password']; $Serial = $_GET['Serial']; $query = SELECT Serial, Password from accounts where UserName='$UserName'; $result = mysql_query($query) or die(Query errort: . mysql_error()); $row = mysql_fetch_row($result) or die(User Not found: . mysql_error()); $Serial = htmlspecialchars($row[0]); mysql_select_db is for selecting the database and NOT the table, the SELECT statement must be something like this: select SOMETHING from TABLE where WHERE_CLAUSE -- 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] Server Map Path
Hi All, Is there an equivalent to Server.MapPath(MyDir\MyLocation) in php? I've looked in the docs and don't seem to find it. I did find a reference to; $db = 'server//path'; But I get errors. I am connecting to an access db for testing and I'm using an ADO connection. $db = C:\\inetpub\\wwwroot\\proto1\\data\\example_one.mdb; $conn-Open(DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=.$db); I would like to make the $db a virtual path. alex hogan ** The contents of this e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom it is addressed. The views stated herein do not necessarily represent the view of the company. If you are not the intended recipient of this e-mail you may not copy, forward, disclose, or otherwise use it or any part of it in any form whatsoever. If you have received this e-mail in error please e-mail the sender. **
RE: [PHP] Is this code right?
snip $query = SELECT Serial, Password from accounts where UserName='$UserName'; $result = mysql_query($query) or die(Query errort: . mysql_error()); $row = mysql_fetch_row($result) or die(User Not found: . mysql_error()); mysql_fetch_row only pulls data one cell at a time so you would need to call $row[0] twice to get the two cells before calling the next row. $Serial = htmlspecialchars($row[0]); mysql_select_db is for selecting the database and NOT the table, the SELECT statement must be something like this: select SOMETHING from TABLE where WHERE_CLAUSE -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is this code right?
Radwan Aladdin wrote: Oh sorry.. I didn't notice that.. anyway.. I want to know.. what to add to this code to make it also check the serial between the database (That users' row) and the GET variable before it echos anything.. so the UserName, Password and Serial must be the same for that user.. It already looks like you're doing that with the code: if($UserSerial == $Serial){ Is that not working? -Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Server Map Path
Is there an equivalent to Server.MapPath(MyDir\MyLocation) in php? I've looked in the docs and don't seem to find it. I did find a reference to; I believe what you're looking for is: realpath('./') That should do the same trick as Server.MapPath(). -Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error Reporting help
On Monday 19 January 2004 22:34, Chris Edwards wrote: I retried most of the combinations and still cannot get it to report syntax errors. If I have errors, from say undefined variables, the error handler catches those just fine. Again: But if display_errors (in php.ini) is disabled then syntax errors will not be displayed -- they can only be viewed in the error log. IOW have a look at the output of phpinfo(), if display_errors is off, then no matter what combinations you try you will NOT be able to see syntax errors! Question: when I use the ini_set, does that stay set for the lifetime of the script executing or is it set for good? Only during the execution of the script. -- 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 -- /* Wouldn't this be a great world if being insecure and desperate were a turn-on? -- Broadcast News */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is this code right?
Do you mean this is the right code : ?php $link = mysql_connect(localhost, Database username, Database password) or die(Could not connect: . mysql_error()); mysql_select_db(Database name, $link); $UserName = $_GET['UserName']; $Password = $_GET['Password']; $Serial = $_GET['Serial']; $query = SELECT Serial, Password from accounts where UserName='$UserName'; $result = mysql_query($query) or die(Query errort: . mysql_error()); $row = mysql_fetch_row($result) or die(User Not found: . mysql_error()); $Serial = htmlspecialchars($row[0]); $UserPassword = $row[1]; $UserSerial = $row[1]; mysql_close($link); if($UserSerial == $Serial){ printEND HTML BODY Right serial! /BODY/HTML END; }else{ printEND HTML BODY Sorry, wrong serial! /BODY/HTML END; } if($UserPassword == $Password){ printEND HTML BODY Logged in successfully /BODY/HTML END; }else{ printEND HTML BODY Sorry, wrong password! /BODY/HTML END; } ? - Original Message - From: Jeremy Davis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, January 19, 2004 9:40 PM Subject: RE: [PHP] Is this code right? snip $query = SELECT Serial, Password from accounts where UserName='$UserName'; $result = mysql_query($query) or die(Query errort: . mysql_error()); $row = mysql_fetch_row($result) or die(User Not found: . mysql_error()); mysql_fetch_row only pulls data one cell at a time so you would need to call $row[0] twice to get the two cells before calling the next row. $Serial = htmlspecialchars($row[0]); mysql_select_db is for selecting the database and NOT the table, the SELECT statement must be something like this: select SOMETHING from TABLE where WHERE_CLAUSE -- 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] date fiedl
Diana Castillo wrote: Does anyone know if there is any speed advantage to saving a date as a unix timestamp or a numeric field instead of a date field? (in Mysql) thanks, Well, I prefer using an int(14) field for saving unix dates (so, I save the date as unix and not as date field). Thus is easier to work between dates adding and everything else... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is this code right?
Radwan Aladdin wrote: Do you mean this is the right code : The code overall looks right, but you set $Serial twice... first you do: $Serial = $_GET['Serial']; Then you do: $Serial = htmlspecialchars($row[0]); Then you set $UserSerial to $row[1] (the same as the Password column). So, when you compare $Serial to $UserSerial, you are really comparing it like this: if (htmlspecialchars($row[0]) == $row[1]) If that's what you're trying to do, then you're good. But, if you're trying to compare $UserSerial with the serial variable in $_GET, then you need to only do the following: $Serial = $_GET['Serial']; $UserSerial = $row[0]; if ($Serial == $UserSerial) Then, that should at least compare the serial field from the database with the serial variable in $_GET. -Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is this code right?
Just what I'm trying to do (Comparing the database with the GET) :) :) Thanks alot for your help.. Regards.. - Original Message - From: Ben Ramsey [EMAIL PROTECTED] Newsgroups: php.general To: Radwan Aladdin [EMAIL PROTECTED] Sent: Monday, January 19, 2004 10:16 PM Subject: Re: [PHP] Is this code right? Radwan Aladdin wrote: Do you mean this is the right code : The code overall looks right, but you set $Serial twice... first you do: $Serial = $_GET['Serial']; Then you do: $Serial = htmlspecialchars($row[0]); Then you set $UserSerial to $row[1] (the same as the Password column). So, when you compare $Serial to $UserSerial, you are really comparing it like this: if (htmlspecialchars($row[0]) == $row[1]) If that's what you're trying to do, then you're good. But, if you're trying to compare $UserSerial with the serial variable in $_GET, then you need to only do the following: $Serial = $_GET['Serial']; $UserSerial = $row[0]; if ($Serial == $UserSerial) Then, that should at least compare the serial field from the database with the serial variable in $_GET. -Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with preg_replace
On Tuesday 20 January 2004 01:31, John Clegg wrote: Is there any php command to delimit all of these characters as I am getting the string I am trying to replace from the database. preg_quote() -- 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 -- /* WYSIWYG: What You See Is What You Get. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] execute php script with crontab
On Monday 19 January 2004 21:14, Developer wrote: Could I add a question regarding the cron command? If you automatically run a php script through the cron command is timeout taken under account or does it run through the command line which is faster (and timeout is not taken under account?) Which timeout? -- 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 -- /* QOTD: Sure, I turned down a drink once. Didn't understand the question. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: how to check the form filled all
Sungpill Han wrote: HI, i want to check if the user filled the all inputs in the form. So, I checked NULL and with this function in the post receiving script. --- function is_filled_out() { // test that each variabl has a value foreach($_POST as $key = $value) { if(is_null($value) || $value=) return false; } return true; } - but when I submit the form without putting any value, it returns 'true'. what's wrong with my code? It is my understanding (not sure if it is correct though) that if your form has a field named x and the user does not enter any value in that field, there will be no entry for field x in the $_POST array. so your loop should never return false. To see if they entered a value in field X you need to code something like this if(! $_POST['x']){ do what ever you do when they don't fill out a required field; } Chris W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with preg_replace
joel boonstra wrote: The problem is that there are still special chars that need escaping. Specifically, the question mark (?) and the square braces ([]). Here is some modified code (apologies for poor word-wrapping): ?php $code = blah http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL] blah ; $url = 'http://www.foo.com/maxbid/Unsubscribe.php\?EmailAddress=\[MAIL\]'; echo BEFORE : $code\n\n; $replace = Foo; $code = preg_replace($url,$replace,$code,1); echo AFTER: $code\n; ? When I run this, the output is: BEFORE : blah http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL] blah AFTER: blah Foo blah Next time, I'll test out my answers before I give 'em. In $url, the periods still need to be escaped, too. This is where preg_quote() comes in handy. $url = http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL];; $url = preg_quote($url); $code = preg_replace(#$url#,$replace,$code,1); I hope the OP took notice of the str_replace() remark, too. :) -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Hot to MD5 two values (Valu1+Valu2)
Hi all.. I want to know.. Can I use : $md5 = md5($variable1 + $variable2); Is it right to use that? Notice : I don't want I want to add the first value to the second one(1=2=3).. then make them MD5...MD5(3) (For example).. Regards..
RE: [PHP] Hot to MD5 two values (Valu1+Valu2)
[snip] Can I use : $md5 = md5($variable1 + $variable2); Is it right to use that? Notice : I don't want I want to add the first value to the second one(1=2=3).. then make them MD5...MD5(3) (For example).. [/snip] Have you tried it? Of courser if all else failed you could do ... $myDog = $var1 + var2; $md5 = md5($myDog); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: how to check the form filled all
Chris W wrote: Sungpill Han wrote: HI, i want to check if the user filled the all inputs in the form. So, I checked NULL and with this function in the post receiving script. --- function is_filled_out() { // test that each variabl has a value foreach($_POST as $key = $value) { if(is_null($value) || $value=) = is assignment, == is equality... if(is_null($value) || $value==) or, since the value will never be null if it's already in $_POST if($value=='') I would recommend empty(), but if someone puts 0 (zero) in a field, empty(0) returns true... return false; } return true; } - but when I submit the form without putting any value, it returns 'true'. what's wrong with my code? It is my understanding (not sure if it is correct though) that if your form has a field named x and the user does not enter any value in that field, there will be no entry for field x in the $_POST array. This depends on the field. If it's a text box, then x will still be in $_POST, but it'll be empty. If it's a checkbox, and the checkbox is not checked, then x will not be in $_POST. One thing to note for the original poster, all your code does is check that there are no empty values within $_POST. it doesn't keep track of how many there are or if the correct ones are there. If I make my own form with a single text box that I put a value in, it'll be validated by your code. Hopefully there's more to your validation than this. :) -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hot to MD5 two values (Valu1+Valu2)
Radwan Aladdin wrote: Can I use : $md5 = md5($variable1 + $variable2); Is it right to use that? Yes, you can do that. Whether it's right or not depends. You could have taken the two seconds to try it, either way. :) -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Securing php from rogue php scripts
Hi there I have been reading about certain php scripts that, if used incorrectly, can compromise servers. There are certain open source scripts that I know if (no names mentioned) that have exploits that allow this and I want to know if there is a How to or best practice anywhere for securing PHP against this. I was told to add some stuff to the php.ini file to prevent certain actions (phpinfo ,system, include, chown, chmod, exec, passthru, mail, readfile , dir , read, readdir) but was wondering if someone could give some advice Thanks Ade -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Dokument
I need some PHP Dokument, Can any one HELP me. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dokument
I need some PHP Dokument, Can any one HELP me. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Dokument
[snip] I need some PHP Dokument, Can any one HELP me. [/snip] http://www.php.net please do not reply to me off-list -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP OpenDirectory extension - alpha - need testers
If there are any OpenDirectory users out there I just finished an alpha version of a PHP extension that wraps Darwin's OpenDirectory API. I'm in dire need of people to test it out the help me get an idea of its usefulness. If your interested you can find it on the PECL website or on... my site :) http://pecl.php.net/package/opendirectory You can also download from and find documentation at: http://www.128kb.com/projects/index.php You can contact me if you need build instructions, comments, suggestions etc.. [EMAIL PROTECTED] -- Justin Hannus Lead Programmer/Web Development [EMAIL PROTECTED] www.visualconceptsinc.com [860] 242.1150 ext.125 [860] 242.1446 fax -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with preg_replace
John W. Holmes wrote: In $url, the periods still need to be escaped, too. This is where preg_quote() comes in handy. $url = http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL];; $url = preg_quote($url); $code = preg_replace(#$url#,$replace,$code,1); I hope the OP took notice of the str_replace() remark, too. :) Well, lookie here. I've been using php for 6 years now, and favor preg over ereg, but never knew about the preg_quote function. I'm a happy camper today. -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dokument
haitham wrote: I need some PHP Dokument, Can any one HELP me. Thanks http://us4.php.net/manual/en/index.php -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error Reporting help
Here's a snippet from my PHI_INI ; - Show all errors ; error_reporting = E_ALL ;error_reporting = E_ALL ~E_NOTICE ~E_WARNING ~E_CORE_WARNING ~E_USER_WARNING ~E_USER_NOTICE ~E_COMPILE_WARNING display_errors = On The commented out error_reporting was the original setting and display_errors was Off I changed them to the values you see above. When I execute my script and use init_get() the values appear to be right, but do I need to do something to get PHP to actually work off of these setting once they have been changed, i.e. some kind of refresh Thanks Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Monday 19 January 2004 22:34, Chris Edwards wrote: I retried most of the combinations and still cannot get it to report syntax errors. If I have errors, from say undefined variables, the error handler catches those just fine. Again: But if display_errors (in php.ini) is disabled then syntax errors will not be displayed -- they can only be viewed in the error log. IOW have a look at the output of phpinfo(), if display_errors is off, then no matter what combinations you try you will NOT be able to see syntax errors! Question: when I use the ini_set, does that stay set for the lifetime of the script executing or is it set for good? Only during the execution of the script. -- 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 -- /* Wouldn't this be a great world if being insecure and desperate were a turn-on? -- Broadcast News */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error Reporting help
Chris Edwards wrote: but do I need to do something to get PHP to actually work off of these setting once they have been changed, Restart your web server. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error Reporting help
On Tuesday 20 January 2004 03:44, Chris Edwards wrote: Here's a snippet from my PHI_INI ; - Show all errors ; error_reporting = E_ALL ;error_reporting = E_ALL ~E_NOTICE ~E_WARNING ~E_CORE_WARNING ~E_USER_WARNING ~E_USER_NOTICE ~E_COMPILE_WARNING display_errors = On With those settings you should be able to see syntax errors. The commented out error_reporting was the original setting and display_errors was Off I changed them to the values you see above. When I execute my script and use init_get() the values appear to be right, but do I need to do something to get PHP to actually work off of these setting once they have been changed, i.e. some kind of refresh You need to restart the webserver for any changes in php.ini to take effect. -- 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 -- /* What passes for woman's intuition is often nothing more than man's transparency. -- George Nathan */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] another mysql question, sorry
I am sorry to post another mysql question, but this one is design related. I need to create a relationship between two different tables in two different databases. I feel like I am commiting a sin doing so, but it makes sence at the application level, and to redesign everything would be disastrous. Any comments? Thanks Christian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] another mysql question, sorry
I am sorry to post another mysql question, but this one is design related. I need to create a relationship between two different tables in two different databases. I feel like I am commiting a sin doing so, but it makes sence at the application level, and to redesign everything would be disastrous. Any comments? Thanks I don't see any huge problem with this. I've done it several times in my user authentication code. I'm allowing (for some users) a single UID/PW pair for access to each of my sites but each of those sites has their own user info (Name, Address, etc) table. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] another mysql question, sorry
Christian Calloway wrote: I am sorry to post another mysql question, but this one is design related. I need to create a relationship between two different tables in two different databases. I feel like I am commiting a sin doing so, but it makes sence at the application level, and to redesign everything would be disastrous. Any comments? Thanks I can see your point about it feeling like committing a sin, and I certainly wouldn't recommend doing it with out a good reason but if it seems to make sense for your application, why not? Mysql specifically provides the syntax to do a join between tables in different databases so they must think there is a good reason to do allow it. Even if it is an out of the ordinary case that calls for it. Chris W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] dreaded sessions
Hi all, Sessions have become one my nightmares. Unfortunately, I have built a system based on sessions and for some reason I having some really irritating issues. Simply here is my problem: After logging into the system, I set a session with information for the Username and Password for verifiying the user's login into the system, that way I don't have to continually ask for the information or pass in the forms. Currently I am using a database to store sessions, which I have however encountered the same errors with file based sessions. When I restart the session, it performs a selection from the database on SESS ID. However, in very consistently inconsistent points the selection returns 0 results. However, I checked the database for the session data and found that the session information was gone from the previous write. But I am using an Innodb table and committing the transaction. Odd? I am calling the session_write_close function at the end of the transaction, to push the session through. Also, in the session_destroy handler I put a debugging message to see if the session was being destroyed and that is not the situation either. Anybody have similar problems with delayed in session writing or lost session data? I register all of the data into the session that I need leave the session alone except for reading of the session data. Thanks in advance! Matt Matt Horner Programmer/Anaylst WIREdata Corporation [EMAIL PROTECTED]
Re: [PHP] dreaded sessions
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Matt Horner wrote: | Simply here is my problem: | | After logging into the system, I set a session with information for | the Username and Password for verifiying | the user's login into the system, that way I don't have to | continually ask for the information or pass | in the forms. | | Currently I am using a database to store sessions, which I have | however encountered the same errors with file | based sessions. When I restart the session, it performs a selection | from the database on SESS ID. However, | in very consistently inconsistent points the selection returns 0 | results. However, I checked the database for the | session data and found that the session information was gone from | the previous write. But | I am using an Innodb table and committing the transaction. Odd? | | I am calling the session_write_close function at the end of the | transaction, to push the session through. Also, | in the session_destroy handler I put a debugging message to see if | the session was being destroyed and that is | not the situation either. | | Anybody have similar problems with delayed in session writing or | lost session data? I register all of the data into | the session that I need leave the session alone except for reading | of the session data. I'd say it has something to do with you transactions. Can you duplicate the errors using the same code on a system where the Innodb transactions do not require committing? Here is my own drop-in PHP session handling code if you care to compare notes: http://destiney.com/pub/php_db_sessions.tar.gz I've never had a problem with it and I am using it with Innodb tables on several projects currently. I've also heard the Pear DB Session stuff is pretty good too, but I've never tried it. - -- ** * ____ _ * * ___/ /__ ___ / /_(_)__ ___ __ __ ___ __ _ * * / _ / -_)_-/ __/ / _ \/ -_) // // __/ _ \/ ' \ * * \_,_/\__/___/\__/_/_//_/\__/\_, (_)__/\___/_/_/_/ * *(___/ [EMAIL PROTECTED] * ** BOFH Excuse #18: excess surge protection -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFADFxtoAq8t3CabwcRAsKBAKCIY8Xp8GxXjVpg+fY6uy84t0WRAgCdH/Ao mP6LQ6cy3qCuFeYLcS11exM= =mUJI -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] USE_SESSION_ID
hello all, Im having troubled with horde and imp with php 4.3.4. I receive the 'USE_SESSION_ID' in the login field. This is a bit of a nuisance whenever someone wants to log in they have to remove this from the login field. Is there a php.ini configuration setting i can set to get rid of this? How do I preceed with this problem? thanks, Ian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dreaded sessions
On Mon, 2004-01-19 at 17:38, Greg Donald wrote: I'd say it has something to do with you transactions. Can you duplicate the errors using the same code on a system where the Innodb transactions do not require committing? Here is my own drop-in PHP session handling code if you care to compare notes: http://destiney.com/pub/php_db_sessions.tar.gz I've never had a problem with it and I am using it with Innodb tables on several projects currently. Kind of funny... Back before PHP had sessions this was how everyone did it and everyone wished for session support in PHP, now that it's had it for a while :) -- BrianGnuPG - KeyID: 0x04A4F0DC | URL: www.gfx-design.com/keys Key Server: pgp.mit.edu == gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC GnuPG: http://gnupg.org http://www.biglumber.com/x/web?qs=0x2C35011004A4F0DC Linux Registered User #339825 at http://counter.li.org signature.asc Description: This is a digitally signed message part
Re: [PHP] dreaded sessions
sorry i missed this thread, but what seems to be the problem with php sessions ? I had to use phplib sessions on the works php3 server, which one is better disk based sessions or database based sessions ? I have no problem whatsoever with 60 concurrent users on a php session based system but what about 100,000 concurrent users ??? On Mon, 2004-01-19 at 17:38, Greg Donald wrote: I'd say it has something to do with you transactions. Can you duplicate the errors using the same code on a system where the Innodb transactions do not require committing? Here is my own drop-in PHP session handling code if you care to compare notes: http://destiney.com/pub/php_db_sessions.tar.gz I've never had a problem with it and I am using it with Innodb tables on several projects currently. Kind of funny... Back before PHP had sessions this was how everyone did it and everyone wished for session support in PHP, now that it's had it for a while :) -- BrianGnuPG - KeyID: 0x04A4F0DC | URL: www.gfx-design.com/keys Key Server: pgp.mit.edu =gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC GnuPG: http://gnupg.org http://www.biglumber.com/x/web?qs=0x2C35011004A4F0DC Linux Registered User #339825 at http://counter.li.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can this head section, which loads many style sheets, be improved or simplified?
I now that have a system that works beautifully. I just wondered if it could be simplififed or improved even more. The head section on every page consists of an included page, which I appended below. But the most important part is the style sheet section, which begins with two or three default style sheets (World, North America), followed by several conditional regional style sheets (e.g. the North, Southwest, Great Plains, etc.) and a few alternate style sheets: echo 'link href=' . $periods . 'css/aaa.css rel=stylesheet type=text/css /'; if($includenorth == TRUE){ echo 'link href=' . $periods . 'css' . $linkcontinent . '/north.css rel=stylesheet type=text/css /'; } if($includesw == TRUE){ echo 'link href=' . $periods . 'css' . $linkcontinent . '/southwest.css rel=stylesheet type=text/css /'; } echo 'link href=' . $periods . 'css/themes/peace.css rel=alternate stylesheet type=text/css title=Peace /'; echo 'link href=' . $periods . 'css/themes/war.css rel=alternate stylesheet type=text/css title=War /'; Here's the matching head section from the main page (Alaska, in this case): !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en head ?php $myname = 'Alaska'; $mycode = 'ak'; $mylink = '/ak'; $mynickname = 'Land of the Midnight Sun'; $mycontinent = 'North America'; $mycountry = 'United States'; $mystate = 'Alaska'; $countrycode = 'us'; $linkcontinent = '/na'; $linkcountry = '/us'; $linkstate = '/ak'; $periods = '../../../../'; $linkwebring = '/world/na/us/ak/'; $includenorth = TRUE; $includesouth = FALSE; $includesouthwest = FALSE; [Plus about a dozen more] include (../../../../includes/state/head.php); ? /head This same head section appears on pages for the Northwest Territories and Yukon Territory, and the style sheet all three are linked to - north.css - features styles that modifies page elements (e.g. div#title) that have been modified by PHP (e.g. div#titleak, div#titlenwt, div#titleyt). The head section for the Southwest states accepts the southwest style sheet and bars the northern style sheet. As I said, it works great. I just wondered if anyone had any suggestions for improving it further. It would be kind of nice if I didn't have to paste a string of FALSE statements into the head section of every page... $includenorth = FALSE; $includesouth = FALSE; $includesouthwwest = FALSE; Below is the entire code. Thanks! ?php $todayDate = date(m-d-Y); echo 'titleFreedomware gt; ' . $myname . '/title'; echo 'meta name=description content=' . $myname . ' versus Microsoft /'; echo 'meta name=keywords content=' . $myname . ' versus Microsoft /'; echo 'meta name=mssmarttagspreventparsing content=true /'; echo 'meta http-equiv=content-Type content=text/html; charset=iso-8859-1 /'; echo 'meta name=author content=David Blomstrom /'; echo 'script src=' . $periods . 'js/swapclass.js type=text/javascript/script'; echo 'script src=' . $periods . 'js/ss.js type=text/javascript/script'; echo 'script language=JavaScript type=text/JavaScript !-- function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } //-- /script'; echo 'link href=' . $periods . 'css/aaa.css rel=stylesheet type=text/css /'; if($includea1 == TRUE){ echo 'link href=' . $periods . 'css' . $linkcontinent . '/a1.css rel=stylesheet type=text/css /'; } if($includenorth == TRUE){ echo 'link href=' . $periods . 'css' . $linkcontinent . '/north.css rel=stylesheet type=text/css /'; } if($includesw == TRUE){ echo 'link href=' . $periods . 'css' . $linkcontinent . '/sw.css rel=stylesheet type=text/css /'; } echo 'link href=' . $periods . 'css/themes/peace.css rel=alternate stylesheet type=text/css title=Peace /'; echo 'link href=' . $periods . 'css/themes/war.css rel=alternate stylesheet type=text/css title=War /'; ? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en head ?php $myname = 'Alaska'; $mycode = 'ak'; $mylink = '/ak'; $mynickname = 'Land of the Midnight Sun'; $mycontinent = 'North America'; $mycountry = 'United States'; $mystate = 'Alaska'; $countrycode = 'us'; $linkcontinent = '/na'; $linkcountry = '/us'; $linkstate = '/ak'; $periods = '../../../../'; $linkwebring = '/world/na/us/ak/'; $includea1 = TRUE; $includenorth = TRUE; $includequon = FALSE; $includemar = FALSE; $includene = FALSE; $includemat = FALSE; $includeapp = FALSE; $includesouth = FALSE; $includemw = FALSE; $includegp = FALSE; $includetx = FALSE; $includerm = FALSE; $includesw = FALSE; $includeca = FALSE; $includehi = FALSE; $includemex = FALSE; include (../../../../includes/state/head.php); ? /head -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Generating an Excel file?
I'm pretty sure I know how to use header() create a CSV file for a client to download data from a database, but I think it would really impress this client if I could generate a Microsoft Excel file instead of a CSV file. Anyone know how to do this? -Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Generating an Excel file?
Google is your friend ;-) -J -Original Message- From: Ben Ramsey [mailto:[EMAIL PROTECTED] Sent: Monday, January 19, 2004 5:41 PM To: [EMAIL PROTECTED] Subject: [PHP] Generating an Excel file? I'm pretty sure I know how to use header() create a CSV file for a client to download data from a database, but I think it would really impress this client if I could generate a Microsoft Excel file instead of a CSV file. Anyone know how to do this? -Ben -- 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] Generating an Excel file?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ben Ramsey wrote: | I'm pretty sure I know how to use header() create a CSV file for a | client to download data from a database, but I think it would really | impress this client if I could generate a Microsoft Excel file instead | of a CSV file. Anyone know how to do this? We get this request from clients at work quite often. Most people don't realize .csv files are Excel friendly. Just make the data comma delimited and name it .csv. It'll work. - -- ** * ____ _ * * ___/ /__ ___ / /_(_)__ ___ __ __ ___ __ _ * * / _ / -_)_-/ __/ / _ \/ -_) // // __/ _ \/ ' \ * * \_,_/\__/___/\__/_/_//_/\__/\_, (_)__/\___/_/_/_/ * *(___/ [EMAIL PROTECTED] * ** BOFH Excuse #269: Melting hard drives -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFADG+HoAq8t3CabwcRAm3eAJ48cC3E6+Mh5HezwKKIsvflAe62dACfUfE/ jFqr+KcMIUsEG2Hw/rCuUKA= =8jBi -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dreaded sessions
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brian V Bonini wrote: | Kind of funny... Back before PHP had sessions this was how everyone did | it and everyone wished for session support in PHP, now that it's had it | for a while :) I hear ya. I recall a job interview in like 1999 or something where I was asked if I had used phplib before. They were using FreeBSD and STABLE still only had PHP3 available at the time. - -- ** * ____ _ * * ___/ /__ ___ / /_(_)__ ___ __ __ ___ __ _ * * / _ / -_)_-/ __/ / _ \/ -_) // // __/ _ \/ ' \ * * \_,_/\__/___/\__/_/_//_/\__/\_, (_)__/\___/_/_/_/ * *(___/ [EMAIL PROTECTED] * ** BOFH Excuse #205: Quantum dynamics are affecting the transistors -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFADHBfoAq8t3CabwcRAqfFAKCfZx0569fHld9e5F14UnVSOZe2EACgodYI 17jm+trWEQr1oFwEvsMK688= =meaR -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Generating an Excel file?
Geez what really bad advice, giving an end user a totally useless unfriendly csv file is bad bad bad. I suggest you check out http://pear.php.net/package/Spreadsheet_Excel_Writer , its a pain to get the layout perfect, but once its done you have what you need. I've also been trying to hassle to get a report server installed and working check out either Datavision or Report Manager, it took me less than an hour to design the report. It took me 2 months to try and get the systems guy to install it but still not happening due to the fact its delphi/kylix database drivers which just are not so friendly as JDBC and the RM developer is not so friendly with support but its the only most decent open source alternative out there, you could also check out ICrystal. -Original Message- From: Ben Ramsey [mailto:[EMAIL PROTECTED] Sent: Monday, January 19, 2004 5:41 PM To: [EMAIL PROTECTED] Subject: [PHP] Generating an Excel file? I'm pretty sure I know how to use header() create a CSV file for a client to download data from a database, but I think it would really impress this client if I could generate a Microsoft Excel file instead of a CSV file. Anyone know how to do this? -Ben -- 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