Jump to content

hours12

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

hours12's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hey , how come my INSERT INTO can't work? .. what could be the possible reasons? Plese help ... thanks <?php if (!empty($_POST["submit"])) { $conn = mssql_connect("172.20.129.172", "SCS WebPortal", "scs"); mssql_select_db("SCS WebPortal", $conn); $sql = "INSERT INTO rejection(reason)VALUES (''); $sql .= "'" . $_POST["textarea"] . "')"; mssql_query($sql, $conn); mssql_close($conn); echo("<p>Entry added to database!</p>"); } ?> <img src="../Unnamed Site 5/top.jpg" alt="top" width="602" height="140"></p> <p class="style1">Reason for rejection has been successfully sent. Thank you </p> </body> </html>
  2. May I know how come my code can't work. I've check a few times. It doesn't have any Error Message. Please Help, people... <?php if(isset($_POST["loginid"]) { $passwordvar = $_POST["password"]; $loginidvar = $_POST["loginid"]; //connects to MSSQL mssql_connect('172.20.129.172','sa','scs'); $sql = "SELECT name_db FROM tb_Login WHERE username = '"+$loginidvar+"' and password='"+$passwordvar+"'"; $result = mssql_db_query ("tb_Login",$sql); $row = mssql_fetch_array($result); $myRows = mssql_num_rows($sql); if ($myRows == 0) { die ('That user does not exist in our database.'); } while($info = mssql_fetch_array( $sql )) { $_POST['passwordvar'] = stripslashes($_POST['passwordvar']); $info['password'] = stripslashes($info['password']); $_POST['passvar'] = md5($_POST['passvar']); //give error if password is wrong if ($_POST['passwordvar'] != $info['password']) { die('Incorrect password, please try again.'); } else { // if login is ok then we add a cookie $_POST['loginid'] = stripslashes($_POST['loginid']); $hour = time() + 3600; setcookie(loginid, $_POST['loginid'], $hour); setcookie(password, $_POST['password'], $hour); //then redirect them to the members area header("Location: frameset.html"); } } } else { // if they are not logged in ?> <form action="<?php echo $_SERVER['PHP_SELF']?>" method="post"> <table border="0"> <tr><td colspan=2><h1>Login</h1></td></tr> <tr><td>Username:</td><td> <input type="text" name="username" maxlength="40"> </td></tr> <tr><td>Password:</td><td> <input type="password" name="pass" maxlength="50"> </td></tr> <tr><td colspan="2" align="right"> <input type="submit" name="submit" value="Login"> </td></tr> </table> </form>
  3. Hey guys, may i ask what should I do if i wanna retrieve MSSQL database to the webpage. I want the retrieval to be in table form. Please help.
  4. Hey guys, I've experienced this error and i am unsure what is it about Am i connected to MSSQL? What is this message indication? ??? THANKS PHP Notice: Use of undefined constant login - assumed 'login' in C:\Inetpub\wwwroot\NewPHP\login_check.php on line 2 PHP Notice: Use of undefined constant name - assumed 'name' in C:\Inetpub\wwwroot\NewPHP\login_check.php on line 4 PHP Notice: Use of undefined constant password - assumed 'password' in C:\Inetpub\wwwroot\NewPHP\login_check.php on line 6 PHP Fatal error: Call to undefined function mssql_connect() in C:\Inetpub\wwwroot\NewPHP\login_check.php on line 8 <form name="form1" action="email_check.php?login=dfsdfksjdasdasd"
×
×
  • 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.