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:
  #1  
Old September 12th, 2002, 01:25 PM
littleblackdog littleblackdog is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Anchorage
Posts: 118 littleblackdog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Trouble calling just one table...

I thought I was finished with my teachers' newsletter maker, but I was wrong. First I had a problem with security, then I used simple password authentication to access the "make newsletter forms", this solved that problem ( for now ). Then it seemed to word fine. Now I am getting a repeating post when before I used sessions, I had no such problem.

Here is the code that calls for 1 newsletter to be posted from a table row:
PHP Code:
<?php
echo "<tr><td><p align=center><font size='+2'>Newsletters by date:</font></p></td></tr>\n";
$db = @mysql_connect "home""home""home");
mysql_select_db("home"$db);
$result mysql_query("SELECT * FROM tablehome",$db);
if (
$myrow mysql_fetch_array($result))
{ do {
echo 
"<p align=center>\n";
printf ("<a href=msemilynewsletter1.php?id=%s%s>%s</a><br>\n"$php_self,$myrow["id"],$myrow["date"]);
echo 
"</p>\n";
}
while (
$myrow mysql_fetch_array($result));
}
else {
echo 
"Sorry, no records were found.";
}
?>


Above is the code for a page that posts the names of the newsletters entered.

I have sessions registered on all the "make forms" pages and the member's only pages, they look like this:

PHP Code:
<?
  session_start
();

  echo 
"<h1>Members only</h1>";

  
// check session variable

  
if (session_is_registered("valid_user"))
  {
    echo 
"<p>You are logged in as $valid_user.</p>";
  }
  else
  {
    echo 
"You are not logged in, try logging again at: <a href='authmain.php'>Teacher Log In</a>.";
    die();
  }
?>


All the tables are different ( mysql ), one for each user, and one for the passwords and user names and id's.

The page that allows parents to view the list of newsletters does not have the above session validation, only the members only pages.

What is happening?
Please help.

<< mod edit: please put the PHP tags around PHP code, it makes things easier to read. Thank you >>
__________________
bow wow!

Last edited by ejbe99 : September 12th, 2002 at 03:07 PM.

Reply With Quote
  #2  
Old September 12th, 2002, 09:08 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
check your database. id say you have multiple posts in there.

Reply With Quote
  #3  
Old September 16th, 2002, 04:22 PM
littleblackdog littleblackdog is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Anchorage
Posts: 118 littleblackdog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
My sessions seem to be causing problems

I got rid of sessions on the first form page cause it was causing some problems, but now I am having other problems. The sessions were working great, from page to page, back and forth...no problem....well I should have refered to "rows" instead of tables. I have one database and many tables to pull this off. The rows in one of the tables are all showing up as a result, in the newsletter.php . Instead of calling back just one row, it is calling back all the rows and putting them on one page, a very long letter.

Also, since I have a session in progress on the pages, I can't destroy a session when someone wants to clear the page...can I? If I do, and I tried, it makes it so I have to log in again.

I am using Ben Rowe's basic database tutorial, changed it a bit to meet my needs. It should be easy to have a simple form to write a basic newsletter ( the form is part of the members only pages ) and then parents can go to a viewnewsletter page with a list of the id and name of all the newsletters teacher's have posted in the db, they choose one and presto, it pops up on a new page titled that newsletter.... I had it working great, then I added the sessions for login verification and now it is ****e.

If anyone can help, I'll send all the code. I'd appreciate it.
Rob.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Trouble calling just one table...


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
Stay green...Green IT