Can I post to the same page?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
bghayad
Forum Newbie
Posts: 9
Joined: Thu Oct 29, 2009 1:13 pm

Can I post to the same page?

Post 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
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Can I post to the same page?

Post 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 = "">
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply