Jump to content

justsomeguy

Moderator
  • Posts

    31,575
  • Joined

  • Last visited

  • Days Won

    77

Everything posted by justsomeguy

  1. I'm not quite sure I'm understanding correctly. I think though that you can only destroy sessions you have created, you don't have access to destroy a session that you haven't created.
  2. What you have: $query = "SELECT * FROM challanges WHERE (challanger = '$user' OR challanged = '$user') AND declined != '$user' ORDER BY id DESC";$result = mysql_query($query)or die(mysql_error());while($row = mysql_fetch_array($result)) {extract($row);echo "<a href='console.php?p=EditChallenges&cid=$id'>$challanger vs. $challanged</a> - $date<br>";} When you make the query, and start the while loop, you are using mysql_fetch_array, which results in $row[0], $row[1], $row[2], etc. If you want $row['id'], $row['challanger'] (btw, it's "challenger") you need to use mysql_fetch_assoc instead. Try this: $query = "SELECT * FROM challanges WHERE (challanger = '$user' OR challanged = '$user') AND declined != '$user' ORDER BY id DESC";$result = mysql_query($query) or die(mysql_error());while($row = mysql_fetch_assoc($result)) { extract($row); echo "<a href=\"console.php?p=EditChallenges&cid={$id}\">{$challanger} vs. {$challanged}</a> - {$date}<br>";} You can also do this: $query = "SELECT * FROM challanges WHERE (challanger = '$user' OR challanged = '$user') AND declined != '$user' ORDER BY id DESC";$result = mysql_query($query) or die(mysql_error());while($row = mysql_fetch_assoc($result)) { echo "<a href=\"console.php?p=EditChallenges&cid={$row['id']}\">{$row['challanger']} vs. {$row['challanged']}</a> - {$row['date']}<br>";}
  3. Also take a look here:http://www.php.net/manual/en/features.file-upload.php
  4. You need a webserver to execute your PHP files and send the result to the browser. When you have your browser visit an address that ends in .php (like you are now), your browser asks the server for that PHP file. The server in turn executes the PHP code, and instead of sending your browser the PHP code, the server sends the browser what PHP tells it to.The easiest thing to do in your case, unless you want to install your own webserver for testing (Windows does include one you can use), and then install PHP on the server, is rent a server online (or find someone willing to let you use theirs). Here's a good host for $2/month:http://geekhosting.com/Then what you have to do is connect to the server through FTP, upload your PHP files, and visit them in your browser. If your site is called mysite.com, and your PHP file is page.php, you would FTP to mysite.com, upload page.php, and then in your browser visit http://mysite.com/page.php to see the result. ASP works the same way, except it only works on Microsoft servers. If you want to learn PHP well, I can recommend this book:http://www.oreilly.com/catalog/progphp/
  5. justsomeguy

    SQL or PHP?

    If you are using MySQL:http://www.php.net/manual/en/function.mysql-error.phpAlso, it would be helpful to describe what happens when you execute the code instead of saying that it doesn't work.
  6. justsomeguy

    PHP Editors...

    Notepad is terrible for coding.I prefer ConTEXT (http://www.context.cx/), but I also like some of the features of PSPad (http://www.pspad.com/). It's hard to beat a logo that features a dog with a butthole.
  7. One thing you might try is to remove the </input> closing tag, it's not necessary. IE might be confused over that. If you are going for XHTML conformity, you can close the input tag like this: <input type="image" name="msearchitem" src="butt_chairs.jpg" value="CHAIRS" />
  8. You probably want to ask hotmail about this. Also try copying and pasting the headers for an email you received (not the code, the headers that the actual email contains). You may need to reconfigure the mail server to send out different headers.
  9. You can use this function to bring all request variables into the global scope:http://www.php.net/manual/en/function.impo...t-variables.phpOnce you do that, you would have to use 'variable variables' to refer to the individual request variables: inport_request_variables("p", "varprefix_");$varname = "varprefix_" . $fileinfo[0];echo "the value of {$varname} is {$$varname}"; //note the double $ signs More on variable variables:http://www.php.net/manual/en/language.variables.variable.phpHowever, your example should still work. You should also be able to do this: $varname = $fileinfo[0];echo $_POST[$varname]; If you are getting an array index error, you could try changing the error reporting in php.ini to not report those errors (the value would just be ""), or you can also check to see if the value has been set before using it: $varname = $fileinfo[0];if (isset($_POST[$varname])){ echo $_POST[$varname];} More on the isset function:http://www.php.net/manual/en/function.isset.php
  10. There's also the reference on php.net for sessions:http://www.php.net/manual/en/ref.session.phpNot a tutorial per se, but still very helpful.
  11. That's the guest's problem, not the community's, or maybe they simply just want to remain anonymous. I am 26. I have a BS in computer science from Arizona State, I hold a job working four 9 hour days per week (currently writing hardware simulation for a military project), and I also co-operate a home-based web development business out of my house on the 3 remaining days of the week, as well as nights. I also own my own house, and have built a porch, a garage, laid a wood floor, and painted the entire interior over the past 2 years. I'm not trying to be condescending here, but if your title is 'moderator', I would expect that you would indeed take the responsibility that comes with the title (and before you get angry at me, I'm not trying to imply that you aren't doing your job). I wasn't trying to imply anything else, but the replies I have gotten over the guest suggestion have mostly revolved around not wanting to deal with messages that require moderation. No I'm not, I was replying directly to the author of the quote I referenced. I didn't make that clear, but I was. I'm only trying to give my reasons for why I think guest accounts should be allowed, and rebutting other people's reasons for not wanting them if I think the argument is incorrect. Yes, Opera will fill in the extra parts, but it requires a few extra seconds of waiting while it sends out the various DNS requests. Not a big deal, but my main reason for asking the DNS fix is so that I can simply refer people to "w3schools.com", and have the web site respond when they type that in. Of course not, that's why moderators are required. Which is why the requirements don't change for guest accounts, moderators are still required either way. Now I never made that claim or accusation, that's not the language that I used. I'm not trying to be offensive here, I apologize if I came off that way.The arguments against guest accounts have been:1) aspnetguy's argument to promote long-term involvement, which is a valid argument that I haven't argued against.2) an increase in spam will follow. I don't consider this argument valid, because a bot could already create an account and post a spam. There already is no spam protection and I haven't seen any spam (I haven't looked for it either, and I doubt any would be left regardless).3) leet-speak will follow. This argument is completely without logic. I fail to see how guest accounts and people who use leet-speak are related.Now this thread is completely off-topic from the point of the forum, so at this point I'll drop it. I didn't mean to ruffle any feathers, I was genuinely trying to suggest that it would be an improvement, I think it would encourage more people to seek help. If that's not the consensus, then I'll drop it.
  12. That's simply not true. The link I posted above is to a forum for a programmer's text editor, and the rules are almost always followed, even by guests. If they aren't, then like I said, that's what moderators are for. If everyone always followed the rules, then you wouldn't need mods.Also, I just have to say this. Make sure I get it right:leet-speak: badgiant pictures of tired web cliches in your signature: goodIs that about right? If that's the attitude you want to project, fine, but that's not very conducive to having a helpful, inclusive community.From what I see the mods saying, I realize that this isn't going to happen, I'm just trying to point out that your reasons for not wanting to do it are not very good reasons, based on the forums that I visit. It seems that the mods would rather not do the extra work of actually moderating. I'm simply trying to reason with you. That, however, cannot be reasoned with.
  13. Sheilds UP is a free service from Steve Gibson, I don't think he advertises anywhere.I should also mention that Steve Gibson has his web site at grc.com (Gibson Research Corp.).
  14. One example would be the forums at http://forum.context.cx, granted there is the occasional Asian language ringtone spam, but I guess that's what moderators are for. But there I have seen a lot of people start off as guests and later register once they realize no one bites.
  15. 1. Update your DNS server to redirect all requests for w3schools.com on port 80 to www.w3schools.com. Seriously. There's no technical reason why you can't. It looks lazy, and considering the site's content, it looks incompetent. It would be nice to be able to refer people to go to w3schools.com, it's easy to remember, but instead I have to make sure I specify and they understand that they have to type in the www subdomain for it to work, or else I field questions from people saying they can't get to the server.2. Allow guests to post on the forum for people who don't plan on posting more than 1 message.Thanks.
×
×
  • Create New...