Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. I like to use: if(mysql_num_rows($result) > 0) { You should also add: or die(mysql_error()); at the end of your mysql_query.
  2. Hehe, yeah I leave it there cause I reference it a lot. Did you get errors when you added that in your code?
  3. Yeah, I don't have an environment to test in, whoops! You're welcome
  4. Maq

    2 questions,

    $_SERVER['REMOTE_ADDR'] Do you have a database set up?
  5. Ok, if you trust your users then that's fine.
  6. You should also do some more checks on the file name because someone could easily inject something in your URL.
  7. What makes you think that you can't do that? Have you tried it?
  8. Without having to refresh the page, you're going to have to use AJAX. Also, without seeing some code it's hard to help you out a lot ;/ I'm not familiar with the blackbox function but if it only returns a string you should be able to successfully get this working. Maybe someone else has an example of a similar problem, but again, without code it's hard for me to give specific help. Good luck!
  9. Try: $sql="SELECT emails FROM table"; $result = mysql_query($sql) or die(mysql_error()); $num = mysql_num_rows($result); if($num > 0) { ?> while($row = mysql_fetch_assoc($result)) { ?> } ?> } else { echo "Sorry, there were no matches for that email address."; ?>
  10. What do you mean? The whole purpose of a development server or, local server, is to test on it so you don't effect users.
  11. You have to encode it for the URL. You can use the "escape()" function on the string in JS and urldecode() in PHP.
  12. If you have access to a terminal on your server you can run: ps -ef (find the pid of the script) kill 1234 (whatever the id is)
  13. No errors, no output? Can you add an echo here to see if you're passing anything through? mysql_select_db("scmanager", $con); echo "****" . $_POST['Type'] . "****"; //add this line here if($_POST["Type"]=='CA') //Double equals needed here
  14. Hehehe, that's why I keep it there
  15. Yeah I saw that, I reported a double post and I guess it got deleted. Hopefully this works...!
  16. Hmm, I just did what you said and it worked for me, it did ask for confirmation to resend the information, but other than that it worked fine. I tested it with some other links after I used the search as well.
  17. You're using an assignment equals rather than a comparator. You need to make all your IF's like this: if($_POST["Type"]=='CA') Notice 2 equal signs.
  18. SELECT DISTINCT country FROM table; Then have a second query inside the while loop to grab every user in that country like you have in your example.
  19. I think what you're looking for is extends. There seems to be a lot of the same questions lately...
  20. And you didn't get any errors when you put: ini_set ("display_errors", "1"); error_reporting(E_ALL); at the top of your script? Hmm, weird...
  21. For starters: if(!session_is_registered(myusername)){ has been deprecated as of 5.3 so you have to use: if(!isset($_SESSION['myusername'])){ Put this at the top of your page as your first PHP statements and see if there are any errors. ini_set ("display_errors", "1"); error_reporting(E_ALL);
  22. Is this your entire code?
  23. Is there a reason you assigned everything to a variable instead of just doing it right inside the HTML?
  24. Well, you're right, they aren't. Assembly, C, Haskell, ML, Lisp, Scheme, Prolog, etc. are all languages without an object model. "Not necessary" is not the same as "not useful" though. What Daniel says is very true. But if you're looking for a job then you definitely want to learn OOP because there is a larger job market for those languages.
  25. Assuming ALL of your column names are the same as the GET variables names, you can use something like this if you don't know which variables you're going to be getting: foreach($_GET as $key => $value) { $sql = "UPDATE Table1 SET $key = '$value' WHERE ID = '{$_GET[iD]}'"; $result = mysql_query($sql) or die(mysql_error()); } $key = name of the GET var $value = value of the GET var
×
×
  • 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.