Jump to content

annehornung

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by annehornung

  1. How do I change the session.save_path setting?
  2. Here is the code. <?php require_once('../Connections/fabricdesign.php'); ?> <?php if (isset($_POST['pwd'])) {$_POST['pwd'] = sha1($_POST['pwd']);} if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } ?> <?php // *** Validate request to login to this site. if (!isset($_SESSION)) { session_start(); } $loginFormAction = $_SERVER['PHP_SELF']; if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck']; } if (isset($_POST['username'])) { $loginUsername=$_POST['username']; $password=$_POST['pwd']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "success.php"; $MM_redirectLoginFailed = "loginfail.php"; $MM_redirecttoReferrer = false; mysql_select_db($database_fabricdesign, $fabricdesign); $LoginRS__query=sprintf("SELECT username, pwd FROM users WHERE username=%s AND pwd=%s", GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); $LoginRS = mysql_query($LoginRS__query, $fabricdesign) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = ""; //declare two session variables and assign them $_SESSION['MM_Username'] = $loginUsername; $_SESSION['MM_UserGroup'] = $loginStrGroup; if (isset($_SESSION['PrevUrl']) && false) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; } header("Location: " . $MM_redirectLoginSuccess ); } else { header("Location: ". $MM_redirectLoginFailed ); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> <link href="../css/basiclayout.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="wrapper"> <div id="header"><a href="index.html"><img src="../images/logo.jpg" width="207" height="69" alt="Logo" /></a><a href="index.html"><img src="../images/link_images/home.jpg" alt="Home" width="48" height="10" class="navlink" /></a><a href="fabric.html"><img src="../images/link_images/fabric.jpg" alt="Fabric" width="65" height="10" class="navlink" /></a><a href="buy.html"><img src="../images/link_images/buy.jpg" alt="Buy" width="34" height="10" class="navlink" /></a><a href="inspiration.html"><img src="../images/link_images/inspiration.jpg" alt="Inspiration" width="121" height="10" class="navlink" /></a><a href="contact.php"><img src="../images/link_images/contact.jpg" alt="Contact" width="81" height="10" class="navlink" /></a></div> <div id="content"> <p>User Login</p> <form id="form1" name="form1" method="POST" action="<?php echo $loginFormAction; ?>"> <p>Username: <input type="text" name="username" id="username" accesskey="u" tabindex="10" /> </p> <p>Password: <input type="text" name="pwd" id="pwd" accesskey="p" tabindex="20" /> </p> <p> <input type="submit" name="doLogin" id="doLogin" value="Log In" accesskey="l" tabindex="30" /> </p> </form> <p> </p> </div> </div> </body> </html>
  3. Hello, I am very unfamiliar with PHP and I am doing this for a class. I created a simple login page straight out of a book my class is using, but I keep getting errors. The database is set up. Here are the errors I keep getting: http://ddion.com/dw2/hornung/pages/login.php All line 36 has on it is : session_start(); I don't have a clue what I'm supposed to do. Can someone help me please!?!
  4. Perfect! It works! Thank you so much!
  5. Thanks for your input. I tried what you said, and this is what I got as an error: Warning: Unexpected character in input: ''' (ASCII=39) state=1 in /home2/thedutc2/public_html/mail.php on line 20 In dreamweaver, line 20 is: $fields['date'] = $_REQUEST['date']; Any ideas? This is the part I don't understand: foreach($fields as $key => $age){ $body .= "$key : $age\n"; } what is $key and $age?
  6. All I am trying to do is get the subimtted info in my form to my email. When it comes to php though, I have no clue what I am doing.
  7. This is probably a really dumb question, but I do not know much about php. I am trying to get a form in a website to send to my email. To view the form, go to www.thedutchtouch.net/contact.html I did some research online, and this is the code I have so far, but it isn't working: <?php $to = "*myemail*"; $subject = "Custom Order Request"; $email = $_REQUEST['email'] ; $headers = "From: $email"; $fields = array(); $fields{"name"} = "Name"; $fields{"phone"} = "Phone Number"; $fields{"product"} = "Product"; $fields{"wood"} = "Wood Types"; $fields{"date"} = "Date Need By"; $body = foreach($fields as $key => $age){echo "$key, $age" } **This is where it says the error is** if($sent) {print "Your mail was sent successfully"; } else {print "We encountered an error sending your mail"; } ?>[/font] Can anyone help me!!!??? Thanks!
×
×
  • 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.