RE: [PHP] Self-Process php forms or not?

2009-10-01 Thread MEM
One last question about this:

I've done a self submit form, after hearing all the advantages expressed
here. 
But how could we relate, without using javascript, a self submit form with a
"success page" or a "confirmation page" that doesn't show the form?

Can please someone throw me some infos about this please?


Ps- I've googled: "php redirect success page on self submit form" and
similar... 



Regards, 
Márcio

> -Original Message-
> From: Bob McConnell [mailto:r...@cbord.com]
> Sent: sexta-feira, 24 de Abril de 2009 14:10
> To: PHP-General List
> Subject: RE: [PHP] Self-Process php forms or not?
> 
> When you have it all in one file, the first thing you do is check to
> see if this request was submitted from the form. If not, you send the
> blank form. If it was, you validate all of the data. When a validation
> fails, you add error messages and resend the form with any fields that
> passed the validation already filled in. When validation succeeds,
> process and move on. No muss, no fuss.
> 
> Bob McConnell
> 
> -Original Message-
> From: Sándor Tamás (HostWare Kft.) [mailto:sandorta...@hostware.hu]
> Sent: Friday, April 24, 2009 8:53 AM
> To: 'PHP-General List'
> Subject: Re: [PHP] Self-Process php forms or not?
> 
> I think the main advantage is that if something goes wrong processing
> the
> datas, you can show the form again without redirecting again.
> 
> And if you have to change the behavior of the page, you have to change
> only
> one file instead of two.
> 
> SanTa
> 
> - Original Message -
> From: "MEM" 
> To: "'PHP-General List'" 
> Sent: Friday, April 24, 2009 2:34 PM
> Subject: [PHP] Self-Process php forms or not?
> 
> 
> I'm trying to understand the advantages behind opting by using a
> Self-Process PHP Form, instead of having a form and then point the
> action of
> the form to another .php page.
> 
> Can anyone point me some resources about this. Why using one instead of
> another. What are the main advantages?
> 
> 
> 
> Regards,
> Márcio
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Self-Process php forms or not?

2009-10-01 Thread Mert Oztekin
May be it is best time to for you to start using Zend Framework -> Zend_Form

-Original Message-
From: MEM [mailto:tal...@gmail.com]
Sent: Thursday, October 01, 2009 3:01 PM
To: 'Bob McConnell'; 'PHP-General List'
Subject: RE: [PHP] Self-Process php forms or not?

One last question about this:

I've done a self submit form, after hearing all the advantages expressed
here.
But how could we relate, without using javascript, a self submit form with a
"success page" or a "confirmation page" that doesn't show the form?

Can please someone throw me some infos about this please?


Ps- I've googled: "php redirect success page on self submit form" and
similar...



Regards,
Márcio

> -Original Message-
> From: Bob McConnell [mailto:r...@cbord.com]
> Sent: sexta-feira, 24 de Abril de 2009 14:10
> To: PHP-General List
> Subject: RE: [PHP] Self-Process php forms or not?
>
> When you have it all in one file, the first thing you do is check to
> see if this request was submitted from the form. If not, you send the
> blank form. If it was, you validate all of the data. When a validation
> fails, you add error messages and resend the form with any fields that
> passed the validation already filled in. When validation succeeds,
> process and move on. No muss, no fuss.
>
> Bob McConnell
>
> -Original Message-
> From: Sándor Tamás (HostWare Kft.) [mailto:sandorta...@hostware.hu]
> Sent: Friday, April 24, 2009 8:53 AM
> To: 'PHP-General List'
> Subject: Re: [PHP] Self-Process php forms or not?
>
> I think the main advantage is that if something goes wrong processing
> the
> datas, you can show the form again without redirecting again.
>
> And if you have to change the behavior of the page, you have to change
> only
> one file instead of two.
>
> SanTa
>
> - Original Message -
> From: "MEM" 
> To: "'PHP-General List'" 
> Sent: Friday, April 24, 2009 2:34 PM
> Subject: [PHP] Self-Process php forms or not?
>
>
> I'm trying to understand the advantages behind opting by using a
> Self-Process PHP Form, instead of having a form and then point the
> action of
> the form to another .php page.
>
> Can anyone point me some resources about this. Why using one instead of
> another. What are the main advantages?
>
>
>
> Regards,
> Márcio
>
>
> --
> 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


Bu mesaj ve ekleri, mesajda gönderildiği belirtilen kişi/kişilere özeldir ve 
gizlidir. Size yanlışlıkla ulaşmışsa lütfen gönderen kisiyi bilgilendiriniz ve 
mesajı sisteminizden siliniz. Mesaj ve eklerinin içeriği ile ilgili olarak 
şirketimizin herhangi bir hukuki sorumluluğu bulunmamaktadır. Şirketimiz 
mesajın ve bilgilerinin size değişikliğe uğrayarak veya geç ulaşmasından, 
bütünlüğünün ve gizliliğinin korunamamasından, virüs içermesinden ve bilgisayar 
sisteminize verebileceği herhangi bir zarardan sorumlu tutulamaz.

