php-general Digest 2 Feb 2007 20:53:00 -0000 Issue 4604

2007-02-02 Thread php-general-digest-help
php-general Digest 2 Feb 2007 20:53:00 - Issue 4604 Topics (messages 248184 through 248209): Graphs 248184 by: ffredrixson.comcast.net 248185 by: Thomas Pedoussaut 248192 by: LeaseWeb - Poelwijk Login script login 248186 by: Dave Carrera 248187 by:

[PHP] accepting POST variables using CURL

2007-02-02 Thread chetan rane
HI al i tried curl to access HTTPS pages but how do i get the POST variables been passed to me . here is teh exact thing which i want. i have a HTML page when i submit the form i want ot read all teh POST data using HTTPS. I know its possible using CURL but dont exactly know how to do it --

[PHP] Graphs

2007-02-02 Thread ffredrixson
I would like to add some graphing capability to an app of mine. What package is recommended? I don't need anything too fancy, just some bar graphs, pie charts, etc. Thank you in advance.

Re: [PHP] Graphs

2007-02-02 Thread Thomas Pedoussaut
[EMAIL PROTECTED] wrote: I would like to add some graphing capability to an app of mine. What package is recommended? I don't need anything too fancy, just some bar graphs, pie charts, etc. Thank you in advance. I use the PEAR module Image_Graph Officially it's still in alpha, but works

[PHP] Login script login

2007-02-02 Thread Dave Carrera
Hi All, Having a grey brain moment here and need some advise on the logic of this, should be simple, login script. I am checking validity of customer number customer email customer password (md5 in mysql) So i have my form with relevant fields Now i am getting problems with either sql or

Re: [PHP] Login script login

2007-02-02 Thread Satyam
- Original Message - From: Dave Carrera [EMAIL PROTECTED] Hi All, Having a grey brain moment here and need some advise on the logic of this, should be simple, login script. I am checking validity of customer number customer email customer password (md5 in mysql) So i have my form

Re: [PHP] Login script login

2007-02-02 Thread Stut
Dave Carrera wrote: Hi All, Having a grey brain moment here and need some advise on the logic of this, should be simple, login script. I am checking validity of customer number customer email customer password (md5 in mysql) So i have my form with relevant fields Now i am getting problems

Re: [PHP] Login script login

2007-02-02 Thread Dave Carrera
Hi Stut, I think i have found where i am going wrong. Its in the comparison login for the db result. So i select * from jfjfjfjf where custno=$_POST[number] But now i am getting messed up with if cust no not found then all i get is a blank page but hoping for an error And i dont think

Re: [PHP] Login script login

2007-02-02 Thread Németh Zoltán
On p, 2007-02-02 at 12:10 +, Dave Carrera wrote: Hi Stut, I think i have found where i am going wrong. Its in the comparison login for the db result. So i select * from jfjfjfjf where custno=$_POST[number] But now i am getting messed up with if cust no not found then all i get

Re: [PHP] Login script login

2007-02-02 Thread Jürgen Wind
Stut wrote: I'm not totally clear what the question was in there. Personally I keep this simple... ?php $_POST['number'] = (isset($_POST['number']) ? trim($_POST['number']) : ''); $_POST['email'] = (isset($_POST['email']) ? trim($_POST['email']) : ''); if

Re: [PHP] Graphs

2007-02-02 Thread LeaseWeb - Poelwijk
Or you could try JPgraph, i used it for several projects: http://www.aditus.nu/jpgraph/ Regards, Sander Poelwijk [EMAIL PROTECTED] wrote: I would like to add some graphing capability to an app of mine. What package is recommended? I don't need anything too fancy, just some bar graphs,

[PHP] Reading from the htpasswd file

