php-general Digest 2 Oct 2009 00:02:28 -0000 Issue 6368
Topics (messages 298434 through 298454):
Re: Self-Process php forms or not?
298434 by: Mert Oztekin
298437 by: Tom Worster
298438 by: Jason
298439 by: Ashley Sheridan
298440 by: Tommy Pham
298441 by: tedd
298443 by: Tom Worster
PHP/MySQL Superstars
298435 by: Jerome Botbol
298444 by: Manuel Lemos
298447 by: Robert Cummings
Re: POST without POSTing
298436 by: Tommy Pham
298442 by: Kirk.Johnson.zootweb.com
298445 by: Paul M Foster
298446 by: Daniel Brown
298448 by: Jeff Brown
298449 by: Paul M Foster
298450 by: Ben Dunlap
Incorrect _SERVER['SERVER_PORT'] returned??
298451 by: Bob Schell
Parse Question Using list()
298452 by: cool.hosting4days.com
298454 by: Ben Dunlap
Curl output
298453 by: gbhumphrey
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]
----------------------------------------------------------------------
--- Begin Message ---
May be it is best time to for you to start using Zend Framework -> Zend_Form
-----Original Message-----
From: MEM [mailto:[email protected]]
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:[email protected]]
> 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:[email protected]]
> 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" <[email protected]>
> To: "'PHP-General List'" <[email protected]>
> 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.
--- End Message ---
--- Begin Message ---
On 10/1/09 8:00 AM, "MEM" <[email protected]> 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.
--- End Message ---
--- Begin Message ---
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:[email protected]]
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:[email protected]]
> 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:[email protected]]
> 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" <[email protected]>
> To: "'PHP-General List'" <[email protected]>
> 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
--- End Message ---
--- Begin Message ---
On Thu, 2009-10-01 at 09:30 -0400, Tom Worster wrote:
> On 10/1/09 8:00 AM, "MEM" <[email protected]> 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
--- End Message ---
--- Begin Message ---
---- Original Message ----
> From: Mert Oztekin <[email protected]>
> To: MEM <[email protected]>; Bob McConnell <[email protected]>; PHP-General List
> <[email protected]>
> 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:[email protected]]
> 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:[email protected]]
> > 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:[email protected]]
> > 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
--- End Message ---
--- Begin Message ---
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.
// <input type=hidden name=step value=1>
break;
case 1: // present second form to the user
// clean data
// if data OK then record data in db <input type=hidden name=step value=2>
// if data not OK then send user back <input type=hidden name=step 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.
HTH,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
On 10/1/09 10:13 AM, "tedd" <[email protected]> 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.
> // <input type=hidden name=step value=1>
> break;
>
> case 1: // present second form to the user
> // clean data
> // if data OK then record data in db <input type=hidden name=step value=2>
> // if data not OK then send user back <input type=hidden name=step 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.
--- End Message ---
--- Begin Message ---
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 [email protected] (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 | <http://www.cyber-duck.co.uk/>
020 8736 0920
--- End Message ---
--- Begin Message ---
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 [email protected] (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/
--- End Message ---
--- Begin Message ---
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 [email protected] (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 | <http://www.cyber-duck.co.uk/>
020 8736 0920
--
http://www.interjinn.com
Application and Templating Framework for PHP
--- End Message ---
--- Begin Message ---
----- Original Message ----
> From: Daniel Brown <[email protected]>
> To: Paul M Foster <[email protected]>
> Cc: [email protected]
> 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.
>
> --
>
> [email protected] || [email protected]
> 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
--- End Message ---
--- Begin Message ---
Paul M Foster <[email protected]> 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
--- End Message ---
--- Begin Message ---
On Wed, Sep 30, 2009 at 11:36:55PM -0400, Daniel Brown wrote:
> On Wed, Sep 30, 2009 at 23:29, Paul M Foster <[email protected]> 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
--- End Message ---
--- Begin Message ---
On Thu, Oct 1, 2009 at 16:14, Paul M Foster <[email protected]> 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 P. Brown>
[email protected] || [email protected]
http://www.parasane.net/ || http://www.pilotpig.net/
Check out our great hosting and dedicated server deals at
http://twitter.com/pilotpig
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
On Thu, Oct 01, 2009 at 04:23:46PM -0400, Daniel Brown wrote:
> On Thu, Oct 1, 2009 at 16:14, Paul M Foster <[email protected]> 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
--- End Message ---
--- Begin Message ---
> 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
--- End Message ---
--- Begin Message ---
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 <VIRTUALHOST> code within HTTPD.CONF
<VirtualHost *:443>
ServerAdmin [email protected]
DocumentRoot /var/www/html/redcap
ServerName name.url.edu
ErrorLog logs/<filename>
CustomLog logs/<filename>
</VirtualHost>
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,
--- End Message ---
--- Begin Message ---
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)?
<?php
// on a mac but with windows linefeed returns in file
$handle = fopen("file:///path/_impfool/test.csv", "r");
while (!feof ($handle))
{
$line = fgets($handle);
list($col1, $col2, $col3) = $line;
echo $line.''.' line<br>'; // this shows the whole line ok
echo "c1 is $col1 and c2 is $col2 and c3 is $col3".'<br>'; // this
shows just 1st char of each field
}
?>
Thanks,
[email protected]
--- End Message ---
--- Begin Message ---
> $line = fgets($handle);
>
> list($col1, $col2, $col3) = $line;
[8<]
> echo "c1 is $col1 and c2 is $col2 and c3 is $col3".'<br>'; // 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
--- End Message ---
--- Begin Message ---
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.
--- End Message ---