This message and attachments are confidential and intended for the 
individual(s) stated in this message. If you received this message in error, 
please immediately notify the sender and delete it from your system. Our 
company has no legal responsibility for the contents of the message and its 
attachments. Our company shall have no liability for any changes or late 
receiving, loss of integrity and confidentiality, viruses and any damages 
caused in anyway to your computer system.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP/MySQL Superstars

2009-10-01 Thread Jerome Botbol
Hi All,

We require a PHP / MySQL superstar to work in-house at our offices near
Edgware, London for 3 months on a ground breaking new web 2.0 project
which involves a variety of exciting new technologies. You will need at
least 2 years proven experience on commercial projects. Relevant
experience on the CI framework is a must.

You will be working with an actionscript and front-end XHTML developer,
a framework developer who is providing a database design and class
system and a design team.

Please email your CV to j...@cyber-duck.co.uk (reference PG-tech-01)  or
feel free to contact me directly. 

Please let me know if this is of interest to you.

Kind regards

Jerome 

Operations Manager | Cyber-Duck Ltd | 
020 8736 0920

 

 



Re: [PHP] Self-Process php forms or not?

2009-10-01 Thread Tom Worster
On 10/1/09 8:00 AM, "MEM"  wrote:

> One last question about this:
> 
> I've done a self submit form, after hearing all the advantages expressed
> here. 
> But how could we relate, without using javascript, a self submit form with a
> "success page" or a "confirmation page" that doesn't show the form?
> 
> Can please someone throw me some infos about this please?

i use one php script that knows how to deliver more than one html page
depending on the outcome of processing of form input and the rest.

i'm sure there are other ways.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Self-Process php forms or not?

2009-10-01 Thread Jason
I've used the form page with a the following code (at the bottom - but
before any output is done) to redirect to a thank you page:

if ($submittedcorrectly)
{
  header("Location: thankyou.htm"); 
  exit();
}

HTH
J

-Original Message-
From: MEM [mailto:tal...@gmail.com] 
Sent: 01 October 2009 13:01
To: 'Bob McConnell'; 'PHP-General List'
Subject: RE: [PHP] Self-Process php forms or not?

One last question about this:

I've done a self submit form, after hearing all the advantages expressed
here. 
But how could we relate, without using javascript, a self submit form with a
"success page" or a "confirmation page" that doesn't show the form?

Can please someone throw me some infos about this please?


Ps- I've googled: "php redirect success page on self submit form" and
similar... 



Regards, 
Márcio

> -Original Message-
> From: Bob McConnell [mailto:r...@cbord.com]
> Sent: sexta-feira, 24 de Abril de 2009 14:10
> To: PHP-General List
> Subject: RE: [PHP] Self-Process php forms or not?
> 
> When you have it all in one file, the first thing you do is check to
> see if this request was submitted from the form. If not, you send the
> blank form. If it was, you validate all of the data. When a validation
> fails, you add error messages and resend the form with any fields that
> passed the validation already filled in. When validation succeeds,
> process and move on. No muss, no fuss.
> 
> Bob McConnell
> 
> -Original Message-
> From: Sándor Tamás (HostWare Kft.) [mailto:sandorta...@hostware.hu]
> Sent: Friday, April 24, 2009 8:53 AM
> To: 'PHP-General List'
> Subject: Re: [PHP] Self-Process php forms or not?
> 
> I think the main advantage is that if something goes wrong processing
> the
> datas, you can show the form again without redirecting again.
> 
> And if you have to change the behavior of the page, you have to change
> only
> one file instead of two.
> 
> SanTa
> 
> - Original Message -
> From: "MEM" 
> To: "'PHP-General List'" 
> Sent: Friday, April 24, 2009 2:34 PM
> Subject: [PHP] Self-Process php forms or not?
> 
> 
> I'm trying to understand the advantages behind opting by using a
> Self-Process PHP Form, instead of having a form and then point the
> action of
> the form to another .php page.
> 
> Can anyone point me some resources about this. Why using one instead of
> another. What are the main advantages?
> 
> 
> 
> Regards,
> Márcio
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST without POSTing

