Jump to content

Posting values from an input field


riavh

Recommended Posts

I am having trouble sending information that was entered into a form, on the same page to the next page.

 

I am sure i have done this a few years ago but cant find the code and cant find the answer online, hope someone can help me.

 

My code is as follows:

 

<form method="POST" action="https://.............. .asp ">

<table>

  <tr>

    <td>Name: </td>

    <td><input type="text" name="clientname" /></td>

  </tr>

  <tr>

    <td>E-mail:</td>

    <td><input type="text" name="email" /></td>

  </tr>

  <tr>

    <td>Contact No:</td>

    <td><input type="text" name="telno" /></td>

  </tr>

</table>

<?php

$udate = date("y-m-d H:i:s", strtotime ("+2 hour"));

$uniquevalue = "$udate" . " " . "Simpay Pro";

echo $uniquevalue;

?>

<br />

<input type="hidden" name="info1" value="<?php print $uniquevalue?>">

<input type="hidden" name="info2" value=$clientname>

<input type="submit" value="Submit">

</form>

 

So basically info1 is working i can see the value on the next page after its submitted, but info2 is the value of the input field.

 

Is this possible to do it like this, or do i have to send it to another page and then to my last page that displays the values?

 

 

Link to comment
https://forums.phpfreaks.com/topic/251190-posting-values-from-an-input-field/
Share on other sites

The values won't automatically end up in variables with the names of the form fields (at least they shouldn't on a well configured server), they'll be in the $_POST array after the form has been submitted.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.