Jump to content

AyKay47

Members
  • Posts

    3,281
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by AyKay47

  1. i tend to agree as well, however if you insist on using checkboxes.. you will need javascript
  2. yes, using javascript and the "disabled" checkbox input type attribute..
  3. good solution..
  4. lol, nice.. I make it to the gym maybe a few times a month, whenever my eyes don't hurt so bad and I don't have a headache from looking at the computer screen for 8 hours..
  5. should produce a different image if the images are dependent on the integer, what does a "view source" show in your borwser?
  6. $name = 'Kyle Cribbs'; $explode = explode(" ",$name);
  7. you dont define $username before using it in your query..
  8. yeah i forgot to end the line before that one with a semi colon " ; " $image = $row['images']; //add semicolon
  9. whatever works for you
  10. ha! Sex is by far the best. ha!!
  11. you havnt set values for $user and $pass , so they will always return false...you will need to set these to your POST values.. e.g $_POST['username'] = $user
  12. do somewhat of the same thing.. this time using the empty function
  13. refer to my post then
  14. i am assuming that the undefined errors are undefined indices..this is because you do not check to see if your form has been submitted using the isset funtion.. if(isset($_POST['submit'])){ //this is assmuming that you name your submit type input "submit" //form validation code } if you are receiving different errors than this...let us know
  15. i missed something...change this line if (!$_POST['submit']) { and remove the exclamation.. if (isset($_POST['submit'])) { //exclamation removed
  16. php will be something like if ($_SESSION['uid']) { echo "You are already logged in, if you wish to log out, please <a href=\"./logout.php\">click here</a>!\n"; } else { if (!$_POST['submit']) { $user = mss($_POST['username']); $pass = $_POST['password']; if($user && $pass){ $sql = "SELECT id FROM `users` WHERE `username`='".$user."'"; $res = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($res) > 0){ $sql2 = "SELECT id FROM `users` WHERE `username`='".$user."' AND `password`='".md5($pass)."'"; $res2 = mysql_query($sql2) or die(mysql_error()); if(mysql_num_rows($res2) > 0){ $row = mysql_fetch_assoc($res2); $_SESSION['uid'] = $row['id']; echo "You have successfully logged in as " . $user . "<br><br><a href=\"./index.php\">Proceed to the Forum Index</a>\n"; }else { echo "Username and password combination are incorrect!\n"; } }else { echo "The username you supplied does not exist!\n"; } }else { echo "You must supply both the username and password field!\n"; } } }
  17. you will include any PHP that you will use to validate and process the form..
  18. your questions are basic... here are some good examples..
  19. are you married to Pocahontas!?!? don't disrespect, thorpe has a point
  20. one file will be html.. <html> <head> <body> <table border="0" cellspacing="3" cellpadding="3"> <form id="login-form" method="post" action="login.php"> <tr><td>Username</td><td><input type="text" name="username"></td></tr> <tr><td>Password</td><td><input type="password" name="password"></td></tr> <tr><td colspan="2" align="right"><input type="submit" name="submit" value="Login"></td></tr> </form></table> </body> </head> </html> then in this case, login.php will contain the necessary php to handle the form..
  21. whatever you set the form action to be is where you want the script that handles your form to be..
  22. this is most likely because you are not first checking to see if the form has been submitted.. you will want to add the name attribute to the input type submit as well...for this example we will say that the name is name='submit'... <?php $con = mysql_connect("localhost","",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("final", $con); $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; $age = $_POST['age']; $submit = $_POST['submit']; if(isset($submit)){ if(!empty($firstname) && !empty($lastname) && !empty($age)){ $sql="INSERT INTO my_db (FirstName, LastName, Age) VALUES ('$firstname',$lastname',$age')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); }else{ echo "1 record added"; } } } mysql_close($con) ?>
  23. You can always just get a Cloud Girlfriend cloud girlfriends are l33t
  24. you are using an array as the preg_match() first argument.. the first argument needs to be a regular expression pattern, not an array.. that entire condition can be removed, as the !in_array condition takes care of non wanted files..
  25. this really boils down to personal preference, both methods wil work, for its simplicity I myself would go with number 2 simply because the task that you want to execute is not dificult and there is no need to over work things..a single method with passable arguments should be all that you need to query a database and ouput results.
×
×
  • 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.