Jump to content

joshuaer

Members
  • Posts

    48
  • Joined

  • Last visited

joshuaer's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Thanks for the help birbal I am having a different problem with it now, when I run the script it is updating the password field now but I am getting this error Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1' at line 1 And when i try to login with the new password it is not working <?php//ini_set('display_errors', 1);//error_reporting(E_ALL); include("../sql.php"); $email = $_POST['email'];$password = $_POST['password'];$sql = mysql_query("UPDATE `users` SET password = MD5(password) WHERE email ='$email'!= ''");mysql_query($sql) or die ("Error: ".mysql_error());echo "Database updated. <a href='update_email.php'>Return to edit info</a>";?>
  2. hello I am working on a simple script to update a users password based on their email address. I do not need high security for this password change, it is behind an internal intrnet site. I do not get any errors when the script runs but it is not updating the password form to update <form action="/icloud/forgot/updateinfo.php" method="post"><input type="text" name="password"/><br> <font face="Arial, Helvetica, sans-serif">Change Email:</font><br/><input type="text" name="email" name="email"/><br/> <input type="submit" value="Update Email"/></form> and the backend updateinfo.php <?phpini_set('display_errors', 1);error_reporting(E_ALL); include("../sql.php");$result = mysql_query("SELECT * FROM users")or die(mysql_error());while ($row = mysql_fetch_array($result)){ $email = $row['email']; $password = $_POST['password'];}$sql = "UPDATE `users` SET `password` = '$password' WHERE password='$password' AND email='$email' ''";mysql_query($sql) or die ("Error: ".mysql_error());echo "Database updated. <a href='update_email.php'>Return to edit info</a>";?>
  3. one more question, with the drop down selecting the 3 rows I am using this as a sort of address book. The users load the Nname Cname and address on another page then when they are filling out a form I want them to be able to use the drop down to make a selection. So is it possible to have it post that information it is pulling back into the database into the 3 different rows? Nname Cname address
  4. forget that I had accidently put a . after the $option
  5. thanks for the reply with the code above I am gttin this error Parse error: syntax error, unexpected ';' in /homepages/37/d381229304/htdocs/go-servers/icloud/addressbook.php on line 17 <?phpinclude("sql.php");include("auth.php");$UID = $_SESSION['UID'];$sql="SELECT * FROM users where UID='$UID' AND Cnumber != ''";$result=mysql_query($sql);//$options="";while ($row=mysql_fetch_array($result)) {$id=$row["Nname"];$thing=$row["Nname"];[/b][b]$options.="<OPTION VALUE=\"$id\">".$thing." ".$row["CNumber"]."".$row["address"]."</option>";}?><SELECT NAME=Nname><OPTION VALUE=0>Choose<?=$options.?></SELECT>
  6. How would I display the 3 rows in the dropdown? With the current code I have it only shows one row Nname but in the dropdown I need Nname Cname address to all be displayed Thanks
  7. Hello I am trying to figure out how to create a drop down that pulls from 3 rows, I can pull a single value with the code below but I cannot figure out how to mull the other values <?include("sql.php"); include("auth.php"); $UID = $_SESSION['UID'];$sql="SELECT * FROM users where UID='$UID' AND Cnumber != ''";$result=mysql_query($sql);$options="";while ($row=mysql_fetch_array($result)) { $id=$row["Nname"]; $thing=$row["Nname"]; $options.="<OPTION VALUE=\"$id\">".$thing;}?><SELECT NAME=Nname><OPTION VALUE=0>Choose<?=$options?></SELECT> so in the dropdown I would need it to pull for each option Nname CNumber address
  8. joshuaer

    Sendmail Help

    ok discard that, got it workin $txt .= "\r\n".' '.$row['list'] . ' ' . $row['type'].$row['amount'];
  9. joshuaer

    Sendmail Help

    Thank you very much that worked great can I get one more thing, how can I get it to break after each line $txt .= ' '.$row['list'] . ' ' . $row['type'].$row['amount']; i tried /r/n but it did not break each line
  10. joshuaer

    Sendmail Help

    How do I add each row to the same variable? Thanka again
  11. joshuaer

    Sendmail Help

    Does this look correct to how you where describing to do it justsomeguy? Thanks <?phpini_set('display_errors', 1);error_reporting(E_ALL);include("sql.php"); //Connect to SQLinclude("auth.php"); //Connect to SQL$UID= $_SESSION['UID'];$headers = 'test';$d = date ("D");$result = mysql_query("SELECT * FROM users where UID='$UID' AND list != ''");$sel = mysql_query("SELECT * FROM users where UID='$UID' AND email != ''");$mail_hrd = "From: test list;"; $txt = "your test list - ";if(mysql_num_rows($result) > 0){$count = 0;while ($rows = mysql_fetch_array ($sel, MYSQL_ASSOC)){$to = $rows['email'];while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)){$message = $txt . $row['list'].' ' . $row['type'];}}mail($to, $headers, $message, $mail_hrd);$count++;echo "myResult=$count Emails Sent. Done.";print $to;echo "$to";print $message;//print $day;}else{echo "myResult=Email Submissions Failed.";}?>
  12. joshuaer

    Sendmail Help

    Thanks for the response and sorry for the delay in response The list it is creating is a grocery type list, I am trying to create a button that emails the list to the email address the user has associated with its unique id. my rows are ID | username | password | list | UID | email | type | amount01 testuser 123456 1234567 test@test.com 02 bread 1234567 pkg 103 milk 1234567 gal 1 So the email I would like for it to contain the List, type and amount information
  13. joshuaer

    Sendmail Help

    I want to send a single email with everything in it
  14. joshuaer

    Sendmail Help

    Thank you for the help I added the second query and it is now pulling the first row of the list not looping through the rows to get all of the list associated with the user id <?phpini_set('display_errors', 1);error_reporting(E_ALL);include("sql.php"); //Connect to SQLinclude("auth.php"); //Connect to SQL$UID= $_SESSION['UID'];$headers = 'header';$d = date ("D");$sel = mysql_query("SELECT * FROM users where UID='$UID' AND email != ''");$result = mysql_query("SELECT * FROM users where UID='$UID' AND iChore1 != ''");$mail_hrd = "From: ;"; $txt = "Your List ";if(mysql_num_rows($result) > 0){$count = 0;while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)){$message = $txt . $row['list'].' ' . $row['type'];while ($rows = mysql_fetch_array ($sel, MYSQL_ASSOC)){$to = $rows['email'];mail($to, $headers, $message, $mail_hrd);$count++;}}echo "myResult=$count Emails Sent. Done.";}else{echo "myResult=Email Submissions Failed.";}?>
  15. joshuaer

    Sendmail Help

    Hello I am trying to create a sendmail script that pulls a list that a user has created out of a database that is associated with their user id and sends it to the email associated with their user id, Each item they add is put into a row called list and the userid for the person who is creating the item is also put in a row called userid I can get it to send the email to the users email address but it is not pulling the rows for that user, can someone help point me in the right direction please Thank you <?phpini_set('display_errors', 1);error_reporting(E_ALL);include("sql.php"); //Connect to SQLinclude("auth.php"); //Connect to SQL$UID= $_SESSION['UID'];$headers = 'header';$d = date ("D");$result = mysql_query("SELECT * FROM users where UID='$UID'");$mail_hrd = "From: ;"; $txt = "Your List ";if(mysql_num_rows($result) > 0){$count = 0;while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)){$message = $txt . $row['list'].' ' . $row['type'];$to = $row['email'];mail($to, $headers, $message, $mail_hrd);$count++;}echo "myResult=$count Emails Sent. Done.";}else{echo "myResult=Email Submissions Failed.";}?>
×
×
  • Create New...