2009-10-01 Thread Tommy Pham
- Original Message 
> From: Daniel Brown 
> To: Paul M Foster 
> Cc: php-general@lists.php.net
> Sent: Wednesday, September 30, 2009 9:58:18 PM
> Subject: Re: [PHP] POST without POSTing
> 
> On Thu, Oct 1, 2009 at 00:41, Paul M Foster wrote:
> >
> > fsockopen() appears to be part of the standard network functions in PHP,
> > like the header() function. Do you mean that many hosts support the
> > function (as part of PHP) but don't support its use with external hosts?
> > Is there a way to determine this support from looking at phpinfo()?
> 
> fsockopen() is a socket function, as the name suggests.  Hosts can
> disable the usage of sockets.  In fact, check Google and you'll see
> several folks complaining of their host having it disabled.

If the service provider uses jails on *BSD, then sockets are definitely 
disabled for security reasons.  They don't want you to hack into other people's 
jail(s) ;)

> 
> As for fopen(), there's a php.ini value `allow_url_fopen` that a
> lot of hosts have set to 'no,' I'm sure with the intent to increase
> security but when you can still use cURL and exec('wget'), it kind
> of defeats the purpose.
> 
> -- 
> 
> daniel.br...@parasane.net || danbr...@php.net
> http://www.parasane.net/ || http://www.pilotpig.net/
> Check out our great hosting and dedicated server deals at
> http://twitter.com/pilotpig
> 
> -- 
> 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] Self-Process php forms or not?

2009-10-01 Thread Tommy Pham
 Original Message 
> From: Mert Oztekin 
> To: MEM ; Bob McConnell ; PHP-General List 
> 
> Sent: Thursday, October 1, 2009 5:16:40 AM
> Subject: RE: [PHP] Self-Process php forms or not?
> 
> May be it is best time to for you to start using Zend Framework -> Zend_Form
> 
> -Original Message-
> From: MEM [mailto:tal...@gmail.com]
> Sent: Thursday, October 01, 2009 3:01 PM
> To: 'Bob McConnell'; 'PHP-General List'
> Subject: RE: [PHP] Self-Process php forms or not?
> 
> One last question about this:
> 
> I've done a self submit form, after hearing all the advantages expressed
> here.
> But how could we relate, without using javascript, a self submit form with a
> "success page" or a "confirmation page" that doesn't show the form?
> 
> Can please someone throw me some infos about this please?
> 

Use of javascript to validate form is not required but will help with 
(processing) load on the server side.  However, you should always validate and 
sanitize all user input on server side if you want to maintain good data 
integrity in your DB and security.  Why?  In case someone uses cURL or another 
TCP app to do GET/POST to your app (server)  ;)  As for redirecting w/o 
javascript, it's easy.  Here's a sample:

entryForm.php post to $self or other $url > $self / $url validates the form >
* if valid form > redirect via header()
 or > include/require another modular page  (suggested)
* else invalid form > show entryForm.php with errors

You can either pass the variables via GET in your redirect or use $_SESSION 
variables.  I prefer $_SESSION since you really make your app modular and have 
access to those variables from any include/require page.  If you're really 
innovative, you could expand on it to have more performance ;)

Regards,
Tommy

> 
> Ps- I've googled: "php redirect success page on self submit form" and
> similar...
> 
> 
> 
> Regards,
> Márcio
> 
> > -Original Message-
> > From: Bob McConnell [mailto:r...@cbord.com]
> > Sent: sexta-feira, 24 de Abril de 2009 14:10
> > To: PHP-General List
> > Subject: RE: [PHP] Self-Process php forms or not?
> >
> > When you have it all in one file, the first thing you do is check to
> > see if this request was submitted from the form. If not, you send the
> > blank form. If it was, you validate all of the data. When a validation
> > fails, you add error messages and resend the form with any fields that
> > passed the validation already filled in. When validation succeeds,
> > process and move on. No muss, no fuss.
> >
> > Bob McConnell
> >
> > -Original Message-
> > From: Sándor Tamás (HostWare Kft.) [mailto:sandorta...@hostware.hu]
> > Sent: Friday, April 24, 2009 8:53 AM
> > To: 'PHP-General List'
> > Subject: Re: [PHP] Self-Process php forms or not?
> >
> > I think the main advantage is that if something goes wrong processing
> > the
> > datas, you can show the form again without redirecting again.
> >
> > And if you have to change the behavior of the page, you have to change
> > only
> > one file instead of two.
> >
> > SanTa
> >
> > - Original Message -
> > From: "MEM" 
> > To: "'PHP-General List'" 
> > Sent: Friday, April 24, 2009 2:34 PM
> > Subject: [PHP] Self-Process php forms or not?
> >
> >
> > I'm trying to understand the advantages behind opting by using a
> > Self-Process PHP Form, instead of having a form and then point the
> > action of
> > the form to another .php page.
> >
> > Can anyone point me some resources about this. Why using one instead of
> > another. What are the main advantages?
> >
> >
> >
> > Regards,
> > Márcio
> >
> >
> > --
> > 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
> 
> 
> Bu mesaj ve ekleri, mesajda gönderildiği belirtilen kişi/kişilere özeldir ve 
> gizlidir. Size yanlışlıkla ulaşmışsa lütfen gönderen kisiyi bilgilendiriniz 
> ve 
> mesajı sisteminizden siliniz. Mesaj ve eklerinin içeriği ile ilgili olarak 
> şirketimizin herhangi bir hukuki sorumluluğu bulunmamaktadır. Şirketimiz 
> mesajın 
> ve bilgilerinin size değişikliğe uğrayarak veya geç ulaşmasından, 
> bütünlüğünün 
> ve gizliliğinin korunamamasından, virüs içermesinden ve bilgisayar 
> sisteminize 
> verebileceği herhangi bir zarardan sorumlu tutulamaz.
> 
> This message and attachments are confidential and intended for the 
> individual(s) 
> stated in this message. If you received this message in error, please 
> immediately notify the sender and delete it from your system. Our company has 
> no 
> legal responsibility for the contents of the message and its attachments. Our 
> company shall have no liability for any changes or late receiving, loss of 
> integrity and confidentiality, viruses and any damages caused i