2007-02-02 Thread Ryan A
Hey, *** Warning: feeling a bit braindead today after working long hours yesterday so please excuse if some parts are crappy*** I have a pal who uses a htpasswd file for access to his site.. rather than using basic_auth he wants to change it to form based _without_ a DB (ie user comes to his

[PHP] Year

2007-02-02 Thread Dan Shirah
Hello all, I am trying to populate a dropdown list to contain the current year to 10 years in the future. Below is the code I'm using: ?PHP for ($y=0;$y=10;$y++) { $years=date http://php.net/date('Y')+$y; $short_years=date http://php.net/date('y')+$y; echo $short_years; echo option

Re: [PHP] Year

2007-02-02 Thread Robert Cummings
On Fri, 2007-02-02 at 10:11 -0500, Dan Shirah wrote: Hello all, I am trying to populate a dropdown list to contain the current year to 10 years in the future. Below is the code I'm using: ?PHP for ($y=0;$y=10;$y++) { $years=date http://php.net/date('Y')+$y; $short_years=date

Re: [PHP] Year

2007-02-02 Thread Robert Cummings
On Fri, 2007-02-02 at 10:21 -0500, Robert Cummings wrote: On Fri, 2007-02-02 at 10:11 -0500, Dan Shirah wrote: Hello all, I am trying to populate a dropdown list to contain the current year to 10 years in the future. Below is the code I'm using: ?PHP for ($y=0;$y=10;$y++) {

Re: [PHP] Year

2007-02-02 Thread Németh Zoltán
On p, 2007-02-02 at 10:11 -0500, Dan Shirah wrote: Hello all, I am trying to populate a dropdown list to contain the current year to 10 years in the future. Below is the code I'm using: ?PHP for ($y=0;$y=10;$y++) { $years=date http://php.net/date('Y')+$y; $short_years=date

Re: [PHP] Year

2007-02-02 Thread chetan rane
HI Dan try this this should work 100%; echo select; for ($y=0;$y=10;$y++) { $years=date('Y')+$y; $short_years=date('y')+$y; printf(option value=\%02d\%d/option,$short_years,$years); } echo /select; On 2/2/07, Dan Shirah [EMAIL PROTECTED] wrote: Hello all, I am trying to populate a dropdown

Re: [PHP] Year

2007-02-02 Thread Dan Shirah
Thanks everyone! A lot of great solutions! On 2/2/07, chetan rane [EMAIL PROTECTED] wrote: HI Dan try this this should work 100%; echo select; for ($y=0;$y=10;$y++) { $years=date('Y')+$y; $short_years=date('y')+$y; printf(option value=\%02d\%d/option,$short_years,$years); } echo /select;

Re: [PHP] Can a class instance a property of another class

2007-02-02 Thread Ken Kixmoeller -- reply to [EMAIL PROTECTED]
Thanks to all -- got all of this working fine. Mostly my syntax was a bit off. Your examples helped me mend my ways. Ken -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Executing scripts from a table

2007-02-02 Thread Ken Kixmoeller -- reply to [EMAIL PROTECTED]
Hi, folks -- - - For security and efficiency, I am trying to store PHP scripts in MySQL tables. Only problem: I can't get them to execute. In a template: $php_code = $this-ApplicationObject-GetStoredCode($whichpage); echo $php_code; // doesn't

Re: [PHP] Executing scripts from a table

2007-02-02 Thread Ken Kixmoeller -- reply to [EMAIL PROTECTED]
Yeah, that was it. Thanks, Thomas. (dang it, I should have been able to figure out that myself!) Ken On Feb 2, 2007, at 11:32 AM, Thomas Pedoussaut wrote: Ken Kixmoeller -- reply to [EMAIL PROTECTED] wrote: Hi, folks -- - - For security and efficiency, I am trying to store PHP scripts in

[PHP] preg_replace();

2007-02-02 Thread Sébastien WENSKE
Hi all, I want replace the | (pipe) and the (space) chars where are between (double-quotes) by an underscore _ with the preg_replace(); funtction. Can someone help me to find the correct regex. Thanks in advance Seb

Re: [PHP] preg_replace();

2007-02-02 Thread wwww
I am not a very experienced programmer, but I think that str_replace can be used in this case: $new_string=str_replace('|', '_', $old_string) then use the same function to replace spaces. Ed Friday, February 2, 2007, 9:30:37 PM, you wrote: Hi all, I want replace the | (pipe) and the

Re[2]: [PHP] preg_replace();

2007-02-02 Thread wwww
I have tasted the code and it worked fine (if I got you right): $old_string=lazy \|\ dog; $new_string=str_replace('|', '_', $old_string); print $new_string; I got lazy_dog Ed Friday, February 2, 2007, 10:01:14 PM, you wrote: Thanks, but I think that I must use preg_replace because the

Re[4]: [PHP] preg_replace();

2007-02-02 Thread wwww
Try this one: $old_string=lazy \some chars|some chars\ dog; $new_string=str_replace('|', '_', $old_string); print $new_string; Ed Friday, February 2, 2007, 10:39:59 PM, you wrote: ok, but : $old_string=lazy \some chars|some chars\ dog; $new_string=str_replace('|', '_', $old_string);

Re: [PHP] preg_replace();

2007-02-02 Thread Steffen Ebermann
This always works for me: if (preg_match_all(!\(.+)\!sU, $var, $match)) { for ($i=0; $icount($match[0]); $i++) { $old = $match[1][$i]; $new = preg_replace(!\|| !, _, $old); $var = str_replace(\$old\, \$new\, $var); } } On Fri, Feb 02, 2007 at 07:30:37PM +0100, Sébastien WENSKE

Re: [PHP] preg_replace(); [solved]

2007-02-02 Thread Sébastien WENSKE
nice ! thanks Steffen Ed ! i've just add '[src|background] *= *' to make sure that the replacement takes effect only in THML tag's attributes if (preg_match_all(![src|background] *= *\(.+)\!sU, $htmlContent, $match)) { for ($i=0; $icount($match[0]); $i++) { $old = $match[1][$i];

Re: [PHP] preg_replace(); [solved]

2007-02-02 Thread Steffen Ebermann
Maybe you just mistyped that, but this would *probably* also match on s= or bar=, cause [ and ] are metacharacters. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] preg_replace();

2007-02-02 Thread Steffen Ebermann
On Fri, Feb 02, 2007 at 09:01:38PM +0100, Steffen Ebermann wrote: $new = preg_replace(!\|| !, _, $old); Heyha, the mail's subject gone obsolete. preg_replace isn't necessary at all. Better use: $new = str_replace(array (|, ), _, $old); -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Graphs

2007-02-02 Thread Lists
[EMAIL PROTECTED] skrev: I would like to add some graphing capability to an app of mine. What package is recommended? I don't need anything too fancy, just some bar graphs, pie charts, etc. Thank you in advance. Take a look a at: http://www.java2s.com then click on PHP in the menu and

[PHP] scheduler algorithm

2007-02-02 Thread bruce
hi... i'm creating a quick/dirty app for scheduling a function, based on the user entering a start time/date, as well as a potential periodic timeframe. ie: the user enters- start time/date:10:00am 01/10/07 periodicmonthly the idea is to

[PHP] Re: scheduler algorithm

2007-02-02 Thread frank
hmmm, a month period has 4*7 days e.g. then i can schedule on 31.3.07 a month period which will repeat itself on 30.4.07 and again on 30.5.07 even though may has 31 days. i dont see no other logic if you take a week period it same a week has always 7 days. how else would it make sense. the start

Re: [PHP] Re: scheduler algorithm

2007-02-02 Thread Richard Lynch
You may want to look at what various databases will do for you with date arithmetic. E.g., You can type this in MySQL: select date_add('2007-01-31', interval 1 month); I'm not sure what it will answer, but you can type that. :-) In Postgresql, it's more like: select '1/31/2007'::date + '1

Re: [PHP] preg_replace();

2007-02-02 Thread Richard Lynch
On Fri, February 2, 2007 12:30 pm, Sébastien WENSKE wrote: I want replace the | (pipe) and the (space) chars where are between (double-quotes) by an underscore _ with the preg_replace(); funtction. Can someone help me to find the correct regex. You can even go so far so to do both at

Re: [PHP] Executing scripts from a table

2007-02-02 Thread Richard Lynch
On Fri, February 2, 2007 11:32 am, Ken Kixmoeller -- reply to [EMAIL PROTECTED] wrote: For security and efficiency, I am trying to store PHP scripts in MySQL tables. Only problem: I can't get them to execute. E. Putting PHP source into MySQL is the WRONG way to go for security and

Re: [PHP] Year

2007-02-02 Thread Richard Lynch
On Fri, February 2, 2007 9:11 am, Dan Shirah wrote: I am trying to populate a dropdown list to contain the current year to 10 years in the future. Below is the code I'm using: ?PHP for ($y=0;$y=10;$y++) { $years=date http://php.net/date('Y')+$y; $short_years=date

Re: [PHP] Reading from the htpasswd file

2007-02-02 Thread Richard Lynch
On Fri, February 2, 2007 8:17 am, Ryan A wrote: I have a pal who uses a htpasswd file for access to his site.. rather than using basic_auth he wants to change it to form based _without_ a DB (ie user comes to his site and enters the username and password into a form, then submits it to the

Re: [PHP] Login script login

2007-02-02 Thread Richard Lynch
On Fri, February 2, 2007 5:19 am, Dave Carrera wrote: Having a grey brain moment here and need some advise on the logic of this, should be simple, login script. I am checking validity of customer number customer email customer password (md5 in mysql) So i have my form with relevant

Re: [PHP] Login script login

2007-02-02 Thread Richard Lynch
On Fri, February 2, 2007 5:33 am, Satyam wrote: In login scripts you usually don't tell which part of the login is wrong, otherwise, you are hinting at what is right. Once the customer is logged in, you are right to be as helpful as possible, but until the customer proves who he/she is, you

Re: [PHP] Login script login

2007-02-02 Thread Richard Lynch
If you are splicing $_POST directly into your SQL, you are DEFINITELY doing it wrong, but not in the way that you think. Start reading here: http://phpsec.org On Fri, February 2, 2007 6:10 am, Dave Carrera wrote: Hi Stut, I think i have found where i am going wrong. Its in the

Re: [PHP] Login script login

2007-02-02 Thread Richard Lynch
On Fri, February 2, 2007 7:05 am, Jürgen Wind wrote: // Set up the session here, or however you're tracking the // current customer/user/whatever header('Location: /somewhere_else'); ? Hope that helps. -Stut be aware that you need a session_write_close(); before header('Location...

Re: [PHP] Graphs

2007-02-02 Thread Richard Lynch
On Fri, February 2, 2007 4:55 am, [EMAIL PROTECTED] wrote: I would like to add some graphing capability to an app of mine. What package is recommended? I don't need anything too fancy, just some bar graphs, pie charts, etc. JP Graph is always mentioned in this list. I generally just do GD

Re: [PHP] accepting POST variables using CURL

2007-02-02 Thread Richard Lynch
On Fri, February 2, 2007 2:45 am, chetan rane wrote: i tried curl to access HTTPS pages but how do i get the POST variables been passed to me . here is teh exact thing which i want. i have a HTML page when i submit the form i want ot read all teh POST data using HTTPS. I know its possible

Re: [PHP] date to string

2007-02-02 Thread Richard Lynch
On Thu, February 1, 2007 6:30 pm, John Taylor-Johnston wrote: How do I take 2007-02-01 and turn it into Thursday, February 1, 2006? Simple question, except I don't know the answer :) This is all I see for now: http://ca.php.net/manual/en/function.px-date2string.php list($year, $month, $day)

Re: [PHP] PHP5 Commercial Development

2007-02-02 Thread Richard Lynch
On Thu, February 1, 2007 5:13 pm, Eric Gorr wrote: I haven't tracked this particular issue, but I know when PHP5 was first released is wasn't recommended in a commercial/production environment. However, a lot of time has passed and we're at v5.2 now...have things changed? Have GoogleYahoo, for

Re: [PHP] Year

2007-02-02 Thread Robert Cummings
On Fri, 2007-02-02 at 19:02 -0600, Richard Lynch wrote: On Fri, February 2, 2007 9:11 am, Dan Shirah wrote: I am trying to populate a dropdown list to contain the current year to 10 years in the future. Below is the code I'm using: ?PHP for ($y=0;$y=10;$y++) { $years=date

Re: [PHP] Who uses PHP

2007-02-02 Thread Richard Lynch
On Thu, February 1, 2007 9:19 am, Eric Gorr wrote: Well, if you do not know the answer to my particular question, I'm curious how might you respond to someone who says: PHP has to many security issues and should not be used with a user authentication system. We should use XXX.

Re: [PHP] Login script login

2007-02-02 Thread Stut
Richard Lynch wrote: And using a re-direct instead of an include is a shocking waste of HTTP resources imho, but that may not matter if traffic is low. I generally redirect there because on occasion the login process does stuff like clear out potentially pre-existing session data from another

Re: [PHP] Year

2007-02-02 Thread Richard Lynch
On Fri, February 2, 2007 7:41 pm, Robert Cummings wrote: for ($year = date('Y'); $year = date('Y') + 10; $year++){ $short_year = $year - 2000; $short_year = sprintf('%02d', $short_year); echo option value=\$short_year\$year/option\n; } Using the 2-digit year as your value is almost for

Re: [PHP] Year

2007-02-02 Thread Robert Cummings
On Fri, 2007-02-02 at 20:08 -0600, Richard Lynch wrote: On Fri, February 2, 2007 7:41 pm, Robert Cummings wrote: function 10 times by embedding it in the loop's terminate condition? Because 10 calls to date() is chump-change. 10 chumps here, 10 there, 100 there, sloppy here, sloppy there,

[PHP] Recommend PHP Flash 8 book?

2007-02-02 Thread Skip Evans
Hey all, We're going to be developing some PHP and Flash 8 applications and was wondering what books or online tutorials people might recommend. I've Googled a few online resources but nothing terribly complete yet. Any resources that have become favorites would be greatly appreciated.

Re: [PHP] Graphs

2007-02-02 Thread frank
yes it does a great job, almost every parameter even for the legend can be influenced by its methods and properties. i say jp graph is the best fra* JP Graph is always mentioned in this list. I generally just do GD directly, to get things laid out the way I want, instead of sort of kind of