Jump to content

dolcezza

Members
  • Posts

    102
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dolcezza's Achievements

Member

Member (2/5)

0

Reputation

  1. I am not super experienced, I had a tutor helping me with this.... unfortunately he is not available for a few days and I need to get this issue fixed right away. We didn't really go into what methods are better or why. If you have a spare minute I wouldn't mind an explaination as to why you'd do it this way. Thanks
  2. I am doing an application where people can enter a schedule in a form, but if the schedule is already there it is autofilled. It loops so that if there is a one day event, only 3 schedule rows show up, 2 days 6 sho up, 3 days 9 show etc.... everything is working (it makes a pdf, displays properly etc.. the only thing is only the first day is being entered into the database. ANy suggestions? (Only posting the relevent code... all the variables are ok because it is working in the display and the pdf. This is the form: <strong>Schedule:</strong><br /> Please schedule no more than three assemblies of 45 minutes each, leaving 5-10 minutes in between.<br /> <? php $schedulequery = ("SELECT * FROM `schedules` WHERE eventid = '$eventid'"); $scheduleresult=mysql_query($schedulequery); for($x=0;$x<=$date_diff;$x++) { echo $curdate->format("m-d-Y") . "<br />"; for ($loop=1;$loop<=3;$loop++) { if ($scheduleinfo=mysql_fetch_array($scheduleresult)) { $schedule_date = $scheduleinfo[2]; $time=$scheduleinfo[3]; } else { $time=""; } ?> <input type="hidden" name="schedule-<? echo $loop."-".$x; ?>" value="<? echo $scheduleinfo['scheduleid']; ?>"> Time:<input type="text" size="8" name="time-<? echo $loop."-".$x; ?>" id="time" value="<? echo $scheduleinfo['time']; ?>"> Grades:<input type="text" size="8" name="grades-<? echo $loop."-".$x; ?>" id="grades" value="<? echo $scheduleinfo['grades']; ?>"> Room:<input type="text" size="8" name="room-<? echo $loop."-".$x; ?>" id="room" value="<? echo $scheduleinfo['room']; ?>"> Notes:<input type="text" name="notes-<? echo $loop."-".$x; ?>" id="notes" value="<? echo $scheduleinfo['notes']; ?>"><br /> <? } $curdate->modify("+1 day"); echo "<hr>"; } ?> This is where it inserts into the database: <?php $schedulequery = ("SELECT * FROM `schedules` WHERE eventid = '$eventid'"); $scheduleresult=mysql_query($schedulequery); //echo "Calculating date"; $curdate = new DateTime($info['date']); //echo "Got:'".$curdate->format("Y-m-d")."'"; //echo "Should have had:'".$info['date']."'"; for($i=0;$i<=$date_diff;$i++) { //echo "Working on:'".$curdate->format("Y-m-d")."'<br>"; for ($x = 1; $x <= 3; $x++) { $schedule_id =$_POST['schedule-'.$x.'-'. $i]; $time = $_POST['time-'.$x.'-'. $i]; $grades = $_POST['grades-'.$x.'-'. $i]; $room = $_POST['room-'.$x.'-'. $i]; $notes = $_POST['notes-'.$x.'-'. $i]; if (strlen($time)>0) { $sched_date=$curdate->format("Y-m-d"); if (strlen($schedule_id)>0){ $scheduleinsert=("UPDATE schedules SET date= '$sched_date',time= '$time', grades = '$grades', room = '$room', notes = '$notes' WHERE scheduleid = '$schedule_id'"); } else { $scheduleinsert = "INSERT INTO schedules (eventid, date, time, grades, room, notes) VALUES ('$eventid', '$sched_date' '$time', '$grades', '$room', '$notes')"; } // echo "DB statement:'".$scheduleinsert."'"; $scheduleinsert_result = mysql_query($scheduleinsert); // echo "; Result was ".$scheduleinsert_result."<br>"; } } $curdate->modify("+1 day"); } ?> This is where most of the variables are declared just in case: <?php $eventid = mysql_real_escape_string($_POST['eventid']); $address = mysql_real_escape_string($_POST['address']); $city = mysql_real_escape_string($_POST['city']); $state = mysql_real_escape_string($_POST['state']); $zip = mysql_real_escape_string($_POST['zip']); $directions = $_POST['directions']; $eventnotes = mysql_real_escape_string($_POST['eventnotes']); $honorarium = mysql_real_escape_string($_POST['honorarium']); $travelexp = mysql_real_escape_string($_POST['travelexp']); $sig = mysql_real_escape_string($_POST['sig']); $travelincl = implode($_POST['travelinc'],","); $query = ("SELECT * FROM `events` WHERE eventid = '$eventid' LIMIT 1"); $result=mysql_query($query); $info = mysql_fetch_array($result); $authorid = $info['authorid']; $venueid = $info['venueid']; $date_array=explode("-", $info['date']); $friendly_date=$date_array[1]."/".$date_array[2]."/".$date_array[0]; $endfriendly_date=$enddate_array[1]."/".$enddate_array[2]."/".$enddate_array[0]; $authorids=explode(",",$info['authorid']); $date_diff = subtract_dates($info['date'] , $info['enddate']); //function to find difference between two dates function subtract_dates($begin_date, $end_date) { return round(((strtotime($end_date) - strtotime($begin_date)) / 86400)); } $venuequery = ("SELECT * FROM `venues` WHERE venueid = '$venueid' LIMIT 1"); $venueresult=mysql_query($venuequery); $venueinfo = mysql_fetch_array($venueresult); $venue = $venueinfo['venue']; $name = $venueinfo['name']; $city = $venueinfo['city']; $state = $venueinfo['state']; $email = $venueinfo['email']; $phone = $venueinfo['phone']; ?>
  3. This is returning 0 with the dates 2010-05-05 ($info['date'])and 2010-05-07($info['enddate']). What am I doing wrong? Thanks in advance $date_diff = subtract_dates($info['date'] , $info['enddate']); //function to find difference between two dates function subtract_dates($begin_date, $end_date) { return round(((strtotime($end_date) - strtotime($begin_date)) / 86400)); } echo $date_diff;
  4. this is how I grab them in the IPNVerify file: $item_name = $_POST['item_name']; $caregivers_id = $_POST['custom'];
  5. Thanks, I added username and I think it works ok. It activated me. Your help is appreciated.
  6. So since the id is in the email as part of the link, is their a way to pass the username too or do I need to have them enter it in a form?
  7. I have a register script that sends an email after registering to activate membership. It turns the field "activated" from 0 to 1. It is working sometimes and not others. It is showing the message that says "Success...", but no success email is being sent and "activate" is remaining at 0. Any ideas? ID is coming from the link...http://.......activate.php?id=8cc1651440deadca1111e1dc2400654cfb836f23, and it is showing up in the address bar. <?php require_once("db_connect.php"); $id = $_GET['id']; $query = mysql_query("SELECT * FROM mem WHERE Actkey = '$id'") or die(mysql_error()); $row = mysql_fetch_array($query); if(mysql_num_rows($query) > 0){ $user = $row['user_id']; $do = mysql_query("UPDATE mem SET activated = 1 WHERE user_id = '$user'") or die(mysql_error()); $send = mail($row['user_email'] , "Activation Confirmation" , "Thank you for activating your account, you are now fully registered and able to use our services.\n\nTo login, click the link below:\nhttp://www.caregivingsocal.com/signin.php" , "FROM: auto@mailer.com"); ?> //other html here <?php if(($do)&&($send)) { echo ' <div id="success"> <p>Activation successful! A confirmation email has been dispatched. You can now login!</p> <p><a href="https://www.caregivingsocal.com/signin.php">Click here</a> to goto the login page.</p> </div>'; } else { echo ' <div id="error"> <p>We are sorry, there appears to be an error processing your activation. Please try again later.</p> </div>'; } } else { echo ' <div id="error"> <p>Sorry, your activation code was incorrect. Please try again.</p> </div>'; } ?>
  8. I did not touch that part... it's exactly as it is in my script. You need to put them in the buy it now button.:<input type="hidden" name="custom" value="<? whatever you want the variable to be?>"> Then in the IPN script you put: $whatever = $_POST['custom']; same thing with invoice if you want to use it
  9. I'm pretty sure there is one called "custom", and one called "invoice" that you can define and the user doesn't see. You can't create your own though. There is also (If you don't mind the users seeing the data) the options fields on0, os0, on1, and os1. They will display in the cart as IPN (option_name0 / option_selection0 ...)
  10. I just did something like this.. you are allowed a variable named "custom" So I had each rows unique identifier be the "custom" variable, then brought it back as what I needed it to be: in button: <input type="hidden" name="custom" value="<? echo $id ?>"> in IPN: id = $_POST['custom'];
  11. I have a email auth script that is working "sometimes". Whe I test it personally, it goes through fine, but my client claims she and some other people aren't able to activate or aren't getting emails. I noticed some of these on her server email: A message that you sent contained a recipient address that was incorrectly constructed: From: missing or malformed local part (expected word or "<") The message has not been delivered to any recipients. ------ This is a copy of your message, including all the headers. ------ To: INFO@blah.COM Subject: A new member has signed up for caregivingsocal.com. Their info is as follows: 146 km@blahblah.com Posting only part of code: <?php $name = $first . ' ' . $lastname; $actkey = mt_rand(1, 500).'f78dj899dd'; $act = sha1($actkey); $query = mysql_query("INSERT INTO mem (firstname, lastname, username, user_password, user_email, user_county, user_phone, Actkey, date) VALUES ('$firstname', '$lastname', '$username','$user_password', '$user_email','$user_county', '$user_phone', '$act', '$date')") or die(mysql_error()); $send = mail($user_email , "Registration Confirmation" , "Thank you for registering with Blah.com.\n\nYour username and password is below, along with details on how to activate your account.\n\nUser: ".$username."\n\nClick the link below to activate your account:\nhttps://www.blah.com/activate.php?id=".$act."\n\nPlease do not reply, this is an automated mailer.\n\nThanks", "FROM: auto@mailer.com"); if(($query)&&($send)) { echo ' <html> <head> <title>Success</title> <link href="style3.css" rel="stylesheet" type="text/css"> </head> ?>
  12. actually... I spoke too soon... it is writing the word "array" to the database instead of the id#.
  13. It worked, thank you... I see you changed while($row = mysql_fetch_row($result)) to while($row = mysql_fetch_array($result)) do you mind explaining why one works and the other doesn't? I appreciate it if you are willing, I'm trying to get a better understanding. Thanks again.
  14. in the database, row 0 is venueid and row 1 is the venue name. The venueid is unique, the name is what I want people to see obviously, but I use it's unique id
  15. here is the whole insert page: I am posting this too because it is getting the venueemail, and sending the email. I thought it may help. Thanks. $authorlast=$_POST['authorlast']; $venueid=$_POST['venueid']; $eventcode = md5(uniqid(rand())); $venuequery = ("SELECT * FROM `venues` WHERE `venueid`='{$_POST['venueid']}'"); $venueresult=mysql_query($venuequery); $venueinfo = mysql_fetch_array($venueresult); //$venueid = $venueinfo['venueid']; $venueemail=$venueinfo['email']; $date_array=explode("/",$_POST["date"]); $date_for_mysql=$date_array[2]."-".$date_array[0]."-".$date_array[1]; $authorids = implode($_POST['authorid'],","); $query = "INSERT INTO events (date,venueid,authorid,eventcode) VALUES ('$date_for_mysql','$venueid','$authorids','$eventcode')"; $my_result=mysql_query($query); if(!$my_result){echo mysql_error();} else { include('events.php'); // get code from database // mail code to venue $send = mail($venueemail , "Connecting Authors Event Form" , "Thank you for booking your event with Connecting Authors (formerly KatzConnects)..\n\nPlease fill out our form by clicking the link below:\nhttp://www.connectingauthors.com/admin/eventform.php?id=".$eventcode."\n\nPlease do not reply, this is an automated mailer.\n\nThanks", "FROM: auto@mailer.com"); }
×
×
  • 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.