Jump to content

Plazman65

Members
  • Posts

    46
  • Joined

  • Last visited

    Never

Everything posted by Plazman65

  1. Thanks for your help, If the number of jobs exceeds then it says hey you cant do that , if its added it says its added. The checking for unique part though it isnt catching that. Any ideas? Thanks, Michelle
  2. Good Morning, I am trying to get this page to work. What I need to do is, if members exceed the amount entered it stopps processing and says "you have succeeded the number of.." then if it goes past that but it they already have that job in their favorites for it to say " hey you its already in there" and then if it goes past that then goes ahead and enters inserts the data. It doing everything but the unique job part. Does anyone see whats wrong? I appreciate the help. Thanks, Michelle <form action="<?php echo $editFormAction; ?>" method="POST" name="form1" class="style1" id="form1"> <?php $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ( ($_SESSION['mem_type']=="standard" && $_SESSION['count']>=5)|| ($_SESSION['mem_type']=="silver" && $_SESSION['count']>=10)|| ($_SESSION['mem_type']=="gold" && $_SESSION['count']>=25)){ echo "You have exceeded your maximum number of Departments. ". "Please edit your departments or consider upgrading your account."; } else $st = mysql_query("SELECT ,username,depid FROM mydepartments WHERE depid = '$posted_depid' AND username='MM_Username'"); $recs = mysql_num_rows($st); $row = mysql_fetch_array($st); if ($recs >=1) echo "You already have this department in your favorites"; else if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO mydepartments (username, depid, mem_type) VALUES (%s, %s, %s)", GetSQLValueString($_POST['username2'], "text"), GetSQLValueString($_POST['depid2'], "int"), GetSQLValueString($_POST['textfield'], "text")); mysql_select_db($database_jobs, $jobs); $Result1 = mysql_query($insertSQL, $jobs) or die(mysql_error()); if (isset($_SERVER['QUERY_STRING'])) echo"Your department has been successfully added."; } ?>
  3. [!--quoteo(post=363722:date=Apr 11 2006, 08:58 AM:name=Yesideez)--][div class=\'quotetop\']QUOTE(Yesideez @ Apr 11 2006, 08:58 AM) [snapback]363722[/snapback][/div][div class=\'quotemain\'][!--quotec--] I'm with thorpe on dreamweaver. Never used it, never will and I've nicknamed it dreamwrecker :) Back to your code. If you're already in the folder "mydepartment" then there's no need that I can see to be specifying "../mydepartment/" in the variable. Removing everything after the ? won't make much difference as its just passing parameters to the script mentioned. Try removing "../mydepartment/" and just have: [code]$insertGoTo = "mydepartments.php";[/code] See how that goes. [/quote]\ the passing variable makes sense but the page is in another folder so I would need to incldue the whole path. Someone jsut really confused me and said that I cant do <form action="<?php echo $editFormAction; ?>" method="POST" name="form1" class="style1" id="form1"> <?php <-- with this inside the form Is that right?
  4. [!--quoteo(post=363702:date=Apr 11 2006, 08:20 AM:name=thorpe)--][div class=\'quotetop\']QUOTE(thorpe @ Apr 11 2006, 08:20 AM) [snapback]363702[/snapback][/div][div class=\'quotemain\'][!--quotec--] Do yourself a favour. Drop Dreamweaver. That code is horrible, and really, its not making your learning process any eaiser. Anyway... try some debuging. Add this line... [code] echo $insertGoTo; die(); [/code] Just before... [code] header(sprintf("Location: %s", $insertGoTo)); [/code] What does it display? [/quote] Ohh good idea, you guys are so smart, ok I got this- ../mydepartment/mydepartments.php?CITY=Kwethluk CITY=Kwethluk - this part comes from the fact that its being passed via url, now i just need to find that bit and get rid of that and it should work right? Thanks for your help, Michelle
  5. Hi all, Im using dreamweaver to help me with somethings since I am still learning php. I have the following code, it works great except for the fact that it doesnt redirect the user to the mydepartments page when submitted, it does add the record though. any ideas? I appreciate the help, thanks, Michelle <form action="<?php echo $editFormAction; ?>" method="POST" name="form1" class="style1" id="form1"> <?php $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ( ($_SESSION['mem_type']=="standard" && $_SESSION['count']>=5)|| ($_SESSION['mem_type']=="silver" && $_SESSION['count']>=10)|| ($_SESSION['mem_type']=="gold" && $_SESSION['count']>=25)){ echo "You have exceeded your maximum number of Departments. ". "Please edit your departments or consider upgrading your account."; } else if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO mydepartments (username, depid, mem_type) VALUES (%s, %s, %s)", GetSQLValueString($_POST['username2'], "text"), GetSQLValueString($_POST['depid2'], "int"), GetSQLValueString($_POST['textfield'], "text")); mysql_select_db($database_jobs, $jobs); $Result1 = mysql_query($insertSQL, $jobs) or die(mysql_error()); $insertGoTo = "../mydepartment/mydepartments.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } ?>
  6. Ok I took the afternoon off and got a good nights sleep. Im getting the email's now wooohooo, Im excited about that! Im having two problems , one is that if i go right to the password form and enter the email address, that works but lets say I misenter it and hit back, then re-enter it I get no database selected again. I havent changed anything in the connections page and all the others are working smoothly.I did move connection to the top. Also Im having a heck of a time getting a subject to show up. Ive tried every version that I can think of but it always shows up in the email itself. Here's the code that I have, I havent changed the messages yet. Im doing one thing at a time so I know what works and not. I really appreciate all the help. Thanks, Michelle <?php require_once('../Connections/jobs.php'); ?> <?php if(isset($_POST['email'])) { if (!empty($_POST['email'])) { $posted_email = htmlspecialchars($_POST['email']); if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$",$posted_email)) { $st = mysql_query("SELECT email,username,password FROM login WHERE email = '$posted_email'") or die(mysql_error()); $recs = mysql_num_rows($st); $row = mysql_fetch_array($st); $email = $row['email']; if ($recs <> 1) { echo "No unique match found on <b>$email</b> in the database"; } else { // ok - do the email stuff and anything else needed here $user = $row['username']; $pass = $row['password']; $email=$row['email']; // $to = "$email"; $emailFrom = "admin@uspolicejobs.com"; $emailSubject = "Forgotten pw form"; $msg ="E-MAIL SENT FROM US POLICE JOBS\n"; $msg.="Username:\t$user\n"; $msg.="Password\t$pass\n"; mail($to,$emailfrom,$emailsubject,$msg); echo "Cool - <b>$email</b> matched up in the database with username <b>$user</b>!"; } } else { echo "Your email address is not correct"; } } echo "Please fill in your email adress"; } else { // no post detected, show form ?? echo "No posted form detected"; } ?>
  7. [!--quoteo(post=360406:date=Mar 31 2006, 08:36 AM:name=plazman65)--][div class=\'quotetop\']QUOTE(plazman65 @ Mar 31 2006, 08:36 AM) [snapback]360406[/snapback][/div][div class=\'quotemain\'][!--quotec--] Yes I do, Thank you so much for all your help! Michelle [/quote] gosh this mail thing is a pain, umm I moved the connections to the top and the page stopped altogether. :( you can see what I mean at [a href=\"http://www.uspolicejobs.com/membershipservices/forgot_password.php\" target=\"_blank\"]http://www.uspolicejobs.com/membershipserv...ot_password.php[/a] email address d_m2000@yahoo.com I dont know if the link will help, Im also having a problem with a email script that has a attachment. Is it possible that the error is coming from something else? Thanks, Michelle
  8. Yes I do, Thank you so much for all your help! Michelle
  9. woohoo it worked! So what is this doing looking for @ symbols and such? $posted_email = htmlspecialchars($_POST['email']); Im assuming this is checking for a valid email address right? if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$",$posted_email)) this right here, I havent seen that before if ($recs <> 1), is this prefered over the <1? Out of curiosity after playing with it, if I enter a email address the first time it says the matched up statement but if I hit back and then enter it again it says no database found. What would cause that? And i should be able to incorporate the mail stuff there at the bottom it will work, woohoo thank you so much, Michelle [!--quoteo(post=360350:date=Mar 31 2006, 05:35 AM:name=alpine)--][div class=\'quotetop\']QUOTE(alpine @ Mar 31 2006, 05:35 AM) [snapback]360350[/snapback][/div][div class=\'quotemain\'][!--quotec--] Ok, you still don't use [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]'[!--colorc--][/span][!--/colorc--] around $email in your query ( '$email' ) I made this for you to test: [code] <?php if(isset($_POST['email'])) { if (!empty($_POST['email'])) { $posted_email = htmlspecialchars($_POST['email']); if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$",$posted_email)) { require_once('../Connections/jobs.php'); $st = mysql_query("SELECT email,username,password FROM login WHERE email = '$posted_email'") or die(mysql_error()); $recs = mysql_num_rows($st); if ($recs <> 1) { echo "No unique match found on <b>$email</b> in the database"; } else { // ok - do the email stuff and anything else needed here $row = mysql_fetch_array($st); $email = $row['email']; $user = $row['username']; $pass = $row['password']; echo "Cool - <b>$email</b> matched up in the database with username <b>$user</b>!"; } } else { echo "Your email address is not correct"; } } echo "Please fill in your email adress"; } else { // no post detected, show form ?? echo "No posted form detected"; } ?> [/code] [/quote]
  10. Oh Im so glad you havent given up, here goes: thanks for all your help, Michelle <?php require_once('../Connections/jobs.php'); ?> <?php if ( ($_POST[email] == "")) { header ("Location: forgot_password.php"); exit; } $email = mysql_real_escape_string($_POST['email']); $status = "OK"; $msg=""; error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR); // You can supress the error message by un commenting the above line if (!stristr($email,"@") OR !stristr($email,".")) { $msg="Your email address is not correct<BR>"; $status= "NOTOK";} echo "<br><br>"; if($status=="OK"){ // validation passed now we will check the tables $query="SELECT email,username,password FROM login WHERE email = $email"; $st=mysql_query($query) or die(mysql_error()); $recs=mysql_num_rows($st); $row=mysql_fetch_object($st); $em=$row->email;// email is stored to a variable if ($recs == 0) { // No records returned, so no email address in our table // let us show the error message echo "<center><font face='Verdana' size='2' color=red><b>No Password</b><br> Sorry Your address is not there in our database . You can signup and login to use our site. <BR><BR><a href='signup.php'> Sign UP </a> </center>"; exit;} // formating the mail posting // headers here $headers4="admin@uspolicejobs.com"; // Change this address within quotes to your address $headers.="Reply-to: $headers4\n"; $headers .= "From: $headers4\n"; $headers .= "Errors-to: $headers4\n"; //$headers = "Content-Type: text/html; charset=iso-8859-1\n".$headers; // for html mail un-comment the above line // mail funciton will return true if it is successful if(mail("$em","Your Request for login details","This is in response to your request for login details at US POLICE JOBS \n \nLogin ID: $row->username \n Password: $row->password \n\n Thank You \n \n siteadmin","$headers")){echo "<center><font face='Verdana' size='2' ><b>THANK YOU</b> <br>Your password is posted to your emil address . Please check your mail after some time. </center>";} else{// there is a system problem in sending mail echo " <center><font face='Verdana' size='2' color=red >There is some system problem in sending login details to your address. Please contact site-admin. <br><br><input type='button' value='Retry' onClick='history.go(-1)'></center></font>";} } else {// Validation failed so show the error message echo "<center><font face='Verdana' size='2' color=red >$msg <br><br><input type='button' value='Retry' onClick='history.go(-1)'></center></font>";} ?> [!--quoteo(post=360260:date=Mar 30 2006, 08:33 PM:name=alpine)--][div class=\'quotetop\']QUOTE(alpine @ Mar 30 2006, 08:33 PM) [snapback]360260[/snapback][/div][div class=\'quotemain\'][!--quotec--] ok, what is your current script ? [/quote]
  11. [!--quoteo(post=360191:date=Mar 30 2006, 03:07 PM:name=jireh)--][div class=\'quotetop\']QUOTE(jireh @ Mar 30 2006, 03:07 PM) [snapback]360191[/snapback][/div][div class=\'quotemain\'][!--quotec--] hello gurus =) i was wondering how to generate a unique ID so it can be put in mysql. am i making sense? [/quote] oh oh I think I can answer this one for ya! (Im new myself). If you mean you want a unique number for lets say a user name I use the Auto-Increment. Michelle
  12. Ok I feel like Im getting somewhere: the @yahoo must come from the email address I entered: u have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@yahoo.com' at line 1 [!--quoteo(post=360086:date=Mar 30 2006, 10:31 AM:name=alpine)--][div class=\'quotetop\']QUOTE(alpine @ Mar 30 2006, 10:31 AM) [snapback]360086[/snapback][/div][div class=\'quotemain\'][!--quotec--] try this to see if it retrieves any query problems first [code] $st=mysql_query($query) or die(mysql_error()); [/code] [/quote]
  13. I do have a tendancy to make things more complicated then they are! its still getting hung up on the query, I dont see anything else wrong there. Any other ideas? Thanks for your help, Michelle [!--quoteo(post=360079:date=Mar 30 2006, 10:04 AM:name=alpine)--][div class=\'quotetop\']QUOTE(alpine @ Mar 30 2006, 10:04 AM) [snapback]360079[/snapback][/div][div class=\'quotemain\'][!--quotec--] No, you can simply do this: $email = mysql_real_escape_string($_POST['email']); [/quote]
  14. I want to make sure I understand things right- if I set- $email=$_POST['email'] wont that conflict with- $email=mysql_real_escape_string($email); thats was why I was thinking of doing the $query="SELECT email,username,password FROM login WHERE email = $_POST['email']"; Also I did a echo and and it does match up to a record in the database. Sorry for the newbie questions I want to make sure I'm learning from this to so I'm not back on here tomorrow begging for help! That makes sense so if I set [!--quoteo(post=360072:date=Mar 30 2006, 09:32 AM:name=alpine)--][div class=\'quotetop\']QUOTE(alpine @ Mar 30 2006, 09:32 AM) [snapback]360072[/snapback][/div][div class=\'quotemain\'][!--quotec--] Personally i awoid using post determination inside querys, i set them once for easy use. I think your problem might be that you missed ' ' [code] $email = $_POST['email']; $query= mysql_query(" SELECT email,username FROM login WHERE email = '$email' "); [/code] If not, try and echo your $post and see if its present and make sure it matches up with a row in your database Also, is there a particular reason to fetch the password from the table? [/quote]
  15. Thanks for the response thats what I thought, so I changed, $query="SELECT email,username,password FROM login WHERE email = $email"; to $query="SELECT email,username,password FROM login WHERE email = $_POST['email']"; and Im getting nothing but a blank page do you see anyother changes that should be made? Thanks for your help, Michelle
  16. Hi all, I am trying to create a forgotten password form from a tutorial and I was wondering if someone could clarify a couple of things for me. I have the form on one page, and have its action set to this page, it keep returning the results as- "Sorry Your address is not there in our database . You can signup and login to use our site. " I think that its because its not pulling the email address, I want to change the $query="SELECT email,username,password FROM login WHERE email = $email"; to $query="SELECT email,username,password FROM login WHERE email = $_POST[email"; am I on the right track? Because that's not working. and for the record Im new and Im trying! Thanks Michelle <?php require_once('../Connections/jobs.php'); ?> <?php if ( ($_POST[email] == "")) { header ("Location: forgot_password.php"); exit; } $email=mysql_real_escape_string($email); $status = "OK"; $msg=""; //error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR); // You can supress the error message by un commenting the above line if (!stristr($email,"@") OR !stristr($email,".")) { $msg="Your email address is not correct<BR>"; $status= "NOTOK";} echo "<br><br>"; if($status=="OK"){ // validation passed now we will check the tables $query="SELECT email,username,password FROM login WHERE email = $email"; $st=mysql_query($query); $recs=mysql_num_rows($st); $row=mysql_fetch_object($st); $em=$row->email;// email is stored to a variable if ($recs == 0) { // No records returned, so no email address in our table // let us show the error message echo "<center><font face='Verdana' size='2' color=red><b>No Password</b><br> Sorry Your address is not there in our database . You can signup and login to use our site. <BR><BR><a href='signup.php'> Sign UP </a> </center>"; exit;} // formating the mail posting // headers here $headers4="admin@uspolicejobs.com"; // Change this address within quotes to your address $headers.="Reply-to: $headers4\n"; $headers .= "From: $headers4\n"; $headers .= "Errors-to: $headers4\n"; //$headers = "Content-Type: text/html; charset=iso-8859-1\n".$headers; // for html mail un-comment the above line // mail funciton will return true if it is successful if(mail("$em","Your Request for login details","This is in response to your request for login details at US POLICE JOBS \n \nLogin ID: $row->userid \n Password: $row->password \n\n Thank You \n \n siteadmin","$headers")){echo "<center><font face='Verdana' size='2' ><b>THANK YOU</b> <br>Your password is posted to your emil address . Please check your mail after some time. </center>";} else{// there is a system problem in sending mail echo " <center><font face='Verdana' size='2' color=red >There is some system problem in sending login details to your address. Please contact site-admin. <br><br><input type='button' value='Retry' onClick='history.go(-1)'></center></font>";} } else {// Validation failed so show the error message echo "<center><font face='Verdana' size='2' color=red >$msg <br><br><input type='button' value='Retry' onClick='history.go(-1)'></center></font>";} ?>
  17. Never mind guys I got it, Michelle
  18. Hi all, Ok I'm new, and I am using DW8,not ready for hand coding yet. I made a big newbie error and I was plugging away and only checking in IE6, I promise to never to do it again! Can someone check this and see if you see anything that would cause this, in firefox it logs u in great but in ie6 and opera you go to the forgotten pw page. heres the code or the link- <?php require_once('../Connections/jobs.php'); ?> <?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['textfield'])) { $loginUsername=$_POST['textfield']; $password=$_POST['textfield2']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "../homepage.php"; $MM_redirectLoginFailed = "forgot_password.php"; $MM_redirecttoReferrer = true; mysql_select_db($database_jobs, $jobs); $LoginRS__query=sprintf("SELECT username, password FROM login WHERE username='%s' AND password='%s'", get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password)); $LoginRS = mysql_query($LoginRS__query, $jobs) 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']) && true) { $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"> <!-- DW6 --> <head> <!-- Copyright 2005 Macromedia, Inc. All rights reserved. --> <title>alaska city jobs</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="mm_lodging1.css" type="text/css" /> <style type="text/css"> <!-- .style1 { color: #336666; font-size: 10px; </style> <link href="../../../htdocsmm_lodging1.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- @import url("../mm_lodging1.css"); --> </style> <link href="../mm_lodging1.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- .style2 { font-size: 10px; font-family: Arial, Helvetica, sans-serif; } .style5 {font-size: 10px} --> </style> </head> <body bgcolor="#999966"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <!--DWLayoutTable--> <tr> <td width="28" height="109" nowrap="nowrap"><!--DWLayoutEmptyCell-->&nbsp;</td> <td colspan="8" valign="middle" nowrap="nowrap" class="logo"><a href="../homepage.php"><img src="../IMAGES/banner_graphic.png" width="1024" height="109" border="0" /></a><br /></td> <td width="4">&nbsp;</td> <td width="52">&nbsp;</td> </tr> <tr bgcolor="#ffffff"> <td height="1" colspan="11"><img src="IMAGES/mm_spacer.gif" alt="" width="1" height="1" border="0" /></td> </tr> <tr bgcolor="#a4c2c2"> <td width="28" height="79" nowrap="nowrap">&nbsp;</td> <td width="122" valign="middle" id="navigation"><span class="style1 style5"><strong>MY DEPARTMENTS</strong></span> <span class="sidebarText style5">&nbsp;</span><span class="sidebarText"> &nbsp;&nbsp;&nbsp; </span></td> <td colspan="2" align="center" valign="middle" id="navigation"><a href="../gettinghired.php">GET HIRED</a></td> <td width="95" valign="middle" class="sidebarText style2" id="navigation"><a href="../equipment.php">EQUIPMENT</a></td> <td width="82" valign="middle" class="style1" id="navigation"><a href="../inthenews.php">IN THE NEWS</a></td> <td width="100" align="center" valign="middle" class="style2 sidebarText" id="navigation"><a href="../mydepartment/mydepartments.php">FORUM</a></td> <td width="395" valign="middle" class="style2 sidebarText" id="navigation"><a href="../membershipservices/recommendedreading.php">RECOMMENDED READING</a></td> <td width="158" valign="middle" class="sidebarText" id="navigation"><a href="../membershipservices/contactus.php">CONTACT US</a><a href="../inthenews.php" class="style1"></a> </td> <td>&nbsp;</td> <td valign="middle"><p>&nbsp;</p></td> </tr> <tr bgcolor="#ffffff"> <td height="1" colspan="11"><img src="IMAGES/mm_spacer.gif" alt="" width="1" height="1" border="0" /></td> </tr> <tr bgcolor="#ffffff"> <td height="352" colspan="3" valign="top" bgcolor="#a4c2c2"><img src="IMAGES/mm_lodging_image.jpg" alt="Home Page Image" width="230" height="240" border="0" /> <table border="0" cellspacing="0" cellpadding="0" width="230"> <tr> <td width="15">&nbsp;</td> <td width="200" class="sidebarText" id="padding"><br /> &nbsp;<br /> </td> <td width="15">&nbsp;</td> </tr> </table></td> <td colspan="2" valign="top"><img src="IMAGES/mm_spacer.gif" alt="" width="50" height="1" border="0" /></td> <td colspan="4" valign="top"><br /> <br /> <table border="0" cellspacing="0" cellpadding="0" width="600"> <tr> <td colspan="2" class="pageName">&nbsp;</td> <td width="170" class="pageName">&nbsp;</td> </tr> <tr> <td width="245" class="bodyText"><form ACTION="<?php echo $loginFormAction; ?>" id="form2" name="form2" method="POST"> <span class="sidebarText">USERNAME</span> <label> <input type="text" name="textfield" /> <br /> <a href="forgot_username.php">FORGOT YOUR USERNAME?</a> <br /> <br /> <span class="sidebarText">PASSWORD</span> <input type="password" name="textfield2" /> </label> <label> <br /> <a href="forgot_password.php">PASSWORD HELP? </a></label> <label><br /> </label> <input name="LOG IN" type="submit" id="LOG IN" value="Login" /> </form> <p align="right">&nbsp; </p> <br /> </td> <td width="185" class="bodyText">&nbsp;</td> <td class="bodyText">&nbsp;</td> </tr> </table> </form> </td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr bgcolor="#ffffff"> <td height="1" colspan="11"><img src="IMAGES/mm_spacer.gif" alt="" width="1" height="1" border="0" /></td> </tr> <tr> <td width="28" height="19">&nbsp;</td> <td>&nbsp;</td> <td width="80">&nbsp;</td> <td width="4">&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </table> </body> </html>
  19. OK guys/gals I did some reading over the weekend, and I had no idea what I was doing,. Still dont but Im hoping Im getting better at it in some way. Hitman your comments were right on cue. With that being said, Im still stuck Im starting with just one membership level at a time to figure it out. I am trying to limit the #of jobs being entered per membership level. Here's what I did- <?php $mem_type=$_POST['mem_type'] ?> this is after the session start stuff then I have <form action="<?php echo $editFormAction; ?>" id="form2" name="form2" method="POST"> //do I put this here? <?php $mysql_query = "SELECT depid FROM mydepartments WHERE username = '$MM_Username'"; $result = mysql_query($mysql_query); if (mysql_num_rows($result)<=5 && $mem_type == 'standard' ) { die("You have reached your limit of departments you may add, Please go edit Your departments before you try to add more departments"); } else { echo("your department has been added"); } ?> //I want it to process the form and say "your department has been added"[/color] </a><a href="../mydepartment/mydepartments.php" target="_blank"></a> <input name="textfield" type="text" value="<?php echo $row_Recordset2['mem_type']; ?>" /> <a href="../mydepartment/mydepartments.php" target="_blank"> <input type="text" name="username2" id="username2" value="<?php echo KT_escapeAttribute($row_rsmydepartments['username']); ?>" size="32" /> </a></label> <p> <label>depid<a href="../mydepartment/mydepartments.php" target="_blank"> <input type="text" name="depid2" id="depid2" value="<?php echo KT_escapeAttribute($row_rsmydepartments['depid']); ?>" size="32" /> </a></label> </p> <p> <label> <input type="submit" name="Submit" value="Submit" /> </label> </p> <input type="hidden" name="MM_insert" value="form2"> </form> So what its doing is saying your department has been added even if you have more then 5 and your membership type is standard. I know Im close, any ideas, suggestions, etc? Thanks everybody, Michelle
  20. [!--quoteo(post=353804:date=Mar 10 2006, 05:50 PM:name=hitman6003)--][div class=\'quotetop\']QUOTE(hitman6003 @ Mar 10 2006, 05:50 PM) [snapback]353804[/snapback][/div][div class=\'quotemain\'][!--quotec--] Have you ever used php before? I can't even begin to list the basic syntax errors that are in your code...no $ before your variables, your if statements are written, incorrectly, in pseudocode. Pretty much I can sum up your code in one word...FUBAR. Please read at least one tutorial on this website on the basics of php. Please read at least one tutorial [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]anywhere[!--colorc--][/span][!--/colorc--] on the basics of php. [/quote] well I guess I wasnt clear on my original post, Im new, and no I havent done this before. I have managed to muddle my way through most of my website, I am reading tutorials as fast as I can, I am starting to be able to read the code and understand what something is doing but Im not to the point that I can say hey I want to do this and write it out. I did look everywhere for example or something that does "limit" ,I did run accross one thing and I thought it was similar to what I was doing, I guess from your reaction that it isnt. Im not asking anyone to write code for me or anything but if anyone knows a tutorials that covers how to limit, I was also told its select count. I would be grateful to hear where because I havent found it. Thanks, Michelle
  21. [!--quoteo(post=353216:date=Mar 9 2006, 04:34 AM:name=AV1611)--][div class=\'quotetop\']QUOTE(AV1611 @ Mar 9 2006, 04:34 AM) [snapback]353216[/snapback][/div][div class=\'quotemain\'][!--quotec--] For starters: this: [code] if (mem_id=1 and (username AND depid >5); [/code] I'd change to: [code] if (mem_id==1 && username >= 6 &&  depid >= 6); [/code] Also, you can't thow exception like that... If you throw them, you need to catch them, etc... read the manual for more... I'm no expert on that Make these changes, then see where you are at. BTW: You have to put a closeing ) when nesting... (xxx(yyy)) [/quote] , Thanks for the nesting thing, I didnt catch that, After looking at it some more I am confusing myself even more, It doesnt help that I cant find much in these books I bought. What I am looking at is throwing errors from a form so thats didnt help I think that part of the problem comes in with the query- $query="SELECT COUNT(*) FROM 'username' AND 'DEPID' $result = mysql_query($query); I dont know how to tell it, hey check the table"username" and see what the membership type is, then take that value and compare it to the table mydepartments and if its standard then you cant enter more then 5. Any suggestions would be greatly appreciated!
  22. Hi all, Im hoping that someone here can point me in the right direction. I have gone through everybook I have and have done some searching online with no luck. Here is what I need to do, When someone adds a job to their "watch page" I need to be able to limit the number of jobs they can watch depending on their membership type. I also dont want them to have duplicate entries (I havent put that part in yet) I have tried the following- It didnt work, Im learning as fast as I can but not fast enough. Is this something salvagable? Or am I on the right track. Im not set on doing this a certain way, I just need to do it! Thanks for any help you can provide! <?php SELECT membershipcategory.userid AS userid_1, login.userid, mydepartments.username, mydepartments.idcode, mydepartments.depid, membershipcategory.mem_id FROM ((mydepartments LEFT JOIN login ON login.username=mydepartments.username) $query="SELECT COUNT(*) FROM 'username' AND 'DEPID' $result = mysql_query($query); if (mem_id=1 and (username AND depid >5); { throw new Exception('You have reached your limit of Departments to add'); } if (mem_id=12 and (username AND depid >10); { throw new Exception('You have reached your limit of Departments to add'); } if (mem_id=1 and (username AND depid >5); { throw new Exception('You have reached your limit of Departments to add'); } //if (depid='gold') then limit 25; <form id="form2" name="form2" method="POST" action="<?php echo $editFormAction; ?>"> <label>depid</label> <label>username <input name="textfield" type="text" value="<?php echo $_SESSION['MM_Username']; ?>" /> </label> <p> <label> <input name="textfield2" type="text" value="<?php echo $row_rs_mydepartment['depid']; ?>" /> </label> <input type="submit" name="Submit" value="Submit" /> </label> </p> <input type="hidden" name="MM_insert" value="form2"> </form> ?>
  23. [!--quoteo(post=352930:date=Mar 8 2006, 10:38 AM:name=php_b34st)--][div class=\'quotetop\']QUOTE(php_b34st @ Mar 8 2006, 10:38 AM) [snapback]352930[/snapback][/div][div class=\'quotemain\'][!--quotec--] If it is only happening when the user isnt logged in it is because you have told the script to exit, try removing exit; [/quote] Thanks so much it worked! Michelle
  24. Hi guys,I had this thing on my web page, I thought it was doing what I wanted, then I was looking at my homepage and realized that anything after this code doesnt show up anymore. Im confused as to why. Any ideas? Thanks, Michelle <?php if ($_SESSION['MM_Username']) { echo 'Logged in as ' .$_SESSION['MM_Username']. '<a href="membershipservices/thankyou.php">Logout here <a/>' ; } else { echo 'you are not logged in. Login Here<br/>' .'<a href="membershipservices/loginpage.php">Login</a>'; exit; } ?>
  25. [!--quoteo(post=352530:date=Mar 7 2006, 07:07 AM:name=Tron)--][div class=\'quotetop\']QUOTE(Tron @ Mar 7 2006, 07:07 AM) [snapback]352530[/snapback][/div][div class=\'quotemain\'][!--quotec--] Currently I have a page that queries a database and displays all the registered users for my site. Now, I would like this page in a seperate directory with user login page that needs to entered in order to view this page. I have an idea how to build the login page and query that db for a registered user, but my question is; Would I need to created a additional table in the same database that contains the user name and password for the admin or would I need to created a seperate database for that? Thanks in advance for any input. [/quote] If I understand your question right. From what I was reading that you should definately have a different area for your admin users at the minimum a different table. I am still learning and one of the tutorials Im going through did just that. Michelle
×
×
  • 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.