-1

hpw to store a permanent value in php variable?
for eg input.php
<form action = "output.php" method = "post">
<input type = "text" name = "q">
<input = "submit">

</form>

now output.php
<?php $a = $_POST['q']; echo $a;?>
now when we upload output.php in new tab it has no value can i use storage classes for permently store data.

2
Contributors
5
Replies
9
Views
3 Years
Discussion Span
Last Post by Ryan_12
0

You forgot the <input type="submit" /> at the end of your form.. What I mean is you just wrote ="submit" without the 'type' identifier

EDIT: you could also use

<button type="submit"></button>

Aside from that mistake.. HTTP POST requests don't inherently allow for persistence. You need to have either a database, write your data to a file, or store it in a session variable to achieve what you want.

Edited by Ryan_12

0

Read what I said above:

Aside from that mistake.. HTTP POST requests don't inherently allow for persistence. You need to have either a database, write your data to a file, or store it in a session variable to achieve what you want.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.