Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Everything posted by GingerRobot

  1. [quote author=neylitalo link=topic=105646.msg585527#msg585527 date=1177724533] I'm going to throw some fuel on the fire. What about our responsibility as people to be honest and respect one another? You know it's not yours, and you know they wouldn't appreciate it - why do you have the right to use the service that they paid for? Why are you allowed to take advantage of someone who knows less about network security than you do? Sure, some people just don't care, but you forget - this is still relatively new technology, and people aren't very well educated as to the risks and security pitfalls. WEP is crackable, and I've heard of a way to obtain WPA keys although I've never tried it. Just because you're using faulty technology, that doesn't mean that people are licensed to take advantage of it. Microsoft Windows is one of the least secure operating systems ever. Hell, they just released a critical security patch for a hole in ANIMATED MOUSE CURSORS. The vast majority of the world uses Windows, and I think you'll agree that people shouldn't take advantage of it "just because they can." The moral of the story: "They should know better" isn't a valid excuse. [/quote] Corr, we're really getting a bit of a philosophical debate going on here now aren't we? Might be a bit late to this thread, but thought id throw my opinion in. As neylitalo says, just because you can use it doesn't mean you should use it. However, I think i most agree with those that says it depends on the situation. Permantly using someone else's wireless network is a world away from taking advantage of someone elses to fix your broken network. If you're not benefiting from it particularly(that is, you're still paying for yours anyway), and the person from whom you are piggybacking is not affected by it(which is most likely) then i would think there is no real moral issue.
  2. In what way does it not work? What happens when you try it? Can we see the relevant code with this being used?
  3. You can make the names of inputs into an array. For example, you might have: <input type = "text" value="names[]" /> <br /> <input type = "text" value="names[]" /> <br /> <input type = "text" value="names[]" /> <br /> <input type = "text" value="names[]" /> <br /> Your php might then contain: <?php foreach($_POST['names'] as $value){ echo $value.'<br />';//would echo each of the 4 names that were entered. } ?> Obviously just an example, but you should see how you can apply it to your code.
  4. I wonder if the problem is that there is an error with your query and you have display_errors off? Anyway, you don't need to retreive the value from the database first. You can save yourself a query and do: $query_update="UPDATE sr_size SET amount= amount +'$add_amount' WHERE '$add_thick' = size"; This sets your amount field to whatever is already in it, plus $add_amount.
  5. I think you would do $row->date_submitted. Not 100% sure though. If not, try changing your query to: $sql->query("SELECT news_id, title, author, news, DATE_FORMAT(date_submitted, '%b %D, %y @ %l:%i %p') as date_submitted FROM news ORDER BY date_submitted DESC LIMIT 3");
  6. You'll need to modify the .js file: var url="getuser1.php" url=url+"?q="+str url=url+"&yourothervariable=somevalue" url=url+"&sid="+Math.random() And then the php file: <?php $q=$_GET["q"]; $yourothervariable = $_GET['yourothervariable']; Obviously you'll need to change the js to reflect what you actually want to pass in the url.
  7. Hmm, i could be way off - never used any sort of rewriting at all, but could you not have some intermediate php script which all your forms point to? So you submit your form to say, rewrite.php which takes all the variables from the form, rewrites them into the url you wanted, and redirects to that?
  8. Well i cant see any reason why you would be redirected to your index page. Unless, of course, one of the pages that you DO get redirected to(e.g. news.php/suspended.php) contains some sort of login check which is not working, that redirects you back to the index page.
  9. You never know, it could be the next myspace... Edit: Mind you, if you thought this was bad, have you seen the other thing these people designed? http://www.visitorville.com/
  10. A combination of the sttotime() and date() functions should be able to do all that for you.
  11. Yes, any and all input from the user should be consider unreliable. Just because you have a drop down box with options 1 to 5 doesn't mean that the value you get WILL be 1 to 5. Same goes for any javascript validation you do.
  12. Well, given that confirm boxes are usually used when you go to submit a form, surely you dont need to? The confirm boxes usually submit the form if the user clicks ok, and dont if dont click ok. So, if the form has been submitted(which is must have been for php to be dealing with it) then you can assume that either javascript is turned off, or the user has confirmed.
  13. Try doing: $result_query = mysql_query($query) or die(mysql_error()); It appears that there is a problem with your query. Given the simplicity of the query itselft, i would guess that perhaps the table dc doesn't exist or there is a problem with the connection.
  14. The strtotime() function is amazingly robust. Although it doesn't like it if you just put in JAN or FEB ect, its fine if you add a year after. Doesn't really matter what the year is, but might as well do the current year: <?php $year = date('Y'); $timestamp = strtotime('JAN'.$year); $month = date('m',$timestamp); echo $month; ?> produces 01
  15. What is it that you are trying to do exactly? What is the purpose of the function? It seems to me like what you are trying to achieve can be done much more easily with the date() function.
  16. You would probably find the error a whole stack easier to spot if you intended your code: <?php session_start(); require('areatop.php'); require('includes/colleft.php'); if (isset($_POST['submit'])) { $error = array(); if (empty($_POST['username'])) { $error['username'] = "Please enter a username"; } if (empty($_POST['password'])) { $error['password'] = "Please enter a password"; } if (count($error) == 0) { // FORM PROCCESSING HERE $query = mysql_query("query here"); if (!$query) { echo "NO QUERY" . mysql_error(); } else { $number = mysql_num_rows($query); if ($number == "1") { echo "Logged In"; } else { $error['false'] = "Incorrect login details"; } } } else { echo '<div class="formerror"><img src="includes/images/triangle_error.gif" />Please correct the following errors:<ul>'; foreach ($error as $e) { echo "<li>$e</li><br>"; } if (!empty($error['false'])) { echo $error['false']; } echo '</ul></div><br>'; } } ?> Basically, $error['false'] can only ever be set if there are no errors in the username and password, since all of the database quering is contained in the codeblock: <?php if (count($error) == 0) { //here is all the quering stuff and here is were $error['false'] is set } ?> You then add an else statement where the errors are displayed. <?php if (count($error) == 0) { //here is all the quering stuff and here is were $error['false'] is set }else{ //here is where you echo the errors } ?> So for your false error to be displayed, both parts of this would have to be executed, which is , of course, im possible( since count($error) cant be 0 and not 0). Hope that makes some sense. It's kinda difficult for me to suggest the fix. It depends how you want your script to work.
  17. From your code, i gather that the text boxes are named as an array? So you would have textBoxName[0], textBoxName[1], textBoxName[2] ect as field names? If so, couldn't use use the count() function on the textBoxName array? Other than that, you could always store the number of text boxes added in a hidden field.
  18. A lot of websites are available in differant formats. For instance, you can view a lot of websites from a mobile phone, but they will look completely differant to how they would look in your ordinary browser. The content of the website is therefore dependant on the information it can gather from the user. If you were using something like file_get_contents, i think i would be right in saying that no information is passed to the site. This often results in a vastly cut down version of the site being retrieved. Usually you are better off using cURL. You can pass a lot of things in the request like a user-agent. This usually helps you get the content you require. Could be something completely differant that caused your problems. But its a possibility.
  19. The substr_count() function should be what you need.
  20. Did you find out if she was supposed to be taking the kids? lol
  21. I guess you meant any chance. It depends on how you nest your statements. Consider two examples: <?php if($somecondition == true){ if($othercondition == true){ //$somecondition is true and othercondition is true }else{ //$somecondition is true and othercondition is false } } ?> <?php if($somecondition == true){ if($othercondition == true){ //$somecondition is true and othercondition is true } }else{ //$somecondition is false and othercondition is either true or false } ?> I dont think i can explain it better in words than by example, so i wont as ill just confuse the issue. Hopefully you understand.
  22. Presumably you are referring to the "read count" feature on the forum? I always think this gets a bit overestimated I for one often refresh a tab with a topic in to see if there are any new replies, and i dont suppose im the only one. Also, some of the people watching might well take a look becase it might help them learn. I'll read a topic if it sounds interesting, even if i know i wont be able to contribute. I've learnt an awful lot of php like that. Ill also agree that its so easy to look at some posts and just not have the willpower to type a response. I personally get most annoyed by those posts where the the creator hasn't bothered to type in readable english,whilst the posters are quite clearly english speaking. If you're not english speaking, i dont mind that your english is bad. After all, my french, german, italian(insert relevant language here) is either terrible(french) or non existant(everything else). However, if you ARE english/american ect, then it really winds me up. Corr, this has turned into a bit of a rant. Ah wells, nothing like a good rant once in a while.
  23. What trouble exactly? What does the script do so far? It looks to me like you're not writing to the file as yet - does that mean you are unsure how to do that, or does that mean that you debugging prior to that by echoing the data(that appears to be what you are doing at the moment)
  24. I would agree that babelfish does generally give a better translation that most. However, the translations are still gisted, non-context specific and often in the wrong tense. Apart from anything else, consider how many words have duplicate meanings in english. They may have differant words for each of the different meanings in french. For example, a match can refer to a game of sport etc, or something used to make a flame. The words in french are differant depending on which meaning you want.
  25. Im not really sure if this is exactly what your question is, since im a little confused by that. However, when you are adding to a field in the database, there is no need to retreive the value first. You can do: <?php mysql_query("UPDATE `games` SET `worked` = `worked` + '1' WHERE id = '$id'") or die(mysql_error()); ?>
×
×
  • 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.