RE: [PHP] Self-Process php forms or not?

2009-10-01 Thread tedd

At 1:00 PM +0100 10/1/09, MEM wrote:

One last question about this:

I've done a self submit form, after hearing all the advantages expressed
here.
But how could we relate, without using javascript, a self submit form with a
"success page" or a "confirmation page" that doesn't show the form?

Can please someone throw me some infos about this please?



MEM:

Here's what I do -- it's pretty simple.

I use a hidden input variable I call "step" and monitor it as the 
user clicks whatever form submit they are on -- it works like so:


$step = isset($_POST['step']) ? $_POST['step'] : 0;

switch ($step)
   {
  case 0: // present the first form to the user
  // collect data
  // you can enhance the user experience by using javascript here.
  // 
   break;

  case 1: // present second form to the user
  // clean data
  // if data OK then record data in db 
  // if data not OK then send user back 
   break;

  case 2: //present the third form to the user
  // success, or confirmation, or thank you page
   break;
   }

Now, to make things easier for the user, be sure to set session 
variables for all the data collected in the first form so that IF you 
send the user back to the first form, the user doesn't have to 
reenter everything.


HTH,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Self-Process php forms or not?

2009-10-01 Thread Ashley Sheridan
On Thu, 2009-10-01 at 09:30 -0400, Tom Worster wrote:
> On 10/1/09 8:00 AM, "MEM"  wrote:
> 
> > One last question about this:
> > 
> > I've done a self submit form, after hearing all the advantages expressed
> > here. 
> > But how could we relate, without using javascript, a self submit form with a
> > "success page" or a "confirmation page" that doesn't show the form?
> > 
> > Can please someone throw me some infos about this please?
> 
> i use one php script that knows how to deliver more than one html page
> depending on the outcome of processing of form input and the rest.
> 
> i'm sure there are other ways.
> 
> 
> 

The way I always tend to do something like this is as follows:

$errors = false;
if(isset($_REQUEST['submit']))
{
// process form here
// if it doesn't validate $errors to true

// you can either redirect here, or display the confirmation message
}
if(!isset($_REQUEST['submit']) || $errors)
{
// display form
// if $errors is true populate the form with user submitted data
}


Thanks,
Ash
http://www.ashleysheridan.co.uk




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST without POSTing

2009-10-01 Thread Kirk . Johnson
Paul M Foster  wrote on 09/30/2009 09:29:17 PM:

> [PHP] POST without POSTing
> 
> Paul M Foster 
> 
> to:
> 
> php-general
> 
> 09/30/2009 09:31 PM
> 
> I have a form that collects certain info via POST. It is re-entrant, so
> when the user hits the "submit" button, it checks the input and does
> whatever sanity checks it needs to. If all is okay, it must now pass
> some of that info to another URL (offsite) via POST. Normally, the
> information would be passed via a series of GET variables or SESSION
> variables. But in this case the site the user is being directed to must
> receive the information via POST.

Google "posttohost rasmus". It's a classic from the Master at the turn of 
the century ;)

Kirk

Re: [PHP] Self-Process php forms or not?

2009-10-01 Thread Tom Worster
On 10/1/09 10:13 AM, "tedd"  wrote:

