Search the Community
Showing results for tags 'phphtml'.
-
I am new to PHP, I have a website done in HTML and PHP.In my site,I have a form that sends mail. My PHP code is ?php try{ $to = 'test@test.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: noreply@test.com' . "\r\n" . 'Reply-To: test@test.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); if(mail($to, $subject, $message, $headers)) { echo("<p>Email successfully sent!</p>"); } else{ echo("<p> Email delivery failed </p>"); } } catch(Exception $e){ echo 'Caught Exception', $e->getMessage(), "\n"; } ?> I am using valid to and from addresses, but i always get the message "Email delivery Failed" and I dont get the email. Also I have deployed my website in windows server, are there any configurations to be done on the server. Thanks for your help in advance.
-
Hello, im a new user here. Im now working on a project called student attendance management sytem. I have doing all the necessary tables in database which is admin, lecturer, student, parent, attendance and grade. Ok so im now working on a 1st page which is a login page. Right now i have finished the coding and what im gonna ask u all is how to make sure that when i clicked 'login', it not only detect the admin table but all of other tables? <html> <head> <title> Login Form </title> </head> <body> <form method='post' action='login.php'> <table width='400' border='5' align='center'> <tr> <td align='center' colspan='5'><h1>Login Form</h1></td> </tr> <tr> <td align='center'>Username:</td> <td><input type='text' name='username' /></td> </tr> <tr> <td align='center'>Password:</td> <td><input type='password' name='pass' /></td> </tr> <tr> <td colspan='5' align='center'><input type='submit' name='login' value='Log In' /></td> </tr> </table> </form> </body> </html> <?php mysql_connect("localhost","root",""); mysql_select_db("student_attendance"); if(isset($_POST['login'])){ $username = $_POST['username']; $password = $_POST['pass']; $check_user = "select * from admin where username='$username' AND pass='$password'"; $run = mysql_query($check_user); if(mysql_num_rows($run)>0){ echo "<script>alert('You are logged in')</script>"; } else { echo "<script>alert('username or password is incorrect!')</script>"; } } ?>
-
how do i echo out this html? <a href="#login" onclick="popup('popUpDiv')">Login</a> in php i tried: echo '<a href="#login" onclick="popup('popUpDiv')">Login</a>'; but that doesnt work because of 'popUpDiv', i tried arrays, it still doesnt seem to work echo "<a href='#login' onclick='popup("."'popUpDiv')'>Login</a>" i must be doing something wrong