Jump to content
MakeWebGames

Help Tutorial


peterisgb

Recommended Posts

Hi, i'm been working on enabling the Help Tutorial to be abled to update from the staff page without going into the server.

Well here is what i have so far

 

<?php
include "sglobals.php";

switch($_GET['action'])
{
default: index(); break;
}


function index()
{
global $db,$h,$set;
print "<h3>Help Tutorial</h3>
<form action='helptut.php?action=helpupdate' method='post'>
<textarea rows=30 cols=90 name='helptext' class='input'>{$set['help']}</textarea><br />
<input type='submit' value='Update Help Tutorial' /></form>";
}
function helpupdate()
{
global $db,$h,$set;
$db->query("UPDATE settings SET conf_value='{$_POST['helptext']}' WHERE conf_name='help'");
print "Help Updated!<a href='helptut.php'>Back</a>";
}

$h->endpage();
?>

 

The problem i am having is that it shows up the text within the box, but when you click update is doesnt update, is just goes back to the same page,

the link shows its gone to the right page but thats it.

 

If some could help me figure out whats wrong they can use this aswell,

add

Fields 'Help' to the Table 'Settings'

Link to comment
Share on other sites

duh lol, thanks djkanna, this works a charm now

Here is completed file for those who to wish to use this

 

<?php
include "sglobals.php";
//This contains general thingies
switch($_GET['action'])
{
case 'helpupdate': helpupdate(); break;
default: index(); break;
}
function index()
{
global $db,$h,$set;
print "<h3>Help Tutorial</h3>
<form action='helptut.php?action=helpupdate' method='post'>
<textarea rows=30 cols=90 name='helptext' class='input'>{$set['help']}</textarea><br />
<input type='submit' value='Update Help Tutorial' /></form>";
}
function helpupdate()
{
global $db,$h,$set;
if($_POST['helptext'])
{
$db->query("UPDATE settings SET conf_value='{$_POST['helptext']}' WHERE conf_name='help'");
$set['help']=stripslashes($_POST['helptext']);
print "Help Updated!<a href='helptut.php'>Back</a>";
}
}
$h->endpage();
?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...