> At 1:00 PM +0100 10/1/09, MEM wrote:
>> One last question about this:
>> 
>> I've done a self submit form, after hearing all the advantages expressed
>> here.
>> But how could we relate, without using javascript, a self submit form with a
>> "success page" or a "confirmation page" that doesn't show the form?
>> 
>> Can please someone throw me some infos about this please?
> 
> 
> MEM:
> 
> Here's what I do -- it's pretty simple.
> 
> I use a hidden input variable I call "step" and monitor it as the
> user clicks whatever form submit they are on -- it works like so:
> 
> $step = isset($_POST['step']) ? $_POST['step'] : 0;
> 
> switch ($step)
> {
>case 0: // present the first form to the user
>// collect data
>// you can enhance the user experience by using javascript here.
>// 
> break;
> 
>case 1: // present second form to the user
>// clean data
>// if data OK then record data in db 
>// if data not OK then send user back 
> break;
> 
>case 2: //present the third form to the user
>// success, or confirmation, or thank you page
> break;
> }
> 
> Now, to make things easier for the user, be sure to set session
> variables for all the data collected in the first form so that IF you
> send the user back to the first form, the user doesn't have to
> reenter everything.

i do pretty much the same thing. each form in my html template files has a
form name tucked away in a hidden input element. the only difference from
your method is that the names are unique across the application.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST without POSTing

2009-10-01 Thread Paul M Foster
On Wed, Sep 30, 2009 at 11:36:55PM -0400, Daniel Brown wrote:

> On Wed, Sep 30, 2009 at 23:29, Paul M Foster  wrote:
> >
> > I'm not sure how to do this. Please no exotic external libraries my
> > shared hosting provider doesn't include. RTFM will be fine; just tell me
> > which Fine Manual to Read.
> 
> Nothing too exotic at all, Paul.  Check out cURL:
> 
> http://php.net/curl

Okay, I've figured out how to shove the data through cURL to the
receiving URL, but then it occurred to me that the client browser must
go there *as well*.

Will curl_exec() do that on its own, or is there a parameter I need to
feed it?

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST without POSTing

2009-10-01 Thread Daniel Brown
On Thu, Oct 1, 2009 at 16:14, Paul M Foster  wrote:
>
> Okay, I've figured out how to shove the data through cURL to the
> receiving URL, but then it occurred to me that the client browser must
> go there *as well*.
>
> Will curl_exec() do that on its own, or is there a parameter I need to
> feed it?

So you need to have the *client* post the information?  You may
want to look into a JavaScript solution, like an
onload/document.form.post action.

-- 

daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Check out our great hosting and dedicated server deals at
http://twitter.com/pilotpig

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: PHP/MySQL Superstars

2009-10-01 Thread Manuel Lemos
Hello,

on 10/01/2009 10:09 AM Jerome Botbol said the following:
> Hi All,
> 
> We require a PHP / MySQL superstar to work in-house at our offices near
> Edgware, London for 3 months on a ground breaking new web 2.0 project
> which involves a variety of exciting new technologies. You will need at
> least 2 years proven experience on commercial projects. Relevant
> experience on the CI framework is a must.
> 
> You will be working with an actionscript and front-end XHTML developer,
> a framework developer who is providing a database design and class
> system and a design team.
> 
> Please email your CV to j...@cyber-duck.co.uk (reference PG-tech-01)  or
> feel free to contact me directly. 
> 
> Please let me know if this is of interest to you.

You may want to submit your job post in the PHPClasses job board. There
are many thousands of PHP developers registered to get notifications
about jobs that match their skills.

http://www.phpclasses.org/jobs/

If you prefer to tune your search by country and skill, you may want to
browse the PHP professionals directory and check the skills in the
search form as you wish:

http://www.phpclasses.org/professionals/


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP/MySQL Superstars

2009-10-01 Thread Robert Cummings

I'm a superstar... send me a check for $500,000 and I'll fly on over.

Or did you completely misuse the word "superstar"?

Cheers,
Rob.




Jerome Botbol wrote:

Hi All,

We require a PHP / MySQL superstar to work in-house at our offices near
Edgware, London for 3 months on a ground breaking new web 2.0 project
which involves a variety of exciting new technologies. You will need at
least 2 years proven experience on commercial projects. Relevant
experience on the CI framework is a must.

You will be working with an actionscript and front-end XHTML developer,
a framework developer who is providing a database design and class
system and a design team.

Please email your CV to j...@cyber-duck.co.uk (reference PG-tech-01)  or
feel free to contact me directly. 


Please let me know if this is of interest to you.

Kind regards

Jerome 


Operations Manager | Cyber-Duck Ltd | 
020 8736 0920

 

 





--
http://www.interjinn.com
Application and Templating Framework for PHP

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: POST without POSTing

2009-10-01 Thread Jeff Brown

Paul M Foster wrote:

I'm sure this has been covered before, but I'm not even sure how to
search in the archives for it.

