Can be a custom page a form?

edited November 2012 in General Discussion
I tried to make a form in a custom page

Is it possible to get the fields to the web server?

<form name="htmlform" method="post" action="http://mysite.com/np.php">
<table width="450px">
</tr>
<tr>
 <td valign="top">
  <label for="first_name">First Name *</label>
 </td>
 <td valign="top">
  <input  type="text" name="first_name" maxlength="50" size="30">
 </td>
</tr>
 
<tr>
 <td valign="top">
  <label for="email">Email Address *</label>
 </td>
 <td valign="top">
  <input  type="text" name="email" maxlength="80" size="30">
 </td>
 
</tr>
<tr>
 <td valign="top">
  <label for="p">Telephone Number</label>
 </td>
 <td valign="top">
  <input  type="text" name="telephone" maxlength="30" size="30">
 </td>
</tr>
 
</tr>
<tr>
 <td colspan="2" style="text-align:center">
  <input type="hidden" name="c" value="11">
  <input type="hidden" name="d" value="1">
  <input type="submit" value="Submit">
 </td>
</tr>
</table>
</form>

On the server I don't get any parameter. I was expecting to get something like:
http://mysite.com/np.php?f=xxxx&e=ab@cd.com&p=234566&c=11&d=1

but it seems no parameters are submitted.


Any ideas how to do that?

Comments

  • I changed to method get and then it worked, ...
  • If you want the variables to be passed in the URL, then use GET. However if you want the variables to be hidden from users (and log files), then use POST instead. It is much secure to use POST instead of GET.

    The only difference is you have to change your np.php code slightly to make it work, e.g.

    from $fname = $_GET["fname"]; to $fname = $_POST["fname"];

    i.e. the changes are done to how you read the passed variables, depending on whether you are using GET or POST

  • I just used Google Drive (docs) Form and embedded into Custom Page. Worked Sweet. Think it uses an iFrame. 
Sign In or Register to comment.