Jump to content

Updating part of CMS


j05hr

Recommended Posts

I can upload things into my database from the website.  I'm having trouble getting the edit feature to work.

 

My code...

 

This is where it's meant to echo back what you've clicked on to edit.

<input type="text" name="menu_name" value="<?php echo $sel_subject['menu_name']; ?>" id="menu_name" />

 

But nothing happens,

 

Here are the functions

function find_selected_page () {
	global $sel_subject;
	global $sel_page;
	if (isset($_GET['subj'])) {
		$sel_subject = get_subject_by_id($_GET['subj']);
		$sel_page = NULL;
	} elseif (isset($_GET['page'])) {
		$sel_subject = NULL;
		$sel_page = get_page_by_id($_GET['page']);
	} else {
		$sel_subject = NULL;
		$sel_page = NULL;
	}
}


function navigation($sel_subject = null, $sel_page = null) {  
	$subject_set = get_all_subjects();
	// 5. Use returned data
	while ($subject = mysql_fetch_array($subject_set)) { 

	echo "<div class=\"menu-name\">";  echo "<a href=\"edit_subject.php?page=" . urlencode($subject["id"]) .
		"\">{$subject["menu_name"]}</a>";  echo"</div>";
	echo "<div class=\"buying-text\">";  echo "{$subject["content"]}";  echo"</div>";

	echo "<div class=\"image\">"; echo"</div>";

	}
}

 

That's all the code I think it uses but if you need any more let me know.

 

Thanks,

Josh

Link to comment
https://forums.phpfreaks.com/topic/180297-updating-part-of-cms/
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.