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
https://forums.phpfreaks.com/topic/212820-display-of-variables-in-body/
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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.