I have a form that collects certain info via POST. It is re-entrant, so
when the user hits the "submit" button, it checks the input and does
whatever sanity checks it needs to. If all is okay, it must now pass
some of that info to another URL (offsite) via POST. Normally, the
information would be passed via a series of GET variables or SESSION
variables. But in this case the site the user is being directed to must
receive the information via POST.

I'm not sure how to do this. Please no exotic external libraries my
shared hosting provider doesn't include. RTFM will be fine; just tell me
which Fine Manual to Read.

Paul



Answering in general to a lot of the above responses.

You don't need to care if the 'foreign' host supports fsockopen or curl,
only if your form hosting host does.  (Boy that looks more confusing in 
re-read than it felt writing it ;D ...  )


To the foreign redirect target, both curl and fsockopen are supposed to 
look like a browser hitting the site.


So if your site allows curl or fsockopen, then you're golden.

jeff

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST without POSTing

2009-10-01 Thread Paul M Foster
On Thu, Oct 01, 2009 at 04:23:46PM -0400, Daniel Brown wrote:

> On Thu, Oct 1, 2009 at 16:14, Paul M Foster  wrote:
> >
> > Okay, I've figured out how to shove the data through cURL to the
> > receiving URL, but then it occurred to me that the client browser must
> > go there *as well*.
> >
> > Will curl_exec() do that on its own, or is there a parameter I need to
> > feed it?
> 
> So you need to have the *client* post the information?  You may
> want to look into a JavaScript solution, like an
> onload/document.form.post action.

Javascript would be a bad solution. If the user has this turned off,
they can't use the site.

Let me be less opaque. This is a page where a user will fill in some
personal information, and then select an amount to donate to this cause.
The intent is to pass some information that the merchant service company
needs (like merchant number and item selected) to their secure URL. The
problem is that, before I just pass the information off to them, I want
to make sure the user has properly filled out this form. So I have to
validate it. That's done in the background on the server, naturally. But
once the validating is done, it's time to send the user off to the
secure site with a payload of POST variables. At that point, the user
will enter credit card info and such, and continue the transaction.

So I need to find a way to direct the user's browser to the secure site
with their payload of POST variables. The more I look at this, the more
it looks like cURL won't do it, and Javascript has the obvious down
side.

I'm afraid the only way to do this may be to validate everything, pass
the values off to a confirmation page, where the user has to hit
"Proceed", and *that* page goes directly to the secure server with its
POST payload.

If anyone has a better idea, let me know. Hopefully I've explained it
adequately to make the problem clear.

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST without POSTing

2009-10-01 Thread Ben Dunlap
> to make sure the user has properly filled out this form. So I have to
> validate it. That's done in the background on the server, naturally. But
> once the validating is done, it's time to send the user off to the
> secure site with a payload of POST variables. At that point, the user
> will enter credit card info and such, and continue the transaction.

You're describing what a 307 redirect is supposed to accomplish:

header("Location: $secure_url", TRUE, 307);

But I've heard that not all browsers comply with the HTTP spec on this
point. Might be worth testing a bit, though -- maybe your typical
audience doesn't tend to use non-compliant browsers.

> So I need to find a way to direct the user's browser to the secure site
> with their payload of POST variables. The more I look at this, the more
> it looks like cURL won't do it, and Javascript has the obvious down
> side.
>
> I'm afraid the only way to do this may be to validate everything, pass
> the values off to a confirmation page, where the user has to hit
> "Proceed", and *that* page goes directly to the secure server with its
> POST payload.

That might actually be the best solution because it's the most
transparent, from the user's point-of-view. A 307 is going to cause
many browsers to pop up a confirmation dialog, which will freak some
users out -- and will break people's flow a lot more than would a
smoothly-executed two-stage submit.

Ben

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Incorrect _SERVER['SERVER_PORT'] returned??

2009-10-01 Thread Bob Schell
Hello.  I have configured my RHEL5 Apache system with SSL.  I verified that
SSL was installed correctly and accessing the site via SSL works as
expected.

The problem I am having is my PHP code is pulling the
$_SERVER['SERVER_PORT'] variable and this is coming back as 80 rather than
443.

Here is my  code within HTTPD.CONF




ServerAdmin first.n...@xyz.com

DocumentRoot /var/www/html/redcap

ServerName name.url.edu

ErrorLog logs/

CustomLog logs/


I can get 443 to be returned from _SERVER['SERVER_PORT'] if I edit the 3rd
line above to :

ServerName name.url.edu:443

But, if I do this, it messes a few other things up internal to the site.

Does anyone have an idea why _SERVER['SERVER_PORT'] is returning 80 rather
than 443?

Any thoughts would be much appreciated.

Regards,


[PHP] Parse Question Using list()

2009-10-01 Thread c...@hosting4days.com

newbie import csv question

file is like:

