Jump to content

atmega-ist

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

atmega-ist's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Greetings, all - Curious to know if someone wouldn't mind taking a look at this code and letting me know if there are any apparent errors that may cause this problem: I attempted sending the message to one of my two 1and1 email accounts and after some delay, it sent it to 1and1 account B but not 1and1 account A. My gmail account, however, gets them every time. I'd like to just say it's some issue with 1and1 but since it successfully got through to the one 1and1 account I'm not comfortable stopping at that. I should also mention that for some reason, as I'm trying it today, the successful 1and1 account will no longer receive the messages... I've tried it with directly copying the php mail code from 1and1's FAQ, though, and it seemed to work for the 1and1 account that was previously succcessful (acct B) but not acct A. Very stuck... Thanks $from = $_REQUEST['email']; $subject = $_REQUEST['subject']; $message = $_REQUEST['question']; mail("username@domain.com", "Subject: $subject", $message, "From: $from"); echo "Mail sent"; 1and1 FAQ with mail code: http://faq.1and1.com/scripting_languages_supported/php_mail_explained/2.html
  2. premiso - a) apologies. I keep forgetting about the manual. b) thanks a TON for the quick instruction. updated the code as shown below (in case anyone else has the same question) and everything works perfectly! thanks again! session_cache_expire(20); session_start();
  3. Hello, all - the subject pretty much says it.. my session variables are fine while navigating the site. they even hold wen i navigate completely away from the server and then come back but as soon as i close the browser they all go blank... it was my understanding that they would remain after close. is this incorrect and i just need to make a full-on cookie? The pages below flow as: index.php -> login.php -> member.php Thanks! index.php: <html> <form action="login.php" method="POST"> Username: <input type="test" name="username"><br> Password: <input type="password" name="password"><br> <input type="submit" name="btnlogin" value="Log In"> </form> </html> login.php: <?php session_start(); $username = $_POST['username']; $password = $_POST['password']; if ($username&&$password) { $connect = mysql_connect("localhost", "root", "map2131") or die("Couldn't connect"); mysql_select_db("login")or die("no such database found"); $query = mysql_query("SELECT * FROM logintable WHERE username='$username'"); $numrows = mysql_num_rows($query); if ($numrows!=0) { while ($row = mysql_fetch_assoc($query)) { $dbusername = $row['username']; $dbpassword = $row['password']; } if ($username==$dbusername&&$password==$dbpassword) { echo "Logged in. Click <a href='member.php'>here</a> to enter the member page"; $_SESSION['splat']=$dbusername; } else echo "Incorrect Password"; echo $row; } else die("No such user."); } else die("Please enter username <u>and</u> password"); ?> member.php: <?php session_start(); echo "Welcome, ".$_SESSION['splat']."!"; ?>
  4. *sigh* ... this is what visual studio's intellisense does to people... thanks for the suggestion - it works perfectly!
  5. hello, all - i've got a SELECT statement that isn't returning any errors but is simply not working. all test points leading up to the query confirm a connection to the database but selecting a record just doesn't seem to go through. the intention is simple - just to retrieve the password which correlates to a given username. i'll admit i'm fairly new to php/mysql but have had quite a bit of access experience in the past... just doesn't seem to be coming together, though. thanks in advance I should also mention that the scenario implied by the code below is not at all intended to be deployed. when thinking of tables of related records it was just the first thing to come to mind in terms of dummy-data. mySQL v5.1 (XAMPP installation) "logintable" consists of 3 fields (id, username, password) <html> <body> <form action="login.php" method="POST"> Username: <input type="text" name="userName" value="user2"><br> <input type="submit" value="Click"><p> </form> <?php $user = $_POST['userName']; mysql_connect("localhost","root","dbopwd") or die(mysql_error()); mysql_select_db("login") or die(mysql_error()); echo mysql_query("SELECT password FROM logintable WHERE username='$user'"); ?> </body> </html>
×
×
  • 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.