Jump to content

display of variables in body


damiendarien

Recommended Posts

i am having issues getting the variables to show up on localhost server within the body element. is it something in the codes or something in the php.ini settings? here is some sample code

<h1>Skyward Aviation</h1>

<h2>Contact Information</h2>
<form action="ContactUpdate.php" method="get">
<table frame="border" rules="cols">
<colgroup width="50%" />
    <colgroup width="50%" />
    	<tr>
        	<td align="right" valign="top">
            	<p>First Name <input type="text" name="first_name" value="<?= $First ?>" size="36" /></p>
                <p>Last Name <input type="text" name="last_name" value="<?= $Last ?>" size="36" /></p>
                <p>Phone <input type="text" name="phone" value="<?= $Phone ?>" size="36" /></p>
            </td>
            <td align="right" valign="top">
            	<p>Address <input type="text" name="address" value="<?= $Address ?>" size="40" /></p>
                <p>City <input type="text" name="city" value="<?= $City ?>" size="10" />
                    State <input type="text" name="state" value="<?= $State ?>" size="2" maxlength="2" />
                    Zip <input type="text" name="zip" value="<?= $Zip ?>" size="10" maxlength="10" /></p>
            </td>
       </tr>
</table>
<p><input type="hidden" name="PHPSESSID" value='<?php echo session_id() ?>' />
<p><input type="submit" value="Submit" /></p>

</form>

 

In the page is shows <?= $First ?> in the area First Name textbox.

Link to comment
Share on other sites

Assuming you've saved the file with a .php extension, the "quick echo" <?= tags may be causing your problem. What do you see if you load the page in your browser, then view the html source?

 

EDIT: You'll need to include a session_start() before you're able to access any $_SESSION vars.

Link to comment
Share on other sites

thanks for your response but i had already figured it out to add the echo. Thats not the way it is supposed to be coded from the book, but it is the way i am coding it to get it to work. Thanks. I was coming here to mark "Solved" but I forgot the response time here is VERY GOOD here. Glad i joined this forum.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.