Page 1 of 1

Can I post to the same page?

Posted: Thu Oct 29, 2009 1:38 pm
by bghayad
Hello;

If I need to post a form values, can I let this to be on the same page (I do not need to post to another page)?

How I can send the values of the icons when I am posting? I need to send the value of the listbox and the value of the text box and the value of the drop down icon?

Any advise?
Regards
Bilal

Re: Can I post to the same page?

Posted: Thu Oct 29, 2009 5:56 pm
by pickle
Those should all be posted & available in $_POST, if they're inside a form.

You can set a form to post to the current page, but it will still require a new pageload.

This will work if you're outputing your form from inside double quotes or heredocs (__URL__ I is a magical PHP constant):

Code: Select all

<form method = "post" action = "__URL__">
This will work otherwise, but I'm not sure how standards compliant it is:

Code: Select all

<form method = "post" action = "">