stuff1,stuff2,stuff3
stuff1,stuff2,stuff3
stuff1,stuff2,stuff3
stuff1,stuff2,stuff3

etc.


Problem: when I try to parse out the 3 fields and display them using  
list() it just gets just 1st char of each field ...
Q: How do I get it to set $col1 - 2 & $col3 to the full contents of  
each for each line (not just 1st char)?



'; // this shows the whole line ok

echo "c1 is $col1 and c2 is $col2 and c3 is $col3".''; // this  
shows just 1st char of each field



}

 ?>



Thanks,
c...@hosting4days.com






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Curl output

2009-10-01 Thread gbhumphrey

Hi, I am doing a basical curl call and can get the webpage I want. However
when it prints to the screen, it only prints the text, not css or any
javascript calls that run on page load.
Is there a way to make it do that?

thanks
using a basic curl call
$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_URL,'http://example.com');
curl_setopt($ch, CURLOPT_RETURNTRANSFER,0); // return into a variable
curl_exec($curl_handle);





-- 
View this message in context: 
http://www.nabble.com/Curl-output-tp25708385p25708385.html
Sent from the PHP - General mailing list archive at Nabble.com.


Re: [PHP] Parse Question Using list()

2009-10-01 Thread Ben Dunlap
> $line = fgets($handle);
>
> list($col1, $col2, $col3) = $line;
[8<]
> echo "c1 is $col1 and c2 is $col2 and c3 is $col3".''; // this shows
> just 1st char of each field

That's odd, I would have expected $col1, $col2, and $col3 to be NULL.
That's what I get when I try to assign a string to list(). It expects
a PHP array.

You could tackle this in a couple of different ways. Either split your
string into an array first:

$line = fgets($handle);
$columns = explode(",", trim($line));
list($col1,$col2,$col3) = $columns;

Or look at using fgetcsv(), which will save you a step or two:

http://php.net/manual/en/function.fgetcsv.php

Ben

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Self-Process php forms or not?

2009-10-01 Thread MEM
Thanks a lot to all,

I will see what best fits my limited knowledge, and choose the possible
option.

Regards,
Márcio

> -Original Message-
> From: Tom Worster [mailto:f...@thefsb.org]
> Sent: quinta-feira, 1 de Outubro de 2009 20:11
> To: tedd; 'PHP-General List'
> Subject: Re: [PHP] Self-Process php forms or not?
> 
> On 10/1/09 10:13 AM, "tedd"  wrote:
> 
> > At 1:00 PM +0100 10/1/09, MEM wrote:
> >> One last question about this:
> >>
> >> I've done a self submit form, after hearing all the advantages
> expressed
> >> here.
> >> But how could we relate, without using javascript, a self submit
> form with a
> >> "success page" or a "confirmation page" that doesn't show the form?
> >>
> >> Can please someone throw me some infos about this please?
> >
> >
> > MEM:
> >
> > Here's what I do -- it's pretty simple.
> >
> > I use a hidden input variable I call "step" and monitor it as the
> > user clicks whatever form submit they are on -- it works like so:
> >
> > $step = isset($_POST['step']) ? $_POST['step'] : 0;
> >
> > switch ($step)
> > {
> >case 0: // present the first form to the user
> >// collect data
> >// you can enhance the user experience by using javascript here.
> >// 
> > break;
> >
> >case 1: // present second form to the user
> >// clean data
> >// if data OK then record data in db  value=2>
> >// if data not OK then send user back  value=0>
> > break;
> >
> >case 2: //present the third form to the user
> >// success, or confirmation, or thank you page
> > break;
> > }
> >
> > Now, to make things easier for the user, be sure to set session
> > variables for all the data collected in the first form so that IF you
> > send the user back to the first form, the user doesn't have to
> > reenter everything.
> 
> i do pretty much the same thing. each form in my html template files
> has a
> form name tucked away in a hidden input element. the only difference
> from
> your method is that the names are unique across the application.
> 
> 
> 
> --
> 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] Parse Question Using list()

2009-10-01 Thread c...@hosting4days.com


On Oct 1, 2009, at 5:02 PM, Ben Dunlap wrote:


You could tackle this in a couple of different ways. Either split your
string into an array first:

$line = fgets($handle);
$columns = explode(",", trim($line));


Thanks Ben - the explode() command worked great!

-

Now a bit of another problem

I'm exporting from another database (mac) to a csv file then a quick  
import to excel 2004 (mac) for some cleaning...


before the excel import, some date fields look like "2009-9-29  
11:21:37"  = good for sql import


but excel does an auto reformat to

9/29/2009  11:21:37 AM = not good for sql import


