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 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jun 2008
    Posts
    682
    Thanks
    114
    Thanked 2 Times in 2 Posts

    Not opening Javascript Script

    I don't know why but under case 1 it won't open the javascript date picker when you click the link and not sure why.

    PHP Code:
    <?php
        $e 
    = <<<here
    <script type="text/javascript" src="http://www.kansasoutlawwrestling.com/backstage/jscripts/ajax.js"></script>                
    <script type=text/javascript src=http://www.kansasoutlawwrestling.com/backstage/jscripts/ts_picker.js></script>                
    here;
    switch (
    $_REQUEST['option']) {
        case 
    0:
        echo 
    $e;
        
    $query "SELECT *
             FROM `efed_content_news`
             WHERE category_id = '{$id}'"
    ;
    ?>
        <h1 class=backstage>News Management</h1><br />
        <h2 class=backstage>News Articles :: <a href="#" onclick="ajaxpage('backstage_libs/news.php?option=1', 'content'); return false;">Add New</a></h2><br />
        <?php
                $query 
    "SELECT * FROM efed_content_news AS news, efed_list_newscategory AS newscat WHERE newscat.id = news.category_id";            
                
    $result mysql_query $query ); 
                
    $rows mysql_num_rows($result);
                if (
    $rows 0)  {
                    print
    '<table width="100%" class="table1">
                    <tr class="rowheading">
                        <td>&nbsp;</td>
                        <td width=100 align=center>Category ID</td>
                        <td>Title</td>
                    </tr>'
    ;
                    
    $i 0;
                    while ( 
    $row mysql_fetch_array $resultMYSQL_ASSOC ) ) {
                        
    $sClass 'row2';
                        if (
    $i++ % 2$sClass 'row1';
                        
    printf "<tr class=\"%s\">"$sClass );
                        print 
    "<td valign=\"top\" align=center width=35><a href=\"#\" onclick=\"ajaxpage('backstage_libs/news.php?option=2&id=$row[id].', 'content'); return false;\">Edit</a></td>";
                        
    printf "<td align=\"center\" valign=\"top\">%s</td>"$row ['categoryname'] );
                        
    printf "<td valign=\"top\">%s</td>"$row ['title'] );
                        echo 
    '</tr>';
                    }
                    echo 
    '</table><br><br />';
                } else {
                    echo 
    '<span>There are no news postings.</span><br /><br />';
                }
                
    returnmain();
            break;
            case 
    1:
                echo 
    $e;
                require_once(
    '../backstageconfig.php');
                require_once(
    '../backstagefunctions.php');
                
    ?>
                <h1 class="backstage">News Management</h1><br />
                <h2 class="backstage">Add News Posting</h2><br />
                <form name="characters" method="post">
                    <input type="hidden" name="action" value="news" />
                    <table width="100%" class="table2">
                        <tr>
                            <td class=rowheading>Category:</td><td class="row3">
                            <select name="category" class="selection">
                            <option value="0">- Select -</option>
                            <?php
                            $query 
    'SELECT categoryname,id FROM efed_list_newscategory';
                            
    $result mysql_query $query );
                            while ( 
    $row mysql_fetch_assoc $result ) ) 
                            {
                                print 
    "<option value=\"".$row['id']."\">".$row['categoryname']."</option>\r";
                            }
                            
    ?>
                            </select></td>
                        </tr>
                        <tr>
                            <td class="rowheading">Posting Date:</td><td class="row3"><input type="text" name="postingdate" class="fieldtext80" value=""><a href="javascript:show_calendar(document.eventbooker.postingdate, document.eventbooker.postingdate.value);"><img src="http://www.kansasoutlawwrestling.com/backstage/images/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick the date"></a></td>
                        </tr>
                        <tr>
                            <td width="120" class="rowheading">Title:</td><td class="row3"><input type="text" name="title" class="fieldtext490"></td>
                        </tr>
                        <tr>
                            <td width="120" class="rowheading">Teaser:</td><td class="row3"><input type="text" name="teaser" class="fieldtext490" value=""></td>
                        </tr>
                        <tr>                                                                                                                        
                            <td width="120" class="rowheading" valign="top">Content:</td><td class="row3"><textarea name="content" class="textarea490x100"></textarea></td>
                        </tr>
                    </table><br />
                    <input type="hidden" name="newadded" value="true">
                    <input type="submit" value="Save News" class="button"></form><br />
                    <form method="post"><input type="button" value="Return to News Posting List" class="button200" name="return">
                </form><br />
                <?php
                returnmain
    ();
            break;
            case 
    2:
            echo 
    $e;
            require_once(
    '../backstageconfig.php');
            require_once(
    '../backstagefunctions.php');
            
    $id $_GET['id']; 
            
    $query mysql_query("SELECT * FROM `efed_bio` WHERE `id` = '" $id "'");
            
    $row mysql_fetch_array($query); 
            
    ?>
            <h1 class="backstage">News Management</h1><br />
                <h2 class="backstage">Add News Posting</h2><br />
                <form name="characters" method="post">
                    <input type="hidden" name="action" value="news" />
                    <table width="100%" class="table2">
                        <tr>
                            <td class=rowheading>Category:</td><td class="row3">
                            <select name="category" class="selection">
                            <option value="0">- Select -</option>
                            <?php
                            $query 
    'SELECT categoryname,id FROM efed_list_newscategory';
                            
    $result mysql_query $query );
                            while ( 
    $row mysql_fetch_assoc $result ) ) 
                            {
                                print 
    "<option value=\"".$row['id']."\">".$row['categoryname']."</option>\r";
                            }
                            
    ?>
                            </select></td>
                        </tr>
                        <tr>
                            <td class="rowheading">Posting Date:</td><td class="row3"><input type="text" name="postingdate" class="fieldtext490" value=""></td>
                        </tr>
                        <tr>
                            <td width="120" class="rowheading">Title:</td><td class="row3"><input type="text" name="title" class="fieldtext490"></td>
                        </tr>
                        <tr>
                            <td width="120" class="rowheading">Teaser:</td><td class="row3"><input type="text" name="teaser" class="fieldtext490" value=""></td>
                        </tr>
                        <tr>                                                                                                                        
                            <td width="120" class="rowheading" valign="top">Content:</td><td class="row3"><textarea name="content" class="textarea490x100"></textarea></td>
                        </tr>
                    </table><br />
                    <input type="hidden" name="newadded" value="true">
                    <input type="submit" value="Save News" class="button"></form><br />
                    <form method="post"><input type="button" value="Return to News Posting List" class="button200" name="return">
                </form><br />
                <?php
                returnmain
    ();
            break;
            }
        
        function 
    news() {
            if ((!empty(
    $_POST['newadded']))) {
                
    $category mysql_real_escape_string($_POST['category']);
                
    $postdate mysql_real_escape_string($_POST['postdate']);
                
    $title mysql_real_escape_string($_POST['title']);
                
    $teaser mysql_real_escape_string($_POST['teaser']);
                
    $content mysql_real_escape_string($_POST['content']);
                
    $query "INSERT INTO `efed_content_news` (category_id,postdate,title,teaser,content) VALUES ('".$category."', '".$postdate."', '".$title."', '".$teaser."', '".$content."')";
                
    mysql_query($query);
                echo 
    $query;
            }
        }
    ?>

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,493
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    Make your page so that it is rendering case 1, copy the HTML as it's rendered,
    and show us that HTML. I think it might be more apparent when we see how
    the HTML was rendered for case 1.

  • #3
    Regular Coder
    Join Date
    Jun 2008
    Posts
    682
    Thanks
    114
    Thanked 2 Times in 2 Posts
    I'm lost.

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,493
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    Give us the link to the page that has the pop-up calendar on it.

  • #5
    Regular Coder
    Join Date
    Jun 2008
    Posts
    682
    Thanks
    114
    Thanked 2 Times in 2 Posts
    I'll send it to you in PM.

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Post back when determined; I'm assuming that the 'not open' is referring to a JS issue, not a PHP one. I'll move it to the JS forum if thats the case.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

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