Jump to content

Nesting Issue (I Think)


krisw44

Recommended Posts

Ok, so I have a site that I am building, with a content manager. In the content manager i am putting some php code to display in the page.

 

Here is the holder for the page content:

<div id="contentholder" class="yesprint">
<div id="innercontent">
<?php echo $row['content']; ?>
</div>
</div>

 

Here is the code that is getting loaded as $row['content']:

<form name="qform" id="qform">
<input type="text" name="p19q2" value="<?php echo $valarr['p19q2']; ?>"/><br/>
<input type="text" name="p19q3" value="<?php echo $valarr['p19q3']; ?>"/><br/>
<input type="text" name="p19q4" value="<?php echo $valarr['p19q4']; ?>"/><br/>
<input type="radio" name="p19q5" value="123" <?php if($valarr['p19q5'] == '123'){ echo 'checked="checked"'; } ?>/>123 <input type="radio" name="p19q5" value="456" <?php if($valarr['p19q5'] == '456'){ echo 'checked="checked"'; } ?>/>456<br/>
<input type="text" name="p19q6" value="<?php echo $valarr['p19q6']; ?>"/><br/>
<textarea type="textarea" cols="30" name="p19q7" rows="7"><?php echo $valarr['p19q7']; ?></textarea><br/>
</form>
<button type="button" onclick="saveXML()">Save</button>

 

 

It is currently showing the php code in the value tags as the value for each input, instead of processing the php. If I copy the source code and run it alone it works fine though. Here is the combined source snippet:

<div id="contentholder" class="yesprint">
<div id="innercontent">
<form name="qform" id="qform">
 <input type="text" name="p19q2" value="<?php echo $valarr['p19q2']; ?>"/><br/>
 <input type="text" name="p19q3" value="<?php echo $valarr['p19q3']; ?>"/><br/>
 <input type="text" name="p19q4" value="<?php echo $valarr['p19q4']; ?>"/><br/>
 <input type="radio" name="p19q5" value="123" <?php if($valarr['p19q5'] == '123'){ echo 'checked="checked"'; } ?>/>123
    <input type="radio" name="p19q5" value="456" <?php if($valarr['p19q5'] == '456'){ echo 'checked="checked"'; } ?>/>456<br/>
 <input type="text" name="p19q6" value="<?php echo $valarr['p19q6']; ?>"/><br/>
 <textarea type="textarea" cols="30" name="p19q7" rows="7"><?php echo $valarr['p19q7']; ?></textarea><br/>
</form>
<button type="button" onclick="saveXML()">Save</button>
</div>
</div>

 

 

Any thoughts or suggestions on this would be much appreciated.

Link to comment
https://forums.phpfreaks.com/topic/269367-nesting-issue-i-think/
Share on other sites

Is the file format being interpreted by PHP?

 

IE: if the file extension is .html it *might* not be process by PHP thus resulting in your problem. (depends on server configuration.) Make sure the file ends in .php maybe?

 

EDIT: I might have read your problem wrong Jessica might be right.

Jessica: I understand the issues with it, but not sure how else to retrieve and load the data without having to manually build each page.

 

DarkerAngel: Yes, the main page is a .php page. It process all of the main php requests properly, just not the ones being called within the second level.

 

ManiacDan: I'll take a look at those snippets.

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.