Jump to content

easy login using stored procedure with 2 ins and 4 outs


travisk

Recommended Posts

Hi,

I am rather rusty with my php coding and I am trying to create a login using a stored procedure with 2 in and 4 output variables. sp_LoginApplication. . with these ins and outs

IN:

p_userName VARCHAR

p_userPassword VARCHAR

 

OUT:

p_result INT

p_idIntitution INT

p_nameInstitution VARCHAR

p_userProfile INT

 

Here is the code I have

<?php

// Inialize session
session_start();

// Include database connection settings
include('config.inc');

// Retrieve username and password from database according to user's input
//$login = mysql_query("SELECT * FROM user WHERE (p_userName = '" . mysql_real_escape_string($_POST['username']) . "') and (p_userPassword = '" . mysql_real_escape_string(md5($_POST['password'])) . "')");
$login = mysql_query('CALL sp_loginApplication($_POST['username'], $_POST['password'], $loginResult, $idinstitution, $nameinstitution, $userprofile)');
// Check username and password match
if (mysql_num_rows($login) == 1) {
        // Set username session variable
        $_SESSION['username'] = $_POST['username'];
        // Jump to secured page
        header('Location: securedpage.php');
}
else {
        // Jump to login page
        header('Location: index.php');
}

?>

 

I keep getting a Parse error: syntax error, unexpected T_STRING in /homepages/37/d89354651/htdocs/tek/test/Portal/examples/loginproc.php on line 11

 

Any help would be great. . .

Thanks

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.