Back again
i spoke to soon lol
Let me explain the probelms im having.
The reason i was trying to write this function is because i had problems displaying some code within my if statement.
PHP Code:
if(isset($_COOKIE["username"])){
echo 'I WANT TO DISPLAY MY CODE HERE';
}
else {
echo 'You must be logged in to do this!';
}
The code i want to display is below, but the php inside the code is causing errors, thats why i thought a function for the php would be the best route, but at the moment the function is not displaying.
This is the code before i wrote function.
If anyone could help with this id much apprciate it.
PHP Code:
<form method="post" action="index.php?app=layouts&action=thankyou" enctype="multipart/form-data">
<table width="100%" cellspacing="0" cellpadding="5">
<tr>
<td class="content_text">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td class="text">Layout Title</td>
<td class="info"><input name="layout_title" type="text" value="" size="45" /><br /><br /></td>
</tr>
<tr>
<td class="text">Category</td>
<td class="info">
<select name="cat" style="width: 250px">
<?php
$c_query = mysql_query("SELECT * FROM cats");
while ( $c_row = mysql_fetch_assoc($c_query) )
{
$selected = ($sub_action[0] == $c_row['id']) ? " SELECTED" : "";
?>
<option value="<?=$c_row['id']?>"<?=$selected?>><?=$c_row['name']?></option>
<?php
}
$c_query = mysql_query("SELECT * FROM cats WHERE `id`='{$sub_action[0]}'");
$c_row = mysql_fetch_assoc($c_query);
?>
</select> <br /><br /></td>
</tr>
<tr>
<td class="text">Thumbnail:</td>
<td class="info"><input type="file" name="thumbnail" size="45" maxlength="255" /><br /><br /></td>
</tr>
<tr>
<td class="text">Code 1 Title</td>
<td class="info"><input name="layout_code1title" type="text" value="Example: Copy and paste to About me." size="45" /><br /><br /></td>
</tr>
<tr>
<td class="text">Code 1 </td>
<td class="info"><textarea name="layout_code1" cols="45" rows="10"></textarea>
<br /><br /></td>
</tr>
<tr>
<td class="text">Code 2 Title (Optional) </td>
<td class="info"><input name="layout_code2title" type="text" value="" size="45" /><br /><br /></td>
</tr>
<tr>
<td class="text">Code 2 (Optional) </td>
<td class="info"><textarea name="layout_code2" cols="45" rows="10"></textarea><br /><br /></td>
</tr>
<tr>
<td class="text">Code 3 Title (Optional) </td>
<td class="info"><input name="layout_code3title" type="text" value="" size="45" /><br /><br /></td>
</tr>
<tr>
<td class="text">Code 3 (Optional) </td>
<td class="info"><textarea name="layout_code3" cols="45" rows="10" ></textarea><br /><br /></td>
</tr>
<tr>
<td class="text">Layout Notes (Optional) </td>
<td class="info"><textarea name="layout_desc" cols="45" rows="5"></textarea><br /><br /></td>
</tr>
<tr>
<td class="text">Layout Tags </td>
<td class="info"><input name="layout_tags" type="text" value="Example: girly,myspace,pink," size="45" /><br /><br /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="save"><input id="button" type="submit" value="Submit Layout" class="button" /></td>
</tr>
</table>
</form>
Bookmarks