Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Can someone tell me how come this dosent work?

    PHP Code:
    /* To-Do-List plugin */
        
    $r sed_import('r','G','ALP');
    $g = array ('a');
    foreach(
    $g as $x) $$x $HTTP_GET_VARS[$x];

    if (
    $a=="addlist")

        {
        
    sed_shield_protect();
        
    $g = array ('nnotebook_id','nnotebook_userid''nnotebook_message');
        foreach(
    $g as $x) $$x $HTTP_POST_VARS[$x];
        
    $sql sed_sql_query("INSERT INTO ".$cfg['plugin']['options']['dbprefix']."_notebook (notebook_id, notebook_userid, notebook_message) VALUES ('$nnotebook_id', '".$usr['id']."', '$nnotebook_message') ");
        
    header("Location: plug.php?e=options");
        }

    if (
    $a=="deletelist")
        {
        
    $sql sed_sql_query("DELETE FROM ".$cfg['plugin']['options']['dbprefix']."_notebook WHERE notebook_userid = '".$usr['id']."' AND notebook_id = '$id' ");
            
    header("Location:  plug.php?e=options");
        }

    if (
    $a=="updatelist")
    {
        
    $sql sed_sql_query("DELETE FROM ".$cfg['plugin']['options']['dbprefix']."_notebook WHERE notebook_userid = '".$usr['id']."' AND notebook_id = '$id' ");
        
    $g = array ('nnotebook_id','nnotebook_userid''nnotebook_message');
        foreach(
    $g as $x) $$x $HTTP_POST_VARS[$x];
        
    $sql sed_sql_query("INSERT INTO ".$cfg['plugin']['options']['dbprefix']."_notebook (notebook_id, notebook_userid, notebook_message) VALUES ('$nnotebook_id', '".$usr['id']."', '$nnotebook_message') ");
        
    header("Location: plug.php?e=options");
            }

    $notes .= "<p> ".$L['currenttodo']." <ul>";

    $querysed_sql_query("SELECT * FROM ".$cfg['plugin']['options']['dbprefix']."_notebook WHERE notebook_userid = '".$usr['id']."' ORDER by notebook_id DESC");
    $notenum sed_sql_numrows($query);
    if (
    $notenum==0)
    {
    $notes .="".$L['nonotes']."";
    }    
    while (
    $sql sed_sql_fetcharray($query))
        {
    $notes .= "<li>" .sed_parse(sed_cc($sql['notebook_message']));

    $notes .= " <a href=plug.php?e=options&a=deletelist&id=".$sql['notebook_id'];
    $notes .= ">[".$L['xdelete']."]</a> ";
    $notes .= " <a href=plug.php?e=options&r=updatelist&id=".$sql['notebook_id'];
    $notes .= ">[".$L['edit']."]</a></li>";
        }

    $notes .= "</ul>";

    $query sed_sql_query("SELECT notebook_message FROM ".$cfg['plugin']['options']['dbprefix']."_notebook WHERE notebook_userid = '".$usr['id']."' AND notebook_id = '$id'");
    $sql sed_sql_fetcharray($query);

    if (
    $r=="updatelist")
    {
    $notes .= "<p>".$L['updatetodo']."";
    $notes .= "<form name=\"addentry\" action=\"plug.php?e=options&a=updatelist&id=$id\" method=\"post\">";
    $notes .= "<br /><textarea name=\"nnotebook_message\" rows=\"2\" cols=\"30\">".$sql['notebook_message'];
    $notes .= "</textarea><br />" .sed_build_bbcodes("addentry","nnotebook_message",$L['BBcodes']);
    $notes .= " ".$cfg['separator']." <a href=\"plug.php?e=options\">Add New Note</a><br /><br /><input type=\"submit\" value=\"".$L['updatetodo']."\"></form></p>";
    }

    else
    {
    $notes .= "<p>".$L['addtodo']."";
    $notes .= "<form name=\"addentry\" action=\"plug.php?e=options&a=addlist\" method=\"post\">";
    $notes .= "<br /><textarea name=\"nnotebook_message\" rows=\"2\" cols=\"30\"></textarea>";
    $notes .= "<br />" .sed_build_bbcodes("addentry","nnotebook_message",$L['BBcodes']);
    $notes .= "<br /><br /><input type=\"submit\" value=\"".$L['addtodo']."\"></form></p>";


  • #2
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    what doesn't work? are you getting an error?

  • #3
    Senior Coder djm0219's Avatar
    Join Date
    Aug 2003
    Location
    Wake Forest, North Carolina
    Posts
    1,314
    Thanks
    4
    Thanked 207 Times in 204 Posts
    What doesn't it do? What do you expect it to do? What, if any, errors are shown?
    Dave .... HostMonster for all of your hosting needs

  • #4
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    its a simple to do list its suppose to update the db or insert or display in the page

  • #5
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    and are you getting an error? what happens when you run it? have you setup the data base and configured the connection script('s) for it?

  • #6
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    when i use the script the page loads blank then when i go bak nothing has happened

  • #7
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Try this: http://www.codingforums.com/showthre...060#post617060

    And make sure to try looking in the page source in the browser for any error messages, some times they don't render depending on their placement in the HTML.
    OracleGuy

  • Users who have thanked oracleguy for this post:

    XjSv (12-10-2009)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •