Jump to content

unsider

Members
  • Posts

    610
  • Joined

  • Last visited

    Never

Everything posted by unsider

  1. You could possibly require them to log in, and use both cookies and sessions to prevent a skewed graph. Sorry if you've thought of that, but just putting it out there. And yes I'm not quite sure but I think once you set the cookie you can retrieve from it later. And yes you can add more to it once it's set.
  2. Does anyone here use it? If so, do you use the ##php irc channel?
  3. Really? I've never tried to do that. I need to do some more reading. :-X
  4. Can you specify a little more, your question is unclear, or atleast I don't understand what you're asking.
  5. Work up to mock youtube pages, allowing the user to input html and create their own page or blogm etc...
  6. if cond == true { // do this } else { // do this } like thorpe said, simple process, and you can't test an if state inside of another.
  7. ^ Similar thing happened when I went to show my friends, not a big deal at all, but nonetheless a little embarassing, i hyped it a little bit
  8. Thank you for that, this is a topic I've been contemplating looking into.
  9. I think for the OS X users here... Xcode > everything But I use it for Obj C, C, more OOP languages, etc...
  10. I know someone wants to help me I mean well, and I'll do everything I can to help you figure it out.
  11. Dreamweaver CS3? Made by Adobe? And jEdit is also another editor that is nice, but I use it for FTP attributes.
  12. 1. I also have a script that allows you to store comments into a database, and it then outputs those comments with date, text, etc... 2. At the moment I have an array called ( $names ) full of ("hello"). Displayed functionality: http://rhythmicdesign.com/andy/index.php I only currently have the pagination working for the array of words, I need the array to be functional with comments, so that if 32 comments are displayed it becomes 3.2 pages, you know it works. It is 2 seperate components, but I would like to combine the two and display the comments, as opposed to an array string of text. If that didn't make sense, make sure to question me Everything is fully functional, I just need to turn the comments into something I can feed into the pagination so that it becomes one, I have trouble explaining it. 1. <? echo '<table>'; $tr=1; while ($row = mysql_fetch_array($result)) { echo '<tr class="tr' . $tr . '"><td>' . $row["name"] . ' says: <br>' . $row['commentdate'] . '<br>' . $row['commenttext'] . '</td></tr>'; if($tr==1){ $tr=2; } else if($tr==2){ $tr=1; } } echo '</table>'; echo '<br>'; echo '<a href="' . $_SERVER['PHP_SELF'] . '?addcomment=1">Add comment!</a>'; ?> 2. <? $names = array("hello","hello","hello","hello","hello","hello","hello","hello","hello","hello","hello","hello"); $page = $_GET['page']; $pagedResults = new Paginated($names, 10, $page); echo "<ul>"; while($row = $pagedResults->fetchPagedRow()) { echo "<li>{$row}</li>"; } echo "</ul>"; $pagedResults->setLayout(new DoubleBarLayout()); echo $pagedResults->fetchPagedNavigation(); ?>
  13. Echo is probably right, there seems like thus could be the problem, wouldn't it be INSERT INTO user //this is the table// VALUES ('.', etc...
  14. It does, he was trying to supply it with 1, and like rev said, you can't do that. Leave it alone for this specific purpose I guess is the point, but like many things, I could be wrong.
  15. INSERT INTO // database Use mySQL commands to enter the generated pass into database, then retreive the info from DB, and design a little email script. Look for tutorials, you are trying to do some basic stuff, I actually believe I've seen some things you're looking for. If I find some, I'll letcha know.
  16. <?php $action = $_POST['action']; $table = $_POST['table']; $url = $action.php?id=$table header( "Location: http://hostname.com/$url") ; exit; ?> EDIT: Nevermind, you figured it out, and wow two mistakes in one thread, record
  17. Couldn't that potientally done in CSS? Maybe I'm misunderstanding your question, but I am not qualified enough to help you, but if you're doing some research look from something with CSS.
  18. K, I've posted the line, I think it may have to do with the tables I'm trying to retrieve data from..
  19. Error: Parse error: syntax error, unexpected T_EXIT in /home/unsider/www/andy/main.php on line 234 Any more code, info, I'll be glad to post it. <?php if (!@mysql_select_db("mtlc?old")) { echo 'Unable to locate the ' . 'database.'; } if(isset($_POST['commenttext'])) { $commenttext = $_POST['commenttext']; $name = $_POST['name']; $email = $_POST['email']; $sql = "INSERT INTO comments SET commenttext ='$commenttext', commentdate =NOW(), name ='$name', email='$email'"; if (!@mysql_query($sql)) { echo 'Error adding query: ' . mysql_error(); } } echo 'The comments listed in the database...<br>'; $result = @mysql_query('SELECT commenttext, commentdate, name, email FROM comments'); if (!$result) { echo 'Error performing query: ' . mysql_error(); } ?> </div> <div id="comments"> <? echo '<table>'; $tr=1; while ($row = mysql_fetch_array($result)) { echo '<tr class="tr' . $tr . '"><td>' . $row["name"] . ' says: <br>' . $row['commentdate'] . '<br>' . $row['commenttext'] . '</td></tr>'; if($tr==1){ $tr=2; } else if($tr==2){ $tr=1; } } echo '</table>'; echo '<br>'; echo '<a href="' . $_SERVER['PHP_SELF'] . '?addcomment=1">Add comment!</a>'; ?> <? // pagination $t = mysql_query("SELECT * FROM comments WHERE id = '".addslashes($_GET['cat'])."'"); if(!$t) die(mysql_error()); $a = mysql_fetch_object($t); $total_items = mysql_num_rows($t); $limit = $_GET['limit']; $type = $_GET['type']; $page = $_GET['page']; if((!$limit) || (is_numeric($limit) == false) || ($limit < 10) || ($limit > 50)) { $limit = 10; } if((!$page) || (is_numeric($page) == false) || ($page < 0) || ($page > $total_items)) { $page = 1; } $total_pages = ceil($total_items / $limit); $set_limit = $page * $limit - ($limit); $q = mysql_query("SELECT * FROM comments WHERE id = '".addslashes($_GET['cat'])."' LIMIT $set_limit, $limit"); if(!$q) die(mysql_error()); $err = mysql_num_rows($q); if($err == 0) die("No matches met your criteria."); echo(" <a href=main.php?cat=$cat&limit=10&page=1>10</a> | <a href=main.php?cat=$cat&limit=25&page=1>25</a> | <a href=main.php?cat=$cat&limit=50&page=1>50</a>"); while($code = mysql_fetch_object($q)) { echo("item: ".$code->title."<BR>"); } $cat = urlencode($cat); $prev_page = $page - 1; if($prev_page >= 1) { echo("<b><<</b> <a href=http://main.php?cat=$cat&limit=$limit&page=$prev_page><b>Prev.</b></a>"); } for($a = 1; $a <= $total_pages; $a++) { if($a == $page) { echo("<b> $a</b> | "); } else { echo(" <a href=http://main.php?cat=$cat&limit=$limit&page=$a> $a </a> | "); } } $next_page = $page + 1; if($next_page <= $total_pages) { echo("<a href=http://main.php?cat=$cat&limit=$limit&page=$next_page><b>Next</b></a> > >"); } ?> Line 234: $t = mysql_query("SELECT * FROM comments WHERE id = '".addslashes($_GET['cat'])."'"); if(!$t) die(mysql_error()); If above is wrong, then this might be as well. This is a few lines down. $q = mysql_query("SELECT * FROM comments WHERE id = '".addslashes($_GET['cat'])."' LIMIT $set_limit, $limit"); if(!$q) die(mysql_error()); $err = mysql_num_rows($q); if($err == 0) die("No matches met your criteria.");
  20. Sorry. I'll make sure to check the boards before I ask common questions. and TOPIC SOLVED!
  21. Oh, maybe that's why, I had just moved it, I"m going to check that out.
  22. Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/unsider/www/andy/main.php:9) in /home/unsider/www/andy/include/session.php on line 46 Can some explain to me what this warning means, or how to potientally how to fix it, or how to hide it? I will post code as soon as I understand why it's being caused, if necessary.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.