Jump to content

Plazman65

Members
  • Posts

    46
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Plazman65's Achievements

Member

Member (2/5)

0

Reputation

  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
×
×
  • 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.