php define tag
Posted: Sat Mar 04, 2006 7:01 am
I can see the advantages of using the php define tag for example I could specify all my form fields on one page and link this to another .php page using an include tag and using the echo tag where I want the form field to be displayed for example. What I wanted to know is if this is the correct way to use the define tag.
<?php
// define.php
define("form_field_first_name", "<input type=text name=first_name size=20>");
define("form_field_last_name", "<input type=text name=last_name size=20>");
?>
<?
// show_form.php
include "define.php";
echo form_field_first_name; //
echo form_field_last_name; //
?>
<?php
// define.php
define("form_field_first_name", "<input type=text name=first_name size=20>");
define("form_field_last_name", "<input type=text name=last_name size=20>");
?>
<?
// show_form.php
include "define.php";
echo form_field_first_name; //
echo form_field_last_name; //
?>