AyKay47
Members-
Posts
3,281 -
Joined
-
Last visited
-
Days Won
1
Everything posted by AyKay47
-
i tend to agree as well, however if you insist on using checkboxes.. you will need javascript
-
yes, using javascript and the "disabled" checkbox input type attribute..
-
good solution..
-
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..
-
should produce a different image if the images are dependent on the integer, what does a "view source" show in your borwser?
-
$name = 'Kyle Cribbs'; $explode = explode(" ",$name);
-
you dont define $username before using it in your query..
-
yeah i forgot to end the line before that one with a semi colon " ; " $image = $row['images']; //add semicolon
-
whatever works for you
-
ha! Sex is by far the best. ha!!
-
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
-
do somewhat of the same thing.. this time using the empty function
-
refer to my post then
-
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
-
i missed something...change this line if (!$_POST['submit']) { and remove the exclamation.. if (isset($_POST['submit'])) { //exclamation removed
-
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"; } } }
-
you will include any PHP that you will use to validate and process the form..
-
your questions are basic... here are some good examples..
-
are you married to Pocahontas!?!? don't disrespect, thorpe has a point
-
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..
-
whatever you set the form action to be is where you want the script that handles your form to be..
-
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) ?>
-
You can always just get a Cloud Girlfriend cloud girlfriends are l33t
-
if else statement, $_FILES getting uploaded
AyKay47 replied to $php_mysql$'s topic in PHP Coding Help
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.. -
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.