[Solved] How to send data to another PHP file? [closed]


You want to transfer the id only to the next file? Use this in the first:

<a href="https://stackoverflow.com/questions/39648925/second.php?id=1">link_to_2</a>

or

<form...>
<input name="id" type="hidden" value="1">
<button type="submit">btn_to_2</button>
</form>

And in your second file use this for both cases:

<?= $_REQUEST['id'] ?>

solved How to send data to another PHP file? [closed]