cluce
-
Posts
354 -
Joined
-
Last visited
Never
Posts posted by cluce
-
-
is there a setting to set for mysql to connect via web
-
correct but it only displays the error when I try to logon or access the database. You can still view the web pages you just not logon or register.
-
I am baffled. Can someone tell me why the only output I receive in my email is the message: what ever submitted showed up. My name and email doesn't work???
here is my code........
<?php echo "<p>Thank you, <b>".$_POST["name"]."</b>, for your message!</p>"; echo "<p>Your email address is: <b>".$_POST["email"]."</b>.</p>"; //set up the mail $recipient = "cluce@mydomain.com"; $subject = "Form Submission Results"; //start building the mail string $msg = "name: ".$_POST["name"]."\n"; $msg = "email: ".$_POST["email"]."\n"; $msg = "message: ".$_POST["message"]."\n"; //send mail mail ($recipient, $subject, $msg); ?>
-
I already checked there. And it is enabled. I can logon on to my machine. I just cant logon through another machine on the network. I have the website hosted on IIS.
-
that is already removed. I can connect or logon through the website on my machine. I get a connection error trying to logon through my co-workers machines. I have my website being hosted on my machine.
-
cool. could you tell me what and where do I configured this on the php.ini page. I am guessing the mysqli section but not sure what to do their?
-
I currently have a dynamic web site published over my work's domain but I am having trouble connecting to the database over the domain. Currently, mySQL is configured locally. Can someone tell me how to configured this so my coworkers can logon on to the database through their machine.
Obviously, I have a connection issue....
Fatal error: Call to undefined function mysqli_connect() in C:\Inetpub\wwwroot\email_info.php on line 8
Any help is greatly appreciated.
-
I currently have a dynamic web site published over my work's domain but I am having trouble connecting to the database over the domain. Currently, mySQL is configured locally. Can someone tell me how to configured this so my coworkers can logon on to the database.
Obviously, I have a connection issue....
Fatal error: Call to undefined function mysqli_connect() in C:\Inetpub\wwwroot\email_info.php on line 8
Any help is greatly appreciated.
-
I know this is not hard to do. I just am a real newbie to this stuff. I mostly use php. what would be the JS function to call to redirect a user back to the previous page when they do an onclick on the cancel button. I am using Dreamweaver 8. I know how to call the javascript. I am just not sure how to write it. Any help is appreciated.
-
thats what I am trying to figure out. What would be my mail server address???
-
I am trying to send mail in a web in a web form on a Windows XP machine and I receive this.....
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\sendmail.php on line 24
Here are my settings..
[mail function]
; For Win32 only.
SMTP = localhost
; For Win32 only.
sendmail_from = you@yourdomaim
We don't use a mail server through our ISP at work. We have our own mail server behind a proxy server. I am not sure how I configure this. Would I use my company email serve to test this?
-
well I inserted proper HTML code this time and still screws up but I found another validation I am going to use. Thanks again
-
your right. so I would error check that another way which I found. thanks
-
when I add this input this in the text field...<tr>d<tr/>........It screws up the whole design. It looks unprofessional.
Again. I am using the strip tags function not the sstrip lashes.
-
the first code was right. I am not going to use a strip slashes function only the trim and strip tags.
-
my mistake on the code.
this is what I have...
<?php //initialize the session if (!isset($_SESSION)) { session_start(); } //connects to database $mysqli = mysqli_connect("localhost", "root", "", "test"); //check to see if email exists in database/table $usercheck = stripslashes(trim($_POST['email'])); $check = mysqli_query($mysqli,"SELECT email FROM auth_users WHERE email = '$usercheck' LIMIT 1"); $check2= mysqli_num_rows($check); //if the email does not exist, it gives an error if ($check2 != 0) { echo ("email exists"); //create and issue the query //$sql = "SELECT username, password FROM auth_users WHERE email = '".$_POST["email"]."'; //$res = mysqli_query($mysqli, $sql); //$to = "cluce@reaganpower.com"; //$subject = "Website Inquiry Form"; //$body = "$sql"; //mail ($to, $subject, $body); //header("Location: http:reaganpower.com/thankyou.html"); }else{ $_SESSION['emailExists'] = "<font color='red'>The email"." ".$_POST['email']." "."does not exist in our database.<br>You may register for free by filling out the online registration form.</font>"; header ("Location: forgot_password.php"); } mysqli_close($mysqli); ?>
-
I am trying to error proof my web site but when I input a tag in the text field the tag still disrupts my web page. Can someone give me any suggestions?
It looks like I am using the strip slashes function correctly. Is their some other code I need to add to this? My trim function works fine but not the strip slashes. I even took out the trim function and still no go. ???
here is my code
<?php //initialize the session if (!isset($_SESSION)) { session_start(); } //connects to database $mysqli = mysqli_connect("localhost", "root", "", "test"); //check to see if email exists in database/table $usercheck = strip_tags(trim($_POST['username'])); $check = mysqli_query($mysqli,"SELECT email FROM auth_users WHERE email = '$usercheck' LIMIT 1"); $check2= mysqli_num_rows($check); //if the email does not exist, it gives an error if ($check2 != 0) { echo ("email exists"); //create and issue the query //$sql = "SELECT username, password FROM auth_users WHERE email = '".$_POST["email"]."'; //$res = mysqli_query($mysqli, $sql); //$to = "cluce@reaganpower.com"; //$subject = "Website Inquiry Form"; //$body = "$sql"; //mail ($to, $subject, $body); //header("Location: http:reaganpower.com/thankyou.html"); }else{ $_SESSION['emailExists'] = "<font color='red'>The email"." ".$_POST['email']." "."does not exist in our database.<br>You may register for free by filling out the online registration form.</font>"; header ("Location: forgot_password.php"); } mysqli_close($mysqli); ?>
-
thanks for all your comments. I really don't need a top level of security just something that secures a website fairly well.
-
I meant the mySQL password function..
-
what is more secure( password or SHA-1) function??? or both of these will do a good job if protecting the password? I know one just disguises the password with a fingerprint which is not encrypted and the SHA-1 is encrypted. Any opinions would be great?
-
can someone tell me how to get rid of this error.......
Catchable fatal error: Object of class mysqli_result could not be converted to string in C:\wamp\www\fail.php on line 21
here is my code.........
<?php $mysqli = mysqli_connect("localhost", "root", "", "test"); $sql = ("SELECT failed_logins FROM auth_users WHERE username = 'me'"); $attempts = mysqli_query($mysqli, $sql); //disables user if ($attempts >= 3){ echo ("login disabled"); } else { echo ("its good"); echo ("$attempts"); } ?>
when I ran this I got his...
its good
Catchable fatal error: Object of class mysqli_result could not be converted to string in C:\wamp\www\fail.php on line 21
-
now I have these....???
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, string given in C:\wamp\www\userlogin.php on line 21
Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\userlogin.php:21) in C:\wamp\www\userlogin.php on line 63
<?php session_start(); //check for required fields from the form if ((!isset($_POST["username"])) || (!isset($_POST["password"]))) { header("Location: user_logon.html"); exit; } //connect to server and select database $mysqli = mysqli_connect("localhost", "root", "", "test"); //create and issue the query $sql = "SELECT username, f_name, l_name FROM auth_users WHERE username = '".$_POST["username"]."' AND password = PASSWORD('".$_POST["password"]."')"; $result = mysqli_query($mysqli, $sql) or die(mysqli_error($mysqli)); //gets number of unsuccessful logins // Should be something like this... $sql1 = mysqli_query($mysqli,"SELECT failed_logins FROM auth_users WHERE username = '".$_POST["username"]."'"); if (mysqli_num_rows($sql1) == 1) { $attempts = mysql_result($sql1, 0, 'failed_logins'); } else { $attempts = 0; } //checks if user is disabled if ($attempts >= 3){ echo ("login disabled"); } else { //get the number of rows in the result set; should be 1 if a match if (mysqli_num_rows($result) == 1) { //if authorized, get the values of f_name l_name while ($info = mysqli_fetch_array($result)) { $f_name = stripslashes($info['f_name']); $l_name = stripslashes($info['l_name']); } //set authorization cookie setcookie("auth", "1", 0, "/", "yourdomain.com", 0); $_SESSION['usersname'] = $f_name . " " . $l_name; //record last login $sql2 = "UPDATE auth_users SET last_login=NOW() WHERE username = '".$_POST["username"]."'"; mysqli_query($mysqli,$sql2); //clears failed logins $sql3 = "UPDATE auth_users SET failed_logins = 0 WHERE username = '".$_POST["username"]."'"; mysqli_query($mysqli, $sql3); //directs authorized user header("Location: logon.php"); } else { //redirect back to login form if not authorized $_SESSION['error'] = "<font color='red'>invalid username and/or password combination</font>"; $sql4 = "UPDATE auth_users SET failed_logins = failed_logins + 1 WHERE username = '".$_POST["username"]."'"; mysqli_query($mysqli,$sql4); header("Location: user_logon.php"); exit; } } ?>
-
I am trying to disable a user from logging in if they have 3 or more failed_ login attempts stored in their record but the code is not displaying my message. Although it still counts the unsuccessful attempts and logs them in with correct username and password.
can someomne see where the error is. I would appreciate it.
here is my code....
<?php session_start(); //check for required fields from the form if ((!isset($_POST["username"])) || (!isset($_POST["password"]))) { header("Location: user_logon.html"); exit; } //connect to server and select database $mysqli = mysqli_connect("localhost", "root", "", "test"); //create and issue the query $sql = "SELECT username, f_name, l_name FROM auth_users WHERE username = '".$_POST["username"]."' AND password = PASSWORD('".$_POST["password"]."')"; $result = mysqli_query($mysqli, $sql) or die(mysqli_error($mysqli)); //gets number of unsuccessful logins $attempts = mysqli_query($mysqli,"SELECT failed_logins FROM auth_users WHERE username = '".$_POST["username"]."'"); //checks if user is disabled if ($attempts >= 3){ echo ("login disabled"); } else { //get the number of rows in the result set; should be 1 if a match if (mysqli_num_rows($result) == 1) { //if authorized, get the values of f_name l_name while ($info = mysqli_fetch_array($result)) { $f_name = stripslashes($info['f_name']); $l_name = stripslashes($info['l_name']); } //set authorization cookie setcookie("auth", "1", 0, "/", "yourdomain.com", 0); $_SESSION['usersname'] = $f_name . " " . $l_name; //record last login $sql2 = "UPDATE auth_users SET last_login=NOW() WHERE username = '".$_POST["username"]."'"; mysqli_query($mysqli,$sql2); //clears failed logins $sql3 = "UPDATE auth_users SET failed_logins = 0 WHERE username = '".$_POST["username"]."'"; mysqli_query($mysqli, $sql3); //directs authorized user header("Location: logon.php"); } else { //redirect back to login form if not authorized $_SESSION['error'] = "<font color='red'>invalid username and/or password combination</font>"; $sql4 = "UPDATE auth_users SET failed_logins = failed_logins + 1 WHERE username = '".$_POST["username"]."'"; mysqli_query($mysqli,$sql4); header("Location: user_logon.php"); exit; } } ?>
-
thats what I thought that was simple enough....thanks
cannot logon to database over domain.
in MySQL Help
Posted
I mean by logon on is to get access to a web page that requires a username and password. Thats when I get the error Yes. mysql is connected local. I just don't know how to access it via web.