Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread J DeBord
I've heard stories like this before, but never encountered it myself. I forgot to mention that it is a good idea to give your submit buttons a "value" attribute. Regardless of how the form is submitted, you should then have a value for ['submit']. Reminding the user that they must do anything oth

Re: [PHP]Some body test php6-dev version for mbs?

2009-08-28 Thread hack988 hack988
nobody have a solution for no-unicode php script with MBCS (Multiple Byte Character Set) run on php6? I have an wrong spelling for MBCS in OM.:( 2009/8/27 hack988 hack988 : >  I'm not sure,but one thing is that ,the code save as ANSI format will > throw Parse error in php6. > Sometime I don't like

Re: [PHP] Error when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread Keith
Ash, Ben, Thanks! For my web server, I can access to: ./httpdocs ./httpsdocs all the http documents are stored inside httpdocs and SSL documents inside httpsdocs. The web root you mean here is referred to ./httpdocs and ./httpsdocs or the parent directory of them? If I put the logfile inside

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread Keith
I've encountered issue with checking $_POST['submit'] if(isset($_POST['submit'])) {} If the form consists of checkbox/radio and text field, some of my forms can be submitted by just press [ENTER] at the end of one of the text field. In this case, the $_POST['submit'] is set even the submit

[PHP] Re: [PHP-WIN] Re: [PHP] Problem outputting MySQL Date field

2009-08-28 Thread John Meyer
Keith Davis wrote: But how are you getting the data from the db? Does $rowqry represent a call using the mysql_fetch_array() function? mysql_fetch_assoc() -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: [PHP-WIN] Re: [PHP] Problem outputting MySQL Date field

2009-08-28 Thread Keith Davis
But how are you getting the data from the db? Does $rowqry represent a call using the mysql_fetch_array() function? Sent from my magic iPhone, Keith Davis 214-906-5183 On Aug 28, 2009, at 7:39 PM, "John Meyer" wrote: Devendra Jadhav wrote: No need to do anything special. It should displa

Re: [PHP] Problem outputting MySQL Date field

2009-08-28 Thread Jim Lucas
John Meyer wrote: Devendra Jadhav wrote: No need to do anything special. It should display date as string. Can you provide little more information or code snippet? $tweettable .= preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', '$1',$row["TWEET_TEXT"]) . "" . "Sent at: "

Re: [PHP] Problem outputting MySQL Date field

2009-08-28 Thread John Meyer
Devendra Jadhav wrote: No need to do anything special. It should display date as string. Can you provide little more information or code snippet? $tweettable .= preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', '$1',$row["TWEET_TEXT"]) . "" . "Sent at: " . $rowqry["TWEET_

Re: [PHP] Converting URL's to hyperlinks.

2009-08-28 Thread LinuxManMikeC
If you have short php tags enabled, assuming you put the url in a variable called $url... click here otherwise... click here or a myriad of other ways... Depending if there are any special characters involved, there are a couple functions that would be useful for preparing the url before outpu

[PHP] Converting URL's to hyperlinks.

2009-08-28 Thread John Meyer
What sort of function would I need if I wanted to convert those URLs from plain jane text? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Problem outputting MySQL Date field

2009-08-28 Thread John Meyer
Is there anything special I have to do to output a mysql date field as text? When I try to output it nothing appears on the web page. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] vote package

2009-08-28 Thread Noel Butler
On Fri, 2009-08-28 at 08:33 -0400, Bob McConnell wrote: > > Forging IP addresses is actually quite simple. VMs do it all the time > when bridged to the real NIC. There are also some projects on Source > Forge designed to load test HTTP servers that do similar things. I have > an application I wr

Re: [PHP] File Open Prompt?

