Jump to content

.CriMson

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

.CriMson's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Okay, With much searching i haven't found my answer so i figured you guys could shed some light on if this is possible or not. Goal: To send an email via php to different addresses located in a MySQL database. The problem is, we don't have access to modify the server settings or the php.ini configuration, and the mail settings have not been configured, although we do have am smtp server that we can use for sending the emails. Is it possible to configure anything through the script so we can get the mail() function to work? Or is there something else i will need to do? We're trying to not use any additional extensions, but if needed it won't be a problem. Thanks in advance.
  2. i didn't explicitly set it on, unless its set = on by the server.
  3. i thought that to, but i tested every other if/else block all the way through it. Anyway, i just found the issue. Well, sort of. Somehow the $user variable from the new form was being assigned to the $_SESSION['user'] variable. Then it would validate the login and realize that the user didnt match, and then cleared the variables before redirecting back to index and destroying the session. I just changed the variable names and it solved the problem. I'm still clueless as to how the $user variable could carry across when the form was posted. Thanks for all the help. You guys got me thinking in the right direction to solve the problem
  4. Exactly, thats why im clueless. The openConnection function just opens a mysql connection and selects the db, the closeconnection just closes the mysql connection. Troubleshooting, i walked through step by step for the entire file and tested the output of $_SESSION. it happens right after the } else { executes. I'm beginning to think its just a bogus glitch.
  5. Array ( [user] => [type] => [clientID] => [userID] => )
  6. im saying that is the block of code that the variables are being cleared. There's no use for the session variables in that block, but when i was troubleshooting, that is the area where they are being cleared.
  7. Yes session_start(); is there. Like i said, the entire file that the code is taken from works as it should. The session variables are available to every if and else statement except the one i posted.
  8. Background: I have a standard content management system that i designed. index.php contains the login form, and splash.php contains the screen with all the detail. splash.php is the only page loaded, the other pages are just included in the body of splash.php based on the query string. splash.php performs a login validation before anything else happens. In here, it just queries the database and looks if the session variables match what is in the database. So what happens is when i create a new user, it creates the user, and then displays the success message, but then clears the session variables that i have set that store the user id so when i click to navigate to another location, it thinks the user is no longer logged in and redirects them to the login page. I found the piece of code where the session variables are being cleared, and it makes no sense because there isnt anything in there that would clear the variables. I also noticed that the sessionID remains the same, so i know the session isnt expiring or being reset. Here is the code where the variables are cleared: } else { // session id is the same, but session variables are being unset // insert into database OpenConnection(); // search for user to see if it exists $sql = "select * from tblUser where username = '".$user."';"; $query = mysql_query($sql); if (mysql_num_rows($query) > 0) { print "User already exists. Please choose a different username"; } else { $sql = "insert into tblUser (username, password, firstName, lastName, userType, clientID, email) values ('".$user."','".$pass."','".$fName."','".$lName."','".$type."','".$clientID."','".$email."');"; $query = mysql_query($sql); if (!$query) { die ("Error creating user. Details: ".mysql_error()); } else { print "<b>".$fName." ".$lName."</b> was added successfully!"; } } CloseConnection(); } Any ideas? I'm clueless. The form is in the same file, and this is the only place in the file that resets the variables.
×
×
  • 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.