SunQuest
 
           General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old April 29th, 2003, 05:13 PM
thecharking thecharking is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 187 thecharking User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to thecharking
News won't post, can't use userid!

I have been trying to use Ben Rowe's member system as best I can, but there are a few things that just aren't working: the news is not allowing me to post (it simply says no news posts to be displayed, even when I am logged in, nothing... shouldn't it be default allow me to add a comment or something? what did I miss...). I cant figure out why it wont let me post anything... Also, I can't remain logged in. I have the support files which I am using, I read through the using cookies part to validate, and that is all already in the support. I found a post saying to change some values in php.ini, which I did, and still no luck (changing the cookie settings, that is). When I close the window and then open the site again, I am logged out. Is this something that happens jsut because I am making the site locally? Shouldn't I get a cookie?
Any help would be greatly appreciated, thanks!

Last edited by thecharking : April 30th, 2003 at 12:25 PM.

Reply With Quote
  #2  
Old May 12th, 2003, 12:19 PM
thecharking thecharking is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 187 thecharking User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to thecharking
any help?

I'm still having this problem... anyone know what the problem may be?

Reply With Quote
  #3  
Old May 12th, 2003, 03:41 PM
Vince Vince is offline
LordNitrous
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: England
Posts: 137 Vince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
show the code and maybe we can help
__________________
You don't deserve to read my signature...yeah! That's it, keep walking...yeah walk away from me! That's it! Get out of my pub, you're barred!

Reply With Quote
  #4  
Old May 12th, 2003, 05:15 PM
thecharking thecharking is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 187 thecharking User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to thecharking
sorry

i knew I shouldve shown you the code... but there is so much oi. here:
PHP Code:
<?php
ob_start
();
require_once(
'Connections/users.php'); ?>
<?php
mysql_select_db
($database_users$users);
$query_Recordset1 "SELECT * FROM comments, log, news, online, `session`, users";
$Recordset1 mysql_query($query_Recordset1$users) or die(mysql_error());
$row_Recordset1 mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 mysql_num_rows($Recordset1);

//include('class.security.php');

    
$dtlsSecurity = new Security;
    
    
$dtlsSecurity->ExtraFieldNames('firstname,lastname');
    
$dtlsSecurity->StoreSession_TableName('session');
    
$dtlsSecurity->Log_TableName('log');
    
$dtlsSecurity->FieldNames('sessionid''userid''username''auth');
    
    
$IsLoggedIn $dtlsSecurity->IsLoggedIn();
    
$details $dtlsSecurity->GetData();

    if(
$IsLoggedIn
        {

            
?>


            <?php

        
}
    else
        {

            
?>
            <?php
        
        
}

    echo 
'<a href="index.php">Home</a> | <a href="news.php">News</a><br>';

    switch(
$_GET['what'])
        {

            case 
"comment";
                
ShowCommentForm();
                break;
                
            case 
"process";
                
ProcessComment();
                break;

            default;
                
ShowNews();
                break;

        }

    function 
ProcessComment()
        {

            global 
$IsLoggedIn$details;

            if(
$IsLoggedIn != 1)
                
header("Location: login.php");

                
//show selected news post

                
mysql_query("INSERT INTO `comments` (`id`, `newsid`, `userid`, `comment`, `date`) VALUES (0, '{$_POST['newsid']}', '{$details[0]}', '{$_POST['comment']}', NOW())");

            
?>
                
                Comment Posted<br><br>
                
                <a href="news.php?nId=<?php echo $_POST['newsid']; ?>">Continue</a><br>

                <body>
                <html>

            <?php


        
}

    function 
ShowCommentForm()
        {

            global 
$IsLoggedIn$details;

            if(
$IsLoggedIn != 1)
                
header("Location: login.php");

                
//show selected news post

                
$result mysql_query("SELECT * FROM news WHERE id = '{$_GET['nId']}'");                    

                
$row mysql_fetch_array($result);

                
?>
                
                <strong>Post comment for...</strong>
                <br><br>
                <?php echo $row['article']; ?>
                <br><br><hr>


                <form method="post" action="news.php?what=process">
                <textarea name="comment" cols="50" rows="10"></textarea><br>
                <input name="newsid" type="hidden" value="<?php echo $_GET['nId']; ?>">
                <input type="submit" value="Post Comment">
                </form>
            <?php


        
}

    function 
ShowNews()
        {

            if(isset(
$_GET['nId']) && is_numeric($_GET['nId']))
                {

                    
//show selected news post

                    
$result mysql_query("SELECT * FROM news WHERE id = '{$_GET['nId']}'");                    

                    
$row mysql_fetch_array($result);

                    echo 
"<hr>" $row['article'];

                    echo 
"<br><br><strong>Comments</strong><hr>";

                    
$cResult mysql_query("SELECT * FROM comments WHERE newsid = '{$_GET['nId']}'");

                    if(
mysql_num_rows($cResult) == 0)
                        {
                
                            echo 
"no comments for this news post";
                
                        }

                    while(
$row mysql_fetch_array($cResult))
                        {
                
                            
?>
Posted By: 
<?php

                                    $query 
mysql_query("SELECT * FROM users WHERE userid = '{$row['userid']}'");

                                    echo 
mysql_result($query04) . ' ' mysql_result($query05);
                                
                                
?>
<br>
                                <?php
    
                                    
echo $row['comment']; 
                                
                                
?>

                                <hr>
                
                            <?php
                
                        
}

                echo 
"<center><a href='news.php?what=comment&nId=" $_GET['nId'] . "'>Add Comment</a></center>";

                }
            else
                {

                    
$result mysql_query("SELECT * FROM news ORDER BY date DESC");

                    if(
mysql_num_rows($result) == 0)
                        {
                
                            echo 
"<hr>no news posts to be displayed";
                
                        }
                
                    while(
$row mysql_fetch_array($result))
                        {
                
                            
?>
                
                                <hr>
                                <?php echo $row['article']; ?><br>
                                <div align="right">
                
                                    <?php
                
                                        
if($IsLoggedIn == 1)
                                            echo 
'<a href="news.php?what=addcomment">Add Comment</a> | ';
                
                                    
?>
                
                                    <a href="news.php?nId=<?php echo $row['id']; ?>">Read Comments</a>
                                </div>
                
                            <?php
                
                        
}

                }
        }
?>

its basically what Ben Rowe set up exactly, but it isn't showing anything but the links at the top for news and home.
any ideas?

Reply With Quote
  #5  
Old May 12th, 2003, 07:28 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Have you actually checked your database to ensure that some data actually exists?

Reply With Quote
  #6  
Old May 18th, 2003, 04:29 PM
thecharking thecharking is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 187 thecharking User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to thecharking
no data

alright I figured out whata few of my problems were I guess, but now I actually do have a problem with the database, its not posting data, I can get the page but it wont say the line about the article being posted. so what might be causing this?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > news from member system not working


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway