Jump to content

ChaosXero

Members
  • Posts

    80
  • Joined

  • Last visited

    Never

Everything posted by ChaosXero

  1. If that is an exact copy, you misspelled fruit.  That might be the error, cause otherwise that should work.
  2. try adding in a html,body {height:100%;} to your CSS
  3. Thanks for the replys! I'm trying to get my artistic friend to make a new banner and I'm working on a logo. Also a note: the hover works fine in FireFox and not IE because IE only supports :hover on the A tag, so the highlighting you see in IE is really a fallback.  (try looking at it in FireFox, it's a fun effect).  I'm very happy that IE7 will support :hover on all tags, but it's stuck the way it is for now.
  4. Thanks a lot, I was wondering about that, didn't realize I needed a space.  I'll look into the amazon ads. I'm unfamiliar with INI_SET will I have to run that once, and will it make my adresses site.org/?var=etc&ampvar2=etc?
  5. I use Amazon Ads on a site that I maintain (it's for a library) and when I try to validate the XHTML, it goes haywire on the ad. http://validator.w3.org/check?uri=http%3A%2F%2Fnormaltac.org%2F&charset=%28detect+automatically%29&doctype=XHTML+1.0+Transitional Anyone know why this happens and if I can fix it.  It irks me when my pages dont validate.
  6. http://normaltac.org this is the first web site that I have truly created from scratch and maintained, it was created for a group that I participate in at my local library.  This is the third (and final) redesign, and I thought some of the people here might offer some suggestions.  All the pages are similar, but some of the pages past the homepage my not be completely styled.  Feel free to poke around though.
  7. I have an array I'm using for errors and I'd like it to output the name of the array section i.e. array error() =     username = 1 I want to output Bad 'Username!' (told to do so because username = 1) I just need to know what to do to output the 'name' of an item in an array.  Hope this makes sense.
  8. AH! Thank you! It finally works.  I was thinking it might have been a scope issue but that never occured to me.
  9. BUMP... It's going to be the death of me
  10. Still no luck... I'm updating the code again with a few changes
  11. It wont output a mysql error when it dies.  What does that mean?!
  12. Hmm... it works like that on the other pages.  I'll try it though just in case. No Luck.
  13. Everything gets passed to 'login' correctly, however it never manages to make it to the query inside the login function. (see comment) There may be other things wrong with the code, but I really just need to figure out why I cant get connected. P.S. All of the Database info works correctly on other pages, so it's not that (and yes, some things have been removed) [code] <?PHP define("host", ""); define("UNAME", ""); define("pword", ""); $conn = mysql_connect(host,UNAME,pword) or die(mysql_error()); $db = mysql_select_db('db173735005'); function login($u, $p) { $sql = "SELECT * FROM users WHERE username = '".$u."'"; $result = mysql_query($sql, $conn) or die("Error!"); $res = mysql_fetch_assoc($result); echo "Test!\n\n"; echo $res['password_hash']; if ($res['password_hash'] === $p) { session_start(); $_SESSION['username'] = $u; $sesid = microtime().$u.microtime().rand(0, 1000); $_SESSION['sessid'] = md5($sesid); $_SESSION['accesslevel'] = $res['accesslevel']; $sql2 = "UPDATE `users` SET `sess_hash` = '".$_SESSION['sessid']."' WHERE `username` ='".$u."' LIMIT 1" ; $updated = mysql_query($sql2) or die("Not Updated!"); return 1; }else{ return 0; } }//End of Func_Login ?> <? if (isset($_POST['username']) && isset($_POST['pass'])) { if (!empty($_POST['username']) && !empty($_POST['pass'])) { $user = $_POST['username']; $pass = md5($_POST['pass']); mysql_real_escape_string($user); mysql_real_escape_string($pass); if (login($user, $pass) == 1) { echo "Logged In!"; echo "Add js here to push to next page."; } else { echo "Bad Username/Pass.  Try again."; echo "$pass"; echo "$user"; } } } ?> [/code]
  14. Fixed! Turned out to be the 'or die' in the while loop.  Thanks for all the suggestions everyone!
  15. Free cookies and cupcakes if you solve this! I'm on like hour 3 here...
  16. The PHP used to be where that function call is and still caused the same exact error.  I was hoping making it a function as such would fix it but no luck. 
  17. Bump... I've tried about everything and this still wont work...
  18. I removed part of the define because it had my database info in it.  Not sure what you meant by your example.  Can you explain more based on my code?
  19. [code] <?PHP define("host", define("UNAME", define("pword", function print_news() { mysql_connect(host,UNAME,pword) or die(mysql_error()); mysql_select_db(); $sql = "SELECT * FROM `news` "; $result = mysql_query($sql) or die(mysql_error()); while($res = mysql_fetch_array($result) or die(mysql_error())){ echo "<table border=\"1\">"; echo "<tr><td>".$res['user']."</td><td>".$res['title']."</td><td>".$res['date']."</td></tr>"; echo "<tr><td colspan=\"3\">".$res['detail']."</td></tr>"; echo "</table>"; echo "<hr />"; } } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <META NAME="DESCRIPTION" CONTENT="Normal Public Library Teen Advisory Council Book Discussion Group"> <META NAME="KEYWORDS" CONTENT="books,book,discussion,teens,reading,writing,normal,public,library,"> <title>Teen Advisory Home</title> <link href="styles.css" rel="stylesheet" type="text/css"> </head> <body> <div id="header"><p>Home | About | Meetings | Books | Links&nbsp;</p></div> <div id="container">   <div id="content">     <p>You've reached the official home of the Normal Public Library's Teen Advisory Council. The groups main goal is to bring in teens who share common ground in the love of books, reading, writing and just having fun. For more info about the group check the 'about' page.</p>     <hr /> <p><strong>News:</strong></p> <? print_news(); ?>   </div> </div> <div id="footer">Page Created and Maintained By: Dave Lyon | Content and Design &copy;2006 Dave Lyon<br /> Hosted By: <a href="http://tialys.net">Tialys.net</a></div> <div class="ad_nugget"><script type="text/javascript"><!-- google_ad_client = google_ad_width = 120; google_ad_height = 240; google_ad_format = "120x240_as"; google_ad_type = "text"; google_ad_channel ="6524514903"; google_color_border = "000000"; google_color_bg = "990000"; google_color_link = "FFFFFF"; google_color_text = "FFFFFF"; google_color_url = "000000"; //--></script> <script type="text/javascript"   src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script></div> </body> </html> [/code] everything up to the print_news() function displays correctly.  After the function nothing shows up.
  20. I have a php script inside of an HTML document (index.php for my site) and after the PHP executes correctly it stops processing the page.  It just stops everything.  Even echoing the rest of the content does no good.  I can post the code if necessary but has anyone had a similar problem or no of a solution? Thanks in advance.
  21. You'd have to find some way to script a log in to the site, and use the sites uploader, and I dont know that you could do that. Otherwise I cant think of any way to do it.  Most sites try to prevent this to protect their servers.
  22. You would need to pass the number as a post variable from a form.  For example: User posts form with number to get_form.php. get_form looks for $_POST['rand']. user just sees get_form.php.  If you dont mind the number showing in the url, just have it $_GET instead of post and you wont need to post from a form, but rather file.php?foo=number
  23. There is a variable called $_SERVER['PHP_SELF'] that gets the current script location.  Be warned, this will return very strange results on shared hosting.  It gives something completely off base on my shared hosting. EDIT: What does 'basename' do? EDIT EDIT: php.net/basename shed some light on this, it fixes the problem I mentioned.  Silly me.  Sorry about that.
  24. [code] <? if(!empty($_GET['echo']) { do_your_function(); } else { do_something_else(); } ?> [code][/code][/code]
  25. You could force a refresh w/ a header(location: yoursite).  Otherwise... I'm not sure.  The image will stay until it is reloaded.  You could use Jscript to refresh it (an AJAX type effect).
×
×
  • 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.