Jump to content

echo contents to a form not working


TGWSE_GY

Recommended Posts

okay I have a form that is suppose to display contents retrieved from the database. However all the other forms work but this one. Could someone point me in the right direction please?

 

home.php

 

<?php $dbhost = "**********"; $dbuser = "*********"; $dbpass= "**********"; ?>
<?php $dbtbl = "home"; $dbname = "innonmainnj"; ?>
<?php $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error()); ?>
<?php mysql_select_db($dbname) or die(mysql_error()); ?>
<?php $query = "SELECT * FROM `$dbtbl` WHERE id = '1'"; ?>
<?php $result = mysql_query($query) or die(mysql_error()); ?>
<?php if(mysql_num_rows($result) == 1){$returned = mysql_fetch_assoc($result);}else{echo "Table accommodations is not valid, please contact system administrator"; die();} ?>


<div id="form_container">


	<h1><a>Home Page</a></h1>
	<form id="form_108881" class="appnitro"  method="post" action="proccess.form.php">
				<div class="form_description">
		<h2>Home Page</h2>
		<p>You are now editing your Home Page</p>
	</div>						
		<ul >

				<li id="li_1" >

	<label class="description" for="element_1">Home Content </label>
	<div>
		<textarea id="element_1" name="element_1" class="element textarea medium"><?php echo stripslashes($returned['content']); ?></textarea> 
	</div> 
	</li>		<li id="li_2" >
	<label class="description" for="element_2">Promo Title </label>
	<div>
		<input id="element_2" name="element_2" class="element text large" type="text" maxlength="255" value="<?php echo stripslashes($returned['promotitle']); ?>"/> 
	</div> 
	</li>		<li id="li_3" >

	<label class="description" for="element_3">Promo </label>
	<div>
		<input id="element_3" name="element_3" class="element text large" type="text" maxlength="255" value="<?php echo stripslashes($returned['promo']); ?>"/> 
	</div> 
	</li>		<li id="li_4" >
	<label class="description" for="element_4">Address Line 1 </label>
	<div>
		<input id="element_4" name="element_4" class="element text large" type="text" maxlength="255" value="<?php echo stripslashes($returned['address1']); ?>"/> 
	</div> 
	</li>		<li id="li_5" >

	<label class="description" for="element_5">Address Line 2 </label>
	<div>
		<input id="element_5" name="element_5" class="element text large" type="text" maxlength="255" value="<?php echo stripslashes($returned['address2']); ?>"/> 
	</div> 
	</li>		<li id="li_6" >
	<label class="description" for="element_6">Phone Number </label>
	<div>
		<input id="element_6" name="element_6" class="element text medium" type="text" maxlength="255" value="<?php echo stripslashes($returned['phone']); ?>"/> 
	</div> 
	</li>


				<li class="buttons">
		    <input type="hidden" name="form_id" value="108881" />
		    
			<input id="saveForm" class="button_text" type="submit" name="submit" value="Submit" />
	</li>
		</ul>
	</form>	
	<div id="footer">
		inkControl CMS © <?php echo date(Y); ?> <a href="http://www.visualrealityink.com">Visual Reality ink.</a>
            </div>
</div>

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/175130-echo-contents-to-a-form-not-working/
Share on other sites

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.