2009-08-28 Thread Dan Shirah
> > You will need to add some headers to the page to popup the prompt, at least > with > these. > > $filename = 'somefile.tif'; > $filesize = filesize($filename); > > header('Content-Type: application/force-download'); > header('Content-disposition: attachement; filename=' . $filename); > header('C

[PHP] PHPDFS on 20 amazon instances

2009-08-28 Thread Shane Hill
Hi folks, A few weeks ago I started a php project for building a highly scalable distributed file system similar to mogileFS. Well, I did just that and called it PHPDFS and I just completed a test of PHPDFS using 20 ec2 instances and PHPDFS performed quite well. I setup 20 (5 clients, 15 servers)

Re: [PHP] File Open Prompt?

2009-08-28 Thread Eric
- Original Message - From: "Ashley Sheridan" To: "Dan Shirah" Cc: "PHP General" Sent: Saturday, August 29, 2009 3:10 AM Subject: Re: [PHP] File Open Prompt? > On Fri, 2009-08-28 at 15:03 -0400, Dan Shirah wrote: > >> Greetings, >> >> I'm having a problem trying to get a file downlo

Re: [PHP] File Open Prompt?

2009-08-28 Thread Andrew Ballard
On Fri, Aug 28, 2009 at 3:03 PM, Dan Shirah wrote: > Greetings, > > I'm having a problem trying to get a file download prompt. > > Basically I have a page with image links. > > When the link is clicked, the user is directed to another page I have. That > page finds the image path based on the image

Re: [PHP] File Open Prompt?

2009-08-28 Thread Ashley Sheridan
On Fri, 2009-08-28 at 15:03 -0400, Dan Shirah wrote: > Greetings, > > I'm having a problem trying to get a file download prompt. > > Basically I have a page with image links. > > When the link is clicked, the user is directed to another page I have. That > page finds the image path based on the

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread J DeBord
If you want to check that a *form* was submiited, you need to at minimum check that one of the form elements exist in the post data, assuming the method is post. The submit button is a good one to use. Just checking that there *is* POST data isn't a great idea. Anyone can post anything. Checking fo

[PHP] File Open Prompt?

2009-08-28 Thread Dan Shirah
Greetings, I'm having a problem trying to get a file download prompt. Basically I have a page with image links. When the link is clicked, the user is directed to another page I have. That page finds the image path based on the image ID from the previous page. Once the image path is found I copy

Re: [PHP] safe_mode and inclusion of files don't work as documented

2009-08-28 Thread Lars Torben Wilson
2009/8/28 Nico Sabbi : > Hi, > I'm testing one of my sites in safe_mode, but I'm experiencing some > strangeness that is not documented. > > The settings are: > in php.ini: > include_path = > ".:/server/home/apache/php4/:/var/php/5.2/pear/:/usr/php/lib/ezcomponents-2008.2.2/" > > in the virtualhost

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread Martin Scotta
On Fri, Aug 28, 2009 at 1:59 PM, Ben Dunlap wrote: > > Well, as far as I'm aware $_SERVER isn't reliable from server to server. > > That said, I've never had a problem using it. > > Thanks -- I just looked it up and the manual says: "There is no > guarantee that every web server will provide any o

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread Ashley Sheridan
On Sat, 2009-08-29 at 01:09 +0800, Eric wrote: > - Original Message - > From: "Ashley Sheridan" > To: "Ben Dunlap" > Cc: > Sent: Saturday, August 29, 2009 12:51 AM > Subject: Re: [PHP] Re: Best way to test for form submission? > > > > On Fri, 2009-08-28 at 09:33 -0700, Ben Dunlap wrot

RE: [PHP] Date Comparison

2009-08-28 Thread David Stoltz
Hey Stuart - RTFM yourselfI did read it, and obviously misunderstood... I'm really sorry to bother you. I thought that was what a listserv like this was for - to ask questions... I'll try not to ask questions I should know the answer to next time. -Original Message- From: Stuart

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread Ben Dunlap
> Well, as far as I'm aware $_SERVER isn't reliable from server to server. > That said, I've never had a problem using it. Thanks -- I just looked it up and the manual says: "There is no guarantee that every web server will provide any of these; servers may omit some, or provide others not listed

[PHP] Re: Best way to test for form submission?

2009-08-28 Thread Shawn McKenzie
Adam Jimerson wrote: > This question might give away the fact that I am a php noob, but I am > looking for the best way to test for form submission in PHP. I know in > Perl this can be done with > > if (param) > > but I don't know if that will work with PHP. I have read the Learning > PHP 5 boo

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread Ashley Sheridan
On Fri, 2009-08-28 at 09:33 -0700, Ben Dunlap wrote: > I was surprised when no one recommended this: > >if ($_SERVER['REQUEST_METHOD'] == 'POST') > > So now I'm wondering if there's a pitfall to this method that I'm not > aware of... > > Thanks, > > Ben > Well, as far as I'm aware $_SERVE

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread Ben Dunlap
I was surprised when no one recommended this: if ($_SERVER['REQUEST_METHOD'] == 'POST') So now I'm wondering if there's a pitfall to this method that I'm not aware of... Thanks, Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread Ashley Sheridan
On Fri, 2009-08-28 at 12:28 -0400, tedd wrote: > At 4:49 PM +0100 8/28/09, Ashley Sheridan wrote: > > > > > > >I seem to always use the word! *smacks self on wrist* > > > >When I first came across it, it confused the hell out of me! Always > >running into these kinds of Javascript bugs in IE, it h

Re: [PHP] Error when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread Ashley Sheridan
On Fri, 2009-08-28 at 09:28 -0700, Ben Dunlap wrote: > > Which format should I used for log file? *.log or *.txt? > > Doesn't matter to PHP -- but you do need to provide a local path, not a URL. > > > [http://domain.com/log/logfile.*] or > > No... > > > [C:\some_path\domain.com\log\logfile.*] o

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread tedd
At 4:49 PM +0100 8/28/09, Ashley Sheridan wrote: > I seem to always use the word! *smacks self on wrist* When I first came across it, it confused the hell out of me! Always running into these kinds of Javascript bugs in IE, it has a much narrower field of 'safe' variable names, probably becaus

Re: [PHP] Error when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread Ben Dunlap
> Which format should I used for log file? *.log or *.txt? Doesn't matter to PHP -- but you do need to provide a local path, not a URL. > [http://domain.com/log/logfile.*] or No... > [C:\some_path\domain.com\log\logfile.*] or just Yes! Ben -- PHP General Mailing List (http://www.php.net/) T

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread Ashley Sheridan
On Fri, 2009-08-28 at 11:39 -0400, tedd wrote: > At 4:32 PM +0100 8/28/09, Ashley Sheridan wrote: > > > > > >I have noticed a bug with using a form element named action, which > >funnily enough only effects IE. If you need to do anything to or based > >on that action element in IE with Javascript,

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread tedd
At 4:32 PM +0100 8/28/09, Ashley Sheridan wrote: I have noticed a bug with using a form element named action, which funnily enough only effects IE. If you need to do anything to or based on that action element in IE with Javascript, it has a lot of problems differentiating the form element from

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread Ashley Sheridan
On Fri, 2009-08-28 at 11:29 -0400, tedd wrote: > At 3:10 PM +0100 8/28/09, Stuart wrote: > >2009/8/28 Eric : > > > Here is another way > >> > >> if (isset($_POST['username']) && $_POST['username'] != '') > >> { ... > > > >If you use this method then you'll completely ignore a form submission >

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread tedd
At 3:10 PM +0100 8/28/09, Stuart wrote: 2009/8/28 Eric : > Here is another way if (isset($_POST['username']) && $_POST['username'] != '') { ... If you use this method then you'll completely ignore a form submission if they've forgotten to enter a username. Detection and validation are two

Re: [PHP] Date Comparison

2009-08-28 Thread tedd
At 10:12 AM -0400 8/28/09, David Stoltz wrote: How to I ensure a variable date is not in the past, compared to the current date? Here's how I'm trying, unsuccessfully: $nextdate = "8/2/2009"; if(strtotime($nextdate)<=getdate()){ echo "Sorry, your next evaluation date cannot be in the p

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread Stuart
2009/8/28 Eric : > > - Original Message - > From: "Stuart" > To: "Eric" > Cc: ; "Adam Jimerson" > Sent: Friday, August 28, 2009 10:10 PM > Subject: Re: [PHP] Re: Best way to test for form submission? > > > 2009/8/28 Eric : >> >> - Original Message - >> From: "Adam Jimerson" >> T

Re: [PHP] Date Comparison

2009-08-28 Thread Stuart
2009/8/28 David Stoltz : > How to I ensure a variable date is not in the past, compared to the > current date? Here's how I'm trying, unsuccessfully: > > $nextdate = "8/2/2009"; > > if(strtotime($nextdate)<=getdate()){ > >        echo "Sorry, your next evaluation date cannot be in the past, > Click

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread Paul M Foster
On Fri, Aug 28, 2009 at 02:53:56PM +0100, Stuart wrote: > 2009/8/28 Adam Jimerson : > > On 08/27/2009 11:09 PM, Adam Jimerson wrote: > >> This question might give away the fact that I am a php noob, but I am > >> looking for the best way to test for form submission in PHP.  I know in > >> Perl thi

Re: [PHP] Error when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread Stuart
2009/8/28 Martin Scotta : > On Fri, Aug 28, 2009 at 10:39 AM, Ashley Sheridan > wrote: > >> On Fri, 2009-08-28 at 10:34 -0300, Martin Scotta wrote: >> > Actually there aren't a safe way to make a redirect >> > >> > We have 4 alternatives (correct me if I miss anything) to do a safe >> > redirec

[PHP] Date Comparison

2009-08-28 Thread David Stoltz
How to I ensure a variable date is not in the past, compared to the current date? Here's how I'm trying, unsuccessfully: $nextdate = "8/2/2009"; if(strtotime($nextdate)<=getdate()){ echo "Sorry, your next evaluation date cannot be in the past, Click BACK to continue."; exit;

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread Stuart
2009/8/28 Eric : > > - Original Message - > From: "Adam Jimerson" > To: > Sent: Friday, August 28, 2009 11:21 AM > Subject: [PHP] Re: Best way to test for form submission? > > >> On 08/27/2009 11:09 PM, Adam Jimerson wrote: >>> This question might give away the fact that I am a php noob,

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread Martin Scotta
what about a simple if( count( $_POST )) All you need is to check a form submission On Fri, Aug 28, 2009 at 10:55 AM, Eric wrote: > > - Original Message - > From: "Adam Jimerson" > To: > Sent: Friday, August 28, 2009 11:21 AM > Subject: [PHP] Re: Best way to test for form submission?

Re: [PHP] Error when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread Martin Scotta
On Fri, Aug 28, 2009 at 10:39 AM, Ashley Sheridan wrote: > On Fri, 2009-08-28 at 10:34 -0300, Martin Scotta wrote: > > Actually there aren't a safe way to make a redirect > > > > We have 4 alternatives (correct me if I miss anything) to do a safe > > redirection. > > Erm wtf?! > > The best bet

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread Eric
- Original Message - From: "Adam Jimerson" To: Sent: Friday, August 28, 2009 11:21 AM Subject: [PHP] Re: Best way to test for form submission? > On 08/27/2009 11:09 PM, Adam Jimerson wrote: >> This question might give away the fact that I am a php noob, but I am >> looking for the bes

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread Stuart
2009/8/28 Adam Jimerson : > On 08/27/2009 11:09 PM, Adam Jimerson wrote: >> This question might give away the fact that I am a php noob, but I am >> looking for the best way to test for form submission in PHP.  I know in >> Perl this can be done with >> >> if (param) >> >> but I don't know if that

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread Ashley Sheridan
On Thu, 2009-08-27 at 23:21 -0400, Adam Jimerson wrote: > On 08/27/2009 11:09 PM, Adam Jimerson wrote: > > This question might give away the fact that I am a php noob, but I am > > looking for the best way to test for form submission in PHP. I know in > > Perl this can be done with > > > > if (pa

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread Nitsan Bin-Nun
"; On Fri, Aug 28, 2009 at 5:21 AM, Adam Jimerson wrote: > On 08/27/2009 11:09 PM, Adam Jimerson wrote: > > This question might give away the fact that I am a php noob, but I am > > looking for the best way to test for form submission in PHP. I know in > > Perl this can be done with > > > > if

Re: [PHP] Error when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread Keith
Hi all, Yes, you are right, it was due to echo for testing purpose not been commented out prior to header(). However, there is hidden root cause too -- PHPMailer will echo invalid address to the screen. When I have tested with 1 valid email address and 1 invalid with someth...@locahost, PHPMai

[PHP] Re: Best way to test for form submission?

2009-08-28 Thread Adam Jimerson
On 08/27/2009 11:09 PM, Adam Jimerson wrote: > This question might give away the fact that I am a php noob, but I am > looking for the best way to test for form submission in PHP. I know in > Perl this can be done with > > if (param) > > but I don't know if that will work with PHP. I have read

[PHP] Best way to test for form submission?

2009-08-28 Thread Adam Jimerson
This question might give away the fact that I am a php noob, but I am looking for the best way to test for form submission in PHP. I know in Perl this can be done with if (param) but I don't know if that will work with PHP. I have read the Learning PHP 5 book and the only thing that was mention

Re: [PHP] Error when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread Ashley Sheridan
On Fri, 2009-08-28 at 10:34 -0300, Martin Scotta wrote: > Actually there aren't a safe way to make a redirect > > We have 4 alternatives (correct me if I miss anything) to do a safe > redirection. Erm wtf?! The best bet is always going with a header() redirect. The only time I've seen that

Re: [PHP] Error when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread Martin Scotta
On Fri, Aug 28, 2009 at 9:36 AM, Floyd Resler wrote: > Another solution would be to use JavaScript. In your process.php script > you could do this: > print<< >window.location.href="index.php" > > here; > > Not strictly a PHP solution but it works. > > Take care, > Floyd > > > On Aug 28

RE: [PHP] vote package

2009-08-28 Thread Bob McConnell
From: Ben Dunlap >> You might try to use the reported IP of the submitter, again unique, but >> that can be forged -- so again anyone can vote more than once. > > Can you say more about forging the reported IP? I've always been under > the impression that forging the source IP in a TCP session is

Re: [PHP] Error when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread Floyd Resler
Another solution would be to use JavaScript. In your process.php script you could do this: print<< window.location.href="index.php" here; Not strictly a PHP solution but it works. Take care, Floyd On Aug 28, 2009, at 5:34 AM, Ashley Sheridan wrote: On Fri, 2009-08-28 at 17:32 +080

RE: [PHP] user permissions

2009-08-28 Thread Bob McConnell
From: Ben Dunlap >> Yes, they offer an additional layer of granularity on permissions. The apps >> I write use groups and role to limit acces to certain functionality. The >> roles determine functional access to records, ie what the user can do with >> them. The groups membership determines what r

Re: [PHP] safe_mode and inclusion of files don't work as documented

2009-08-28 Thread Nico Sabbi
hack988 hack988 ha scritto: > add this > php_admin_value open_basedir > > done, but it doesn't make a difference: php_admin_value open_basedir "/server/home/nsabbi:/server/home/apache/php4:.:.." *Fatal error*: require_once() [function.require ]: Failed ope

Re: [PHP] safe_mode and inclusion of files don't work as documented

2009-08-28 Thread hack988 hack988
add this php_admin_value open_basedir 2009/8/28 Nico Sabbi : > Hi, > I'm testing one of my sites in safe_mode, but I'm experiencing some > strangeness that is not documented. > > The settings are: > in php.ini: > include_path = > ".:/server/home/apache/php4/:/var/php/5.2/pear/:/usr/php/lib/ezcomp

[PHP] safe_mode and inclusion of files don't work as documented

2009-08-28 Thread Nico Sabbi
Hi, I'm testing one of my sites in safe_mode, but I'm experiencing some strangeness that is not documented. The settings are: in php.ini: include_path = ".:/server/home/apache/php4/:/var/php/5.2/pear/:/usr/php/lib/ezcomponents-2008.2.2/" in the virtualhost config: php_admin_value safe_mod

[PHP] Error when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread Keith
I have a user sign up page that collects sign up information from user with form. This form will then be submitted to another process.php page for setting up the user account and send email to the user. After the email been sent out, the user will be directed back to homepage with header("locati

Re: [PHP] Calling extension function from another

2009-08-28 Thread hack988 hack988
I don't kown your mean,could you descript the question more detail? 2009/8/28 leledumbo : > > Is it possible to call a function that resides in an extension from another > extension? > -- > View this message in context: > http://www.nabble.com/Calling-extension-function-from-another-tp25185839p25

Re: [PHP] Error when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread hack988 hack988
Some Php's tigger info output to client before you set header.try this code first --- ob_start();//first line write this code <<>> header("location:index.php"); ob_end_flush(); --

Re: [PHP] Error when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread Ashley Sheridan
On Fri, 2009-08-28 at 17:32 +0800, Keith wrote: > I have a user sign up page that collects sign up information from user with > form. > This form will then be submitted to another process.php page for setting up > the user account and send email to the user. > After the email been sent out, the u

[PHP] Calling extension function from another

2009-08-28 Thread leledumbo
Is it possible to call a function that resides in an extension from another extension? -- View this message in context: http://www.nabble.com/Calling-extension-function-from-another-tp25185839p25185839.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing