Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. In the future, please place OR tags around your code.
  2. isset $_GET['with']
  3. This topic has been moved to PHP Math Help. http://www.phpfreaks.com/forums/index.php?topic=337285.0
  4. Most likely a path issue. Post the image path dir, where the php file resides, and your include code.
  5. It would mean if the user hits submit without filling in any input fields, the query will still execute and a blank entry will appear in your database, that's up to you. And again, you should be preventing SQL injections with at least the mysql_real_escape_string method. i.e. $firstname = mysql_real_escape_string($_POST['FirstName']); $lastname = mysql_real_escape_string($_POST['LastName']); $boolean = mysql_real_escape_string($_POST['boolean']); $datetime = mysql_real_escape_string($_POST['datetime']); $dropdown = mysql_real_escape_string($_POST['dropdown']);
  6. This is a lot to ask of. You should Google some login tutorials to help you get started. If you get stuck at a particular point then come back and we will help you.
  7. This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=337245.0
  8. Yes. This IF block will only execute if all of these conditions are true (all input fields are NOT blank and are set): if(isset($_POST['FirstName']) && $_POST['FirstName']!="" && isset($_POST['LastName']) && $_POST['LastName']!="" && isset($_POST['boolean']) && $_POST['boolean']!="" && isset($_POST['datetime']) && $_POST['datetime']!="" && isset($_POST['dropdown']) && $_POST['dropdown']!="") If you don't care that they are blank then you can take out the !="" conditions for the desired fields. You can also implement a more user friendly error checking to tell the user which fields they left blank. The if(isset($_POST['submit'])) should prevent that from happening, as in, the SQL related code should only execute when the 'Save' button is hit. Make sure you clear your database from the blank entries to ensure you're not seeing previous entries.
  9. I meant something like this: //When the user hits the "save" button if(isset($_POST['submit'])) { //Checks to see if any values aren't set or are blank if(isset($_POST['FirstName']) && $_POST['FirstName']!="" && isset($_POST['LastName']) && $_POST['LastName']!="" && isset($_POST['boolean']) && $_POST['boolean']!="" && isset($_POST['datetime']) && $_POST['datetime']!="" && isset($_POST['dropdown']) && $_POST['dropdown']!="") { $firstname = $_POST['FirstName']; $lastname = $_POST['LastName']; $boolean = $_POST['boolean']; $datetime = $_POST['datetime']; $dropdown = $_POST['dropdown']; $db_table = "test"; $sql = "INSERT INTO $db_table (FirstName,LastName,boolean,datetime,dropdown) VALUES ('$firstname','$lastname','$boolean','$datetime','$dropdown')"; if($result = mysql_query($sql, $connection)) { echo 'Saved '; } else { echo "Error".mysql_error(); } } } ?> test </pre> <form action="<?php%20%24_SERVER%5B'PHP_SELF'%5D;%20?>" method="'post'"> test First Name: Last Name: ID: Boolean: Date-Time: Drop-Down: One Two Three </form> <b NOTE: You need to escape your POST variables with - mysql_real_escape_string.
  10. Post the current code.
  11. This is b/c your first block of code will always be executed. You need to move the if(isset($_POST['submit'])){ to the top. It doesn't do anything where you have it now.
  12. The www shows up for me. What's your question? This doesn't really have anything to do with PHP...
  13. You can install a plug-in YSlow, I know it's for FF, not sure what other browsers. It will analyze & optimize your images for you. https://addons.mozilla.org/en-US/firefox/addon/yslow/
  14. Maq

    problem with or

    You need parentheses: WHERE email= "mail@gmail.com" AND (activation=1 OR activation=2)
  15. AFAIK, this can't be done. Why do you need to do this anyway?
  16. If you did it right, it would work... What about it doesn't work?
  17. Only if they can dance. Did you get an answer yet?
  18. Read this tutorial: http://www.phpfreaks.com/tutorial/basic-pagination
  19. In the future, please place OR tags around your code.
  20. Maq

    Form query

    Post the relevant code.
  21. Post the actual query. Are you sure you're including 'id'?
  22. What happens? Are you getting errors? One thing I noticed right away is that you're missing terminating single quotes around your SQL values.
  23. This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=336927.0
  24. katsching, please start a fresh thread. This one is nearly 2 years old.
  25. This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=336918.0
×
×
  • 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.