Page 1 of 1

Relative Form Actions

Posted: Fri Sep 29, 2006 5:15 pm
by LiveFree
Hey,

I am using Smarty to display a html form, and the form has the same action as the page that displayed the form (admin.php).

I have the <form method="POST" action="admin.php"> but when I test for that the admin.php page is recieving the POST input using an echo, nothing echoes out.,

So what Im asking is, what path do I need to put in the action paramater for the form to post to admin.php.

And for reference:

Path to Form: /styles/timberwolf/admin/login_body.htm
Path to Display File: admin.php/

Thanks!

Posted: Fri Sep 29, 2006 5:42 pm
by Burrito
what does it say in the url when you post what you've currently got? That's going to be your best clue as to where the script is going.

The tpl files can be anywhere on the hard drive, they have nothing to do with relative paths (unless you specifically set something within the template itself).

if I have my admin.php file and I use:

Code: Select all

$smarty->display("/some/path/to/some/tpl/file/blah.tpl");
if in that tpl file have a form with an action of admin.php, it should go straight back to the page that posted it.

check your url to see where it's going though.

Posted: Fri Sep 29, 2006 6:48 pm
by LiveFree
When I hit submit, it refreshes the page but the issue is I do not see any of the test code I have to see if PHP is picking up on the POST var

Code: Select all

if (isset($_POST['admin_login'])) {
And yes, Im sure that is the correct name for the submit button.

Thanks Burrito!

Posted: Fri Sep 29, 2006 7:21 pm
by Burrito
I've seen cases where that input element (type submit) is not passed in post array (in IE I think). Try a print_r() on your post array to see what it shows.