TerryJ Posted December 19, 2013 Share Posted December 19, 2013 I have a form in an HTML coded page Posting a name (Jim Smith) to address the required variables in an included php array: <!-- Echo as test of correct posting --> <?php include 'vars.php'; define (_fname,$_REQUEST['fname']); define (_lname,$_REQUEST['lname']); echo _fname . " " . _lname; ?> <div style="position:absolute;padding:30px;top:220px;width:900px"><h3>To the Secretary, Treasurer and Captain</h3> <p><h3>Joining SREIGS</h3>I wish to become a member of SREIGS.</p> <!-- Active only if action set to "joining.php" --> <form action="" method="post" id="joining" target="reply"> <fieldset> <legend><h3>New Member information</h3></legend> <br>Please provide the following details for our records:<br><br> First Name (only):<input type="text" name="fname" value= <?php _fname ?> > Last Name:<input type="text" name="_lname" value=_lname ><br><br> </fieldset> </form> <iframe name="reply" height="500" width="897" frameborder="0" scrolling="No"> <p>Your browser does not support iframes.</p> </iframe> You will note that in "fname" and "lname" fields I have tried different methods - neither works. TerryJ Link to comment Share on other sites More sharing options...
justsomeguy Posted December 19, 2013 Share Posted December 19, 2013 You need to use echo or print to print the value. I would use variables for those instead of constants though, you can't change the value of a constant. <?php echo _fname; ?> Link to comment Share on other sites More sharing options...
TerryJ Posted December 19, 2013 Author Share Posted December 19, 2013 Thanks. That was all it was! I can go on from there. Amazing that you can jump in and out of php in the middle of a definition.Thanks again.TerryJ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now