Q: any way to turn this auto reformat off in excel and keep it the  
way I had it? (I saw nothing in pref's)



Thanks,
c...@hosting4days.com






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Curl output

2009-10-01 Thread Paul M Foster
On Thu, Oct 01, 2009 at 04:37:14PM -0700, gbhumphrey wrote:

> 
> Hi, I am doing a basical curl call and can get the webpage I want. However
> when it prints to the screen, it only prints the text, not css or any
> javascript calls that run on page load.
> Is there a way to make it do that?
> 
> thanks
> using a basic curl call
> $curl_handle=curl_init();
> curl_setopt($curl_handle,CURLOPT_URL,'http://example.com');
> curl_setopt($ch, CURLOPT_RETURNTRANSFER,0); // return into a variable
> curl_exec($curl_handle);

I don't know about the javascript, but if the CSS is an external file,
then it wouldn't get dragged along with the original file, and thus
wouldn't be there to style anything on the HTML page. Just a guess.

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Self-Process php forms or not?

2009-10-01 Thread Manuel Lemos
Hello,

on 10/01/2009 09:00 AM MEM said the following:
> One last question about this:
> 
> I've done a self submit form, after hearing all the advantages expressed
> here. 
> But how could we relate, without using javascript, a self submit form with a
> "success page" or a "confirmation page" that doesn't show the form?
> 
> Can please someone throw me some infos about this please?
> 
> 
> Ps- I've googled: "php redirect success page on self submit form" and
> similar... 

All you need to do is to include an hidden field in the form. Then check
the respective $_POST or $_GET variable is set. If it is not set, show
the form for the first time. If it is set, validate the form and process
it. If the form is not valid, show the form again with previously
submitted values.

This tutorial video explains this workflow:

http://www.phpclasses.org/browse/video/1/package/1/section/usage.html

This example script demonstrates how to setup your code. It uses a
function of a forms class name WasSubmiteed() to check if the form is
being presented for the first time or is being submitted:

http://www.meta-language.net/forms-examples.html?example=test_form&code=1

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Parse Question Using list()

2009-10-01 Thread Jim Lucas

c...@hosting4days.com wrote:


On Oct 1, 2009, at 5:02 PM, Ben Dunlap wrote:


You could tackle this in a couple of different ways. Either split your
string into an array first:

$line = fgets($handle);
$columns = explode(",", trim($line));


Thanks Ben - the explode() command worked great!



Use the tool that PHP provides for such problems.

http://php.net/fgetcsv


-

Now a bit of another problem

I'm exporting from another database (mac) to a csv file then a quick 
import to excel 2004 (mac) for some cleaning...


before the excel import, some date fields look like "2009-9-29 
11:21:37"  = good for sql import


but excel does an auto reformat to

9/29/2009  11:21:37 AM = not good for sql import


Q: any way to turn this auto reformat off in excel and keep it the way I 
had it? (I saw nothing in pref's)




try using strtotime() on that field and see if it works.

http://php.net/strtotime

I'm pretty sure that function will handle it.



Thanks,
c...@hosting4days.com









--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Curl output

2009-10-01 Thread Jim Lucas

gbhumphrey wrote:

Hi, I am doing a basical curl call and can get the webpage I want. However
when it prints to the screen, it only prints the text, not css or any
javascript calls that run on page load.
Is there a way to make it do that?

thanks
using a basic curl call
$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_URL,'http://example.com');
curl_setopt($ch, CURLOPT_RETURNTRANSFER,0); // return into a variable
curl_exec($curl_handle);







Along the lines of what Paul has already alluded to, you will probably find upon further examination 
of the html source that the "linked" files (js, css, etc...) are probably using relative paths, not 
absolute paths including the domain name.


To fix this, you would have to do a little source code rewriting to add the full domain name and 
directory path information to the "linked" in url structure.


I know if you do this with wget (cli app) that you can have it re-write the domain + path url 
references.  But, I'm not sure if cURL has an option for that.  You might RTM on the cURL options 
page to find out.


http://php.net/curl


--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] iconv - bad encoding

2009-10-01 Thread Jarosek

Hello

I noticed a problem using iconv, but investigation showed, that this is
not exectly the iconv itself, but something like php encoding.

From the beginning:

a hava an incoming variable $text;
it has some Polish diactics 'strona główna'.
I expect to remove diactics : 'strona glowna'.

So I use iconv: iconv('utf-8', 'us-ascii//TRANSLIT', $text)

and unfortunetly i get: 'strona g??wna' ... But only under apache, in
browser

The same file, command, etc run from bash gives: 'strona glowna' ... OK
So i think : "bad config", but double checked and configs are
identical... (cli and apache2)

Best part: for 2 or 3 times after starting computer (debian), it didn't
worker until I did: (apache start && apache stop - not apache restart),
then it worked. Now it doesn't work any more. No other config (except
php was changed).

Any ideas?





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php