Hi all,
I'm trying to set up a 'control panel' consisting of a table of icons.
The early stages: http://www.deepinit.com/controlcentre.php
Each of these is set up like:
<td>
<input type="image" id="addnews" src="/Image/add24.png"
name="addnews" value="addnews" width="24" height="24"><br />
<label for="addnews">A dd News Item</label><br />
</td>
This is all taking place in a html form and I'm using input
type="image"... like 'submit' buttons.
Is this a 'good' approach?
I'm trying to handle the $_POST variable after a user clicks on one of
these but there are differences between firefox and ie6.
Using:
foreach ($_POST as $key=>$val) {
echo $key ."|". $val . "<br />";
}
ie6 is only listing
addnews_x|8
addnews_y|17
Firefox:
addnews_x|10
addnews_y|13
addnews|addnews
Why am I getting x and y co-ordinates?
Why in firefox do I get $val ('addnews|addne ws') but not in ie6?
What I'm trying to do is redirect to other pages based on $_POST:
foreach ($_POST as $key=>$val) {
switch (strtolower($ke y)) {
case 'addnews_x':
PostHandler('ad dnews', 'news', '/posteditor.php' );
break;
case 'editnews_x':
PostHandler('ed itnews', 'news', '/postsearch.php' );
break;
case 'deletenews_x':
PostHandler('de letenews', 'news', '/postsearch.php' );
break;
...
function PostHandler($co mmand, $post_type, $redir_page) {
$_SESSION['ctlcentcmd'] = $command;
$_SESSION['posttype'] = $post_type;
ob_end_clean();
header('Locatio n: http://' . $_SERVER['HTTP_HOST']
. $redir_page);
}
This is working but I'm not happy basing this on the x co-ordinate
(eg addnews_x). Surely there must be a better way?
If you wanted to implement a similar icon based 'Control Centre' what
approach would you take? The intent is to have a single page where the
site admin can add/edit/delete news, articles, bios, user data, etc
thanks for your help,
--
Mark