0

I have been trying to add a button to pie register's login form by adding the following code in the plugins/pie-register/login_form.php file

$form_data .= '<form method="link" action="'.pie_registration_url().'">
               <input type="submit" id="login-create-acct" value="Create Your Free Account" /></form>'

Basically, instead of their register link, I would like to add a create account button.

The button appears on the form no problem. However, when I click it, instead of linking to the registration form, it instead thinks that I am attempting to login and gives me an "invalid login details" message.

all help is appreciated, thanks in advance.

bob
  • 227
  • 3
  • 17
  • Thanks for the response, however, this did not solve the issue. I tried changing to both "get" and "post" to no avail. Still getting "invalid login" message. – bob Aug 12 '14 at 18:46
  • You're welcome. Any way to see more code, including what's inside `pie_registration_url()` function? I posted an answer below. Have you looked at it? – Funk Forty Niner Aug 12 '14 at 18:47
  • Also, instead of `action="'.pie_registration_url().'"` have you tried using the file itself `action="handler.php"` or just doing `action=""` if your entire code is inside the same page. – Funk Forty Niner Aug 12 '14 at 18:54

1 Answers1

0

I believe you may have stumbled on this link (or another page with the same "link" method):
- http://www.htmlgoodies.com/tutorials/buttons/article.php/3478871

which contains (from what I found)

<FORM METHOD="LINK" ACTION="page1.htm">
<INPUT TYPE="submit" VALUE="Clickable Button">
</FORM>

I suggest you use (or try) <form method="post" or <form method="get" depending on the method you wish to use in conjunction with the rest of your code, that isn't posted.

Code being and related to your pie_registration_url() function.

In using your present method and assuming you have something similar to:

<?php
$name = $_POST['name'];
echo $name;

and using Name: <input type="text" name="name"> in the form,
would translate to http://www.example.com/page.php?name=Bob

and would not be properly parsed by PHP.

You may need to do something like

<?php
$name = $_REQUEST['name'];
echo $name;

Here is another finding which is related:

Community
  • 1
  • 1
Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141