Jump to content

whizzykid

Members
  • Posts

    74
  • Joined

  • Last visited

Everything posted by whizzykid

  1. Hi thank you so much can i get a sample code on how to do this? Thanks.
  2. Hi thank you,i want to use the login id do i have to define the login id for each user? for example i have this code it if (isset($_POST['Login'])) { $loginUsername=$_POST['Login']; $password=$_POST['Password']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "member-profile.php"; $MM_redirectLoginFailed = "login-failed.php"; $MM_redirecttoReferrer = false; mysql_select_db($database_customer, $customer); $LoginRS__query=sprintf("SELECT Login, Password FROM log WHERE Login=%s AND Password=%s", GetSQLValueString($loginUsername, "int"), GetSQLValueString($password, "int")); $LoginRS = mysql_query($LoginRS__query, $customer) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = ""; shud i specify each user login id and password?so that it cud link to each profile?
  3. Ok hv got 2pages e.g profile1 and the 2nd page profile2 do i hv to list the pages e.g $MM_redirectLoginSuccess=profile1 and profile2 then i hv to set each value for each login and password?
  4. When they login it takes all to welcome.php Want it to take them to individual page or row from the table in the database.
  5. I want to redirect them To their Individual personal account page.
  6. Thanks but it still doesnt work.
  7. Hi i am having some problems with this code my $loginUsername is suppose to link the username entered to the account or welcome page if login success but it doesnt.It takes all of the success login to a particular page instead of indivduals pages. Helpppppp. if (isset($_POST['Customer_Number'])) { $loginUsername=$_POST['Customer_Number']; $password=$_POST['Sort_Code']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "welcome to.php"; $MM_redirectLoginFailed = "You are not logged in.php"; $MM_redirecttoReferrer = false; mysql_select_db($database_ellen, $ellen); $LoginRS__query=sprintf("SELECT `Customer Number`, `Sort Code` FROM log WHERE `Customer Number`=%s AND `Sort Code`=%s", GetSQLValueString($loginUsername, "-1"), GetSQLValueString($password, "-1")); $LoginRS = mysql_query($LoginRS__query, $ellen) 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 ); } }
  8. Hi thank you on my database i set to int, that is not wht i am refering to,i wil explain. I create a login in form when people login it takes them to a particular redirect page i set,but i want it to display username i get from my form on the the redirect page.
  9. Hi thank you but the file name is ok,i just want to why everytime any1 logs in it take them to the same account page as every1 else tht logs in.
  10. this the code if (isset($_POST['Login'])) { $loginUsername=$_POST['Login']; $password=$_POST['Password']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "/my profile.php"; $MM_redirectLoginFailed = "/Login Failed.php"; $MM_redirecttoReferrer = false; mysql_select_db($database_inteecom_ellen, $inteecom_ellen); $LoginRS__query=sprintf("SELECT Login,Password FROM `Customer Login` WHERE Login=%s AND Password=%s", GetSQLValueString($loginUsername, "int"), GetSQLValueString($password, "int")); $LoginRS = mysql_query($LoginRS__query, $inteecom_ellen) 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; for every person tht logs in takes them to the same account information,how can i make it display account information per login and password info?
  11. Hi all,I am creating a website i am almost through with that but when i get to the part of linking the username entered in the databse to an account i get stuck. can Any1 help?
  12. Yes i have space btw the name.And thank you i hv included the back ticks and it works now.Wow 2nd problem solved.this is so cool.Thanks ken.
  13. No the table name is Customer Login.
  14. I created this and when i try to use the login in form it shows table doesnt exist. This is my code. where it always point to. $LoginRS__query=sprintf("SELECT Login,Password FROM Customer Login WHERE Login=%s AND Password=%s", helpppp
  15. Hi thank u i have resolved it.I have 2 files so i have editted them.
  16. $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO `Call Back form` (Firstname, LastName, `Company Name`, `Phone Number`) VALUES (%s, %s, %s, %s)", GetSQLValueString($_POST['Firstname'], "text"), GetSQLValueString($_POST['LastName'], "text"), GetSQLValueString($_POST['Company_Name'], "text"), GetSQLValueString($_POST['Phone_Number'], "int")); mysql_select_db($database_inteecom_ellen, $inteecom_ellen); $Result1 = mysql_query($insertSQL, $inteecom_ellen) or die(mysql_error()); $insertGoTo = "jpg.1"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO `Call Back form` (Firstname, LastName, `Company Name`, `Phone Number`, `Brief Comments`) VALUES (%s, %s, %s, %s, %s)", GetSQLValueString($_POST['Firstname'], "text"), GetSQLValueString($_POST['LastName'], "text"), GetSQLValueString($_POST['Company_Name'], "text"), GetSQLValueString($_POST['Phone_Number'], "int"), GetSQLValueString($_POST['Brief_Comments'], "text")); mysql_select_db($database_inteecom_ellen, $inteecom_ellen); $Result1 = mysql_query($insertSQL, $inteecom_ellen) or die(mysql_error()); $insertGoTo = "jpg.1"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form5")) { $insertSQL = sprintf("INSERT INTO `Call Back form` (Firstname, LastName, `Company Name`, `Phone Number`, Email, `Brief Comments`) VALUES (%s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['Firstname'], "text"), GetSQLValueString($_POST['LastName'], "text"), GetSQLValueString($_POST['Company_Name'], "text"), GetSQLValueString($_POST['Phone_Number'], "int"), GetSQLValueString($_POST['Email'], "text"), GetSQLValueString($_POST['Brief_Comments'], "text")); mysql_select_db($database_inteecom_ellen, $inteecom_ellen); $Result1 = mysql_query($insertSQL, $inteecom_ellen) or die(mysql_error()); $insertGoTo = "jpg.1"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } mysql_select_db($database_inteecom_ellen, $inteecom_ellen); $query_Recordset1 = "SELECT * FROM `Call Back form`"; $Recordset1 = mysql_query($query_Recordset1, $inteecom_ellen) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); Thank you.
  17. Hi thank you, just did but still shows the same thing.
  18. Hi thank you so much now it shows the form but when i click on submit it shows this error Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/inteecom/public_html/Call back form.php on line 87 and this is the line code on line 87 $Result1 = mysql_query($insertSQL, $database_inteecom_ellen) or die(mysql_error());
  19. Hi all, I designed a database on dreamweaver,i uploaded it on my server for my website i created a form but any time i click on it it shows no database selected,I have tried to edit it,it still shows no database selected when i click d form, this is the code pls help what am i nt doing right? <?php # FileName="Connections" # Type="MYSQL" # HTTP="true" $hostname_inteecom_ellen = "localhost"; $database_inteecom_ellen = "inteecom_ellen"; $username_inteecom_ellen = "inteecom_lara"; $password_inteecom_ellen = "adebimpe"; $inteecom_ellen = mysql_pconnect($hostname_inteecom_ellen, $username_inteecom_ellen, $password_inteecom_ellen) or trigger_error(mysql_error(),E_USER_ERROR); ?> this is the second one <?php # FileName="Connections" # Type="MYSQL" # HTTP="true" $hostname_inteecom_ellen = "localhost"; $database_inteecom_ellen = "inteecom_ellen"; $username_inteecom_ellen = "inteecom_lara"; $password_inteecom_ellen = "adebimpe"; $inteecom_ellen = mysql_pconnect($hostname_inteecom_ellen, $username_inteecom_ellen, $password_inteecom_ellen) or trigger_error(mysql_error(),E_USER_ERROR); ?> the form itself. <?php require_once(Connections/ellen.php'); ?> <?php require_once(Connections/customer.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $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; } } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO `Call Back form` (Firstname, LastName, `Company Name`, `Phone Number`) VALUES (%s, %s, %s, %s)", GetSQLValueString($_POST['Firstname'], "text"), GetSQLValueString($_POST['LastName'], "text"), GetSQLValueString($_POST['Company_Name'], "text"), GetSQLValueString($_POST['Phone_Number'], "int")); mysql_select_db($database_inteecom_ellen, $inteecom_ellen); $Result1 = mysql_query($insertSQL, $inteecom_ellen) or die(mysql_error()); $insertGoTo = "public_html/index.html"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO `Call Back form` (Firstname, LastName, `Company Name`, `Phone Number`, `Brief Comments`) VALUES (%s, %s, %s, %s, %s)", GetSQLValueString($_POST['Firstname'], "text"), GetSQLValueString($_POST['LastName'], "text"), GetSQLValueString($_POST['Company_Name'], "text"), GetSQLValueString($_POST['Phone_Number'], "int"), GetSQLValueString($_POST['Brief_Comments'], "text")); mysql_select_db($database_inteecom_ellen, $inteecom_ellen); $Result1 = mysql_query($insertSQL, $inteecom_ellen) or die(mysql_error()); $insertGoTo = "public_html/index.html"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form5")) { $insertSQL = sprintf("INSERT INTO `Call Back form` (Firstname, LastName, `Company Name`, `Phone Number`, Email, `Brief Comments`) VALUES (%s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['Firstname'], "text"), GetSQLValueString($_POST['LastName'], "text"), GetSQLValueString($_POST['Company_Name'], "text"), GetSQLValueString($_POST['Phone_Number'], "int"), GetSQLValueString($_POST['Email'], "text"), GetSQLValueString($_POST['Brief_Comments'], "text")); mysql_select_db($database_inteecom_ellen, $inteecom_ellen); $Result1 = mysql_query($insertSQL, $database_inteecom_ellen) or die(mysql_error()); $insertGoTo = "file:///C|/DOCUME~1/AM/LOCALS~1/Temp/index.html"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } mysql_select_db($$database_inteecom_ellen, $inteecom_ellen); $query_Recordset1 = "SELECT * FROM `Call Back form`"; $Recordset1 = mysql_query($query_Recordset1, $inteecom_ellen) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> <!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> <style type="text/css"> <!-- body { background-color: #E8E8E8; } #apDiv1 { position:absolute; left:314px; top:28px; width:413px; height:101px; z-index:1; } #apDiv2 { position:absolute; left:363px; top:73px; width:280px; height:26px; z-index:1; } #apDiv3 { position:absolute; left:356px; top:145px; width:341px; height:37px; z-index:2; } #apDiv4 { position:absolute; left:355px; top:195px; width:345px; height:35px; z-index:3; } #apDiv5 { position:absolute; left:366px; top:263px; width:354px; height:124px; z-index:4; } #apDiv6 { position:absolute; left:115px; top:4px; width:346px; height:11px; z-index:5; } #apDiv7 { position:absolute; left:298px; top:182px; width:437px; height:24px; z-index:1; } #apDiv8 { position:absolute; left:316px; top:91px; width:406px; height:24px; z-index:2; } #apDiv9 { position:absolute; left:308px; top:135px; width:428px; height:21px; z-index:3; } #apDiv10 { position:absolute; left:315px; top:30px; width:420px; height:36px; z-index:4; } --> </style> <script type="text/javascript"> <!-- function MM_validateForm() { //v4.0 if (document.getElementById){ var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments; for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args); if (val) { nm=val.name; if ((val=val.value)!="") { if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@'); if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n'; } else if (test!='R') { num = parseFloat(val); if (isNaN(val)) errors+='- '+nm+' must contain a number.\n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1); if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n'; } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; } } if (errors) alert('The following error(s) occurred:\n'+errors); document.MM_returnValue = (errors == ''); } } //--> </script> </head> <body> <div id="apDiv7"> <form id="form2" name="form2" method="post" action=""> Which Department do you need assistant with? <select name="Which Department do you need assistant with?" size="1" id="Which Department do you need assistant with?"> <option>Customer Support</option> <option>Accounts</option> <option>General</option> <option>Sales and Marketing</option> </select> </form> </div> <div id="apDiv8"> <form id="form3" name="form3" method="post" action=""> <input type="radio" name="radio" id="Mr" value="Mr" /> Mr <input type="radio" name="radio" id="Mrs" value="Mrs" /> Mrs <input type="radio" name="radio" id="Ms" value="Ms" /> Ms <input type="radio" name="radio" id="Others" value="Others" /> others </form> </div> <div id="apDiv9"> <form id="form4" name="form4" method="post" action=""> Best time to call you <select name="Best time to call you" size="1" id="Best time to call you"> <option>Now</option> <option>Later</option> <option>Morning</option> <option>Afternoon</option> <option>Evening</option> </select> </form> </div> <div id="apDiv10"> <legend>Call us Back Form.</legend> <legend><strong> Ask for one of our advisors to call you back</strong></legend> </div> <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1" onsubmit="MM_validateForm('Firstname','','R');MM_validateForm('Brief_Comments','','R');MM_validateForm('Phone_Number','','RisNum');MM_validateForm('Phone_Number','','RisNum');return document.MM_returnValue"> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <input type="hidden" name="MM_insert" value="form1" /> </form> <form action="<?php echo $editFormAction; ?>" method="post" name="form5" id="form5"> <table align="center"> <tr valign="baseline"> <td nowrap="nowrap" align="right">Firstname:</td> <td><input type="text" name="Firstname" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">LastName:</td> <td><input type="text" name="LastName" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">Company Name:</td> <td><input type="text" name="Company_Name" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">Phone Number:</td> <td><input type="text" name="Phone_Number" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">Email:</td> <td><input type="text" name="Email" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">Brief Comments:</td> <td><input type="text" name="Brief_Comments" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right"> </td> <td><input type="submit" value="Insert record" /></td> </tr> </table> <input type="hidden" name="MM_insert" value="form5" /> </form> <p> </p> <p> </p> </body> </html> <?php mysql_free_result($Recordset1); ?> What is the problem cause any time i clcik on the form it shows no database selected. ???
×
×
  • 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.