# Form not passing data between directories

**URL:** <https://www.phphelp.com/t/form-not-passing-data-between-directories/36593>\
**Category:** General PHP Help\
**Created:** [September 30, 2025, 3:36pm UTC](https://www.phphelp.com/t/form-not-passing-data-between-directories/36593 "2025-09-30T15:36:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mackenzie27](https://www.phphelp.com/letter_avatar_proxy/v4/letter/m/e19b73/32.png) [@mackenzie27](https://www.phphelp.com/u/mackenzie27)\
**Post date:** [September 30, 2025, 3:36pm UTC](https://www.phphelp.com/t/form-not-passing-data-between-directories/36593/1 "2025-09-30T15:36:26Z")

</div>

I have a simple form that is not passing any data when I click the submit button.  
Here is the code for the form.

```auto
<form method="post" 
action="https://www.domain.com/play/<?php echo $playDirectory ?>/links">
		
<input type="hidden" name="playName" value="<?php echo $playName ?>">
	 
<input type="submit" name="submit" value="submit">
		
		</form>

```

The submit button successfully takes you to the correct landing page.  
The landing page has the following code:

`$playName=$_REQUEST['playName'];`

However, the request statement picks up no data from the form.  
When I echo $playName, it is empty.  
Please note that I have checked the source data for the form  
and the form DOES contain the data for $playName.  
For some reason, however, the form  
does not SEND the data when I click on “submit”.

I have tried adding a dummy field like  
`<input type="hidden" name="test" value="test data">`

But the form will not send this data either.  
No data is picked up on the landing page  
when I use  
$\_REQUEST[‘test’];

The form is located two directories above the landing page –  
tho’ I don’t know why that should make any difference.  
The form “finds” the correct landing page.  
It just does not send any data to it.

NOTE: I have tried placing the landing page  
in the same directory as the form.  
In that case, the form works.  
For some reason, the data will not pass  
when the landing page is in a different directory,  
even though the form finds the page.

var\_dump shows no data received on landing page

```auto
var_dump($_POST);

```

---

<div class="post-metadata">

**Author:** ![mackenzie27](https://www.phphelp.com/letter_avatar_proxy/v4/letter/m/e19b73/32.png) [@mackenzie27](https://www.phphelp.com/u/mackenzie27)\
**Post date:** [September 30, 2025, 3:52pm UTC](https://www.phphelp.com/t/form-not-passing-data-between-directories/36593/2 "2025-09-30T15:52:27Z")

</div>

I finally figured it out. The landing page was an index.php page, but I did not explicitly add index.php to the form for the landing page URL. I figured that the URL automatically loaded the index.php page when one provided the directories above it – but it turns out you have to explicitly enter the index.php page in the address when using index.php as a landing page.
