Jump to content

Aureole

Members
  • Posts

    788
  • Joined

  • Last visited

    Never

Everything posted by Aureole

  1. I know, I know, I'm useless. $query = "SELECT title, url, content FROM modules WHERE id='1'"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_row($result)) { $m_bungietitle = $row['title']; $m_bungieurl = $row['url']; $m_bungiecontent = $row['content']; } And then the code to display... <div class="rightcolumntitle"> <img src="img/rightcolumn_title_right.png" width="11px" height="27px" alt="." align="right" />Bungie Weekly Update </div> <div class="rightcontent"> <p class="newsinfo"> <a href="<?php echo "$m_bungieurl"; ?>" target="_blank" class="newstitle"><?php echo "$m_bungietitle"; ?></a><br /><?php echo "$m_bungiecontent"; ?> </p> </div> I'm not getting any errors and nothing is showing, yes I connect to the database already.
  2. If you used Javascript you could make sure that if they clicked Submit they would be informed that they have to tick the checkbox whereas if you user Php it will take you to another page then say they need to go back and click the checkbox...which is...annoying. If you want I can try find you a Javascript code snippet to do what you want?
  3. Is there any way using PHP to make sure that once someone clicks Submit if they click it again it won't send the data twice? If not is there any alternative using Javascript or something?
  4. For A I would use Javascript for B I'm not too sure how to approach that...I'll have a think about it and for C you would just use like... header('location: somepage.php'); I'm new to all this so if this didn't help then don't complain...there will be someone who knows how to help you. It will just redirect to that url yes.
  5. Thanks a lot, I was experimenting with in_array() but I couldn't get it to work.
  6. How come the array isn't working, If this worked before... <?php $allowed = "1"; if ($member['id'] == $allowed) { echo "<a href=\"news/submitnews.php\" title=\"Submit News\" class=\"newstitle\" onclick=\"return overlay(this, 'submitnews')\"> <img src=\"img/submit.png\" width=\"24px\" height=\"24px\" alt=\"Submit\" style=\"margin-right:5px;\" /></a>"; } else { echo ""; } ?> Then how come this doesn't... <?php $allowed = array('1', '5', '2', '3'); if ($member['id'] == $allowed) { echo "<a href=\"news/submitnews.php\" title=\"Submit News\" class=\"newstitle\" onclick=\"return overlay(this, 'submitnews')\"> <img src=\"img/submit.png\" width=\"24px\" height=\"24px\" alt=\"Submit\" style=\"margin-right:5px;\" /></a>"; } else { echo ""; } ?>
  7. Even if my Website grows and grows and we have thousands of users there will only be a few people who can add news, so it doesn't really matter...and the array() I tried didn't work and this shouldn't really be a topic for the third party script, if I was having problems with the script then maybe yes but I'm not I just didn't know hot to make $allowed have more than one value so...
  8. I tried using... <?php $allowed = array("1", "5"); if ($member['id'] == $allowed) { echo "<a href=\"news/submitnews.php\" title=\"Submit News\" class=\"newstitle\" onclick=\"return overlay(this, 'submitnews')\"> <img src=\"img/submit.png\" width=\"24px\" height=\"24px\" alt=\"Submit\" style=\"margin-right:5px;\" /></a>"; } else { echo ""; } ?> And me (id = 1) and my friend (id=5) cannot see the button to add news...
  9. Sigh..... Invision Power Board Site Development Kit..... But that doesn't matter, how can I do it whether I use id or mgroup or whatever it doesn't matter, how would I do it? ???
  10. I'm using IPB SDK, I used get_advinfo which gives me... Array ( [id] => 1 [name] => no_comment [mgroup] => 4 [email] => matthias@pc-intern.com [joined] => 1052760073 [ip_address] => 80.129.253.245 [posts] => 7156 [title] => [allow_admin_mails] => [time_offset] => 1 [hide_email] => 0 [email_pm] => 0 [email_full] => [skin] => 12 [warn_level] => 0 [warn_lastwarn] => 0 [language] => 2 [last_post] => 1179530411 And a LOT more I could use the mgroup ( $member['mgroup'] ) instead I guess that would be better but still how would I do it?
  11. The below is all fine and dandy and it works but I need more than one value for $allowed. I think I need to use an array but I'm new to PHP and haven't encountered an array before, searching Google yielded no results that helped. I just need $allowed to have more than one value. <?php $allowed = "5"; if ($member['id'] == $allowed) { echo "Show the code to add news stories..."; } else { echo "Show nothing..."; } ?>
  12. Ok this is getting annoying now... If you go to www.veraci7y.net/test.php ...you will see the query is working fine. Now go go www.veraci7y.net/index.php click on the "Misc" in the left column. It's the EXACT same code, it works on test.php but not on index.php...what gives?
  13. Ok I'll do that now, I really need to get into the habit of checking for error messages...
  14. It looks fine to me, but it isn't returning any results but there are results in the database. I do connect to the database but that's earlier on in the page...just so you know. <?php $query = "SELECT wnewsstoryid, wnewstitle, wnewsshortstory, wnewsfullstory, wnewsauthor, wnewscategory, wnewsmemberid, DATE_FORMAT(date, '%d %M, %Y') FROM news ORDER BY date DESC"; $result = @mysql_query($query); if (mysql_num_rows($result)>0) { while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "<a href=\"http://www.veraci7y.net/news/read.php?id="; echo $row['wnewsstoryid']; echo "\" target=\"_blank\" title=\"Read full story...\" class=\"newstitle\">"; echo $row['wnewstitle']; echo "</a>"; echo "<p class=\"newsinfo\">Posted by <a href=\"http://www.veraci7y.net/forums/index.php?showuser="; echo $row['wnewsmemberid']; echo "\" class=\"user\" title=\"View Member's Profile\">"; echo $row['wnewsauthor']; echo "</a></p>"; echo "<p class=\"newscontent\">"; echo $row['wnewsshortstory']; echo "</p><br />"; } } else { echo "There are no news posts to display."; } ?>
  15. I did that and it now works... ??? Thanks for all the help, it's weird how it works now I removed the include...but oh well.
  16. Yeah they are both on the same webserver if that's what you mean, I will try dropping the include and adding it to the file directly.
  17. That's the thing though, it was working earlier and I haven't changed the variables at all...I've double and triple and quadruple checked them and they are correct... ???
  18. I added the submitted input field and still it doesn't work, but instead of a white screen I get "News could not be added." ???
  19. Looks like I somehow misplaced my hidden input field for submitted.
  20. <form id="addnews" action="news/submit.php" method="post"> <label for="title">Title:</label><br /> <input size="10" type="text" name="title" id="title" /><br /> <label for="category">Category:</label><br /> <select name="category" id="category"> <option value="veraci7y" selected="selected">Veraci7y.net</option> <option value="teamveraci7y">Team x Veraci7y</option> <option value="misc">Misc.</option> </select><br /> <label for="shortstory">Short Story:</label><br /> <textarea rows="4" cols="25" name="shortstory" id="shortstory">Enter a short summary here.</textarea><br /> <label for="fullstory">Full Story:</label><br /> <textarea rows="4" cols="25" name="fullstory" id="fullstory">Enter the full story here.</textarea><br /> <input type="submit" name="Submit" value="Submit" /> <input type="hidden" name="author" value="<?php echo $member['members_display_name']; ?>" /> <input type="hidden" name="memberid" value="<?php echo $member['id']; ?>" /> </form>
  21. I did as you said and I still get a white screen when I submit the form and nothing is added to the database. ???
  22. <?php DEFINE ('DB_USER', 'Teh Username'); DEFINE ('DB_PASSWORD', 'Teh Password'); DEFINE ('DB_HOST', 'localhost'); DEFINE ('DB_NAME', 'veraci7y_website'); $connectme = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySQL: ' . mysql_error()); @mysql_select_db (DB_NAME) OR die('Could not select the database: ' . mysql_error() ); ?>
  23. If it's just the include() that is wrong then can't someone tell me what's up with it...I'm guessing it'd take 20 seconds to explain and I'm new to coding in PHP so I have no idea why you're saying that there's something wrong with the include() It all looks good to me... ???
×
×
  • 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.