-4

I try to capture the value of $app_id with the $_POST method to Index2.html with the code below and I can't.

The php code in html page don't change the color and that is the signal that the server doesn't work! I'm using Dreamweaver cs6 as editor

Index1.php:

$app_id = $_POST["appID"]

Index2.html:

<label for="appID"><?php $_POST['appID'] ?></label>
Rizier123
  • 58,877
  • 16
  • 101
  • 156
abelvf
  • 41
  • 2
  • 9
  • unless you've configured your server to treat .html files as a php script, this cannot possibly work. and even if you had, it'd have to be `` – Marc B Dec 18 '14 at 17:38
  • How do you want to use php: `` in a html document? Where is the logic hidden? Also what do you do if the variable is undefined... – Rizier123 Dec 18 '14 at 17:38
  • Are you including PHP code inside a HTML file? – bodruk Dec 18 '14 at 17:40
  • off course that the variable is defined and I have all necessary code I only post one portion of code and the point is that I cant catch the value of that variable in my html page – abelvf Dec 18 '14 at 17:41

1 Answers1

0

Is your server configured to run HTML files as PHP files? You're trying to run a PHP code inside a HTML file! You should rename index2.html to index2.php and run it inside an Apache server, or configure your Apache to run HTML as PHP. Also, index2 must be the action of index1 form.

UPDATE

How to parse HTML as PHP?

Community
  • 1
  • 1
bodruk
  • 3,242
  • 8
  • 34
  • 52