Jump to content

bradkenyon

Members
  • Posts

    179
  • Joined

  • Last visited

    Never

Everything posted by bradkenyon

  1. I need help using php to send email to an email account that is restricted to only authorized users on the system to send to it only. Which combats spam. I was able to get my code to work to the point where it does not send the email unless your username and password are correct, but the server is more strict than i thought about allowing just that. It needs to authenticate the same way outlook does. I imagine it has something to do w/ ldap. Has anyone had any experience using php w/ ldap, to successfully send an email with a user authenticated account on the exchange server?
  2. correct. i guess i did not ask the question correctly. i know what subversion does, but I want to know if it can do this... I know you have to commit a file, and make any comments if any, on the change, but is there a way if I was to automatically save changes to the file on the server, it will record the changes accordingly within subversion, without having to commit the change manually?
  3. I got it to work w/ authentication, it would not send the email if the username/password was incorrect, but when it was correct, it would send, but it was never received. The way outlook authenticates on the server is more strict than just your username and password being correct. So I am still scratching my head to figure out what other hoops I need to jump thru.
  4. for subversion, could you set something up, so any changes to a file on the server is automatically logged into svn? because i generally duplicate the file i am working on, and save it as filename2.php, then make the changes, test, then delete filename.php and rename filename2.php to filename.php. i make back up's of everything i work on, onto my computer's hard drive, but is there a way it will automatically save the different changes to the files into subversion? i ask this, because i make my changes right off the server, and hit save, and i am good to go, instead of downloading the file first and then editing it, and then uploading the changes.
  5. works great! thank you. now not to be picky, could i just set it to display minutes by increments of 15, since when they add it, it only displays it as 00, 15, 30, 45. Sorry for being a pain. I will definitely hold onto the script as is for possibly having to use minutes 1 - 59 down the road. Thanks again!!
  6. Sadly, nothing. This is exactly what I have. <?php error_reporting(E_ALL); $timestamp = strtotime('2008-09-18 10:00:00'); //$timestamp = strtotime($timestampfromdb); //hour print '<select name="event_hour">'; for ($i=1;$i<=12;$i++{ $selected = $i==date('g',$timestamp)?"selected":""; print "<option $selected value='$i'>$i</option>"; } print '</select> : '; //minute print '<select name="event_minute">'; for ($i=1;$i<=60;$i++{ $i = $i<10?'0'.$i:$i; $selected = $i==date('i',$timestamp)?"selected":""; print "<option $selected value='$i'>$i</option>"; } print '</select>'; //AM or PM print '<select name="event_am_pm"> <option '.(date('A',$timestamp)=="AM"?"selected":"").' value="AM">AM</option> <option '.(date('A',$timestamp)=="PM"?"selected":"").' value="PM">PM</option>'; print '</select>'; ?>
  7. thanks f1fan found another, at the very end, missing a ' at the end of </select> ; This is what i have now, and it isn't displaying anything. <?php $timestamp = strtotime('2008-09-18 10:00:00'); //$timestamp = strtotime($timestampfromdb); //hour print '<select name="event_hour">'; for ($i=1;$i<=12;$i++{ $selected = $i==date('g',$timestamp)?"selected":""; print "<option $selected value='$i'>$i</option>"; } print '</select> : '; //minute print '<select name="event_minute">'; for ($i=1;$i<=60;$i++{ $i = $i<10?'0'.$i:$i; $selected = $i==date('i',$timestamp)?"selected":""; print "<option $selected value='$i'>$i</option>"; } print '</select>'; //AM or PM print '<select name="event_am_pm"> <option '.(date('A',$timestamp)=="AM"?"selected":"").' value="AM">AM</option> <option '.(date('A',$timestamp)=="PM"?"selected":"").' value="PM">PM</option>'; print '</select>'; ?> I feel close, but not sure if the timestamp I set it to manually is messing it up.
  8. Thank you very much. Copied the code and tried it out, no dice. The color coding in textwrangler makes me wonder if there is a missing ; on the print of the minute for loop, included a screen shot and the code that I used. <?php $timestamp = strtotime('2008-09-18 10:00:00'); //$timestamp = strtotime($timestampfromdb); //hour print '<select name="event_hour">'; for ($i=1;$i<=12;$i++{ $selected = $i==date('g',$timestamp)?"selected":""; print "<option $selected value='$i'>$i</option>"; } print '</select> : '; //minute print '<select name="event_minute"> for ($i=1;$i<=60;$i++{ $i = $i<10?'0'.$i:$i; $selected = $i==date('i',$timestamp)?"selected":""; print "<option $selected value='$i'>$i</option>"; } </select> '; //AM or PM print '<select name="event_am_pm"> <option '.(date('A',$timestamp)=="AM"?"selected":"").' value="AM">AM</option> <option '.(date('A',$timestamp)=="PM"?"selected":"").' value="PM">PM</option>'; print '</select>'; ?> [attachment deleted by admin]
  9. This part seems to be confusing me: print '<select name="event_minute"> for ($i=1;$i<=60;$i++{ $i = $i<10?'0'.$i:$i; $selected = $i==date('i',$timestamp)?"selected":""; print "<option $selected value='$i'>$i</option>"; } </select> '; the part where you print the select name... and then the for loop, why print the loop?
  10. found this code, but it checks for the index. I want to check it against the value w/i the table. so if the event i am updating had it set to 4:35pm, I want it to check for the minute(s): 30, as you'll see in this example, but it uses the index 2 to find it within the array. So ya, I want it to match the one within the array, not the index of the array, so the code below I need help tweaking to do just that. <?php function dropdown($name, $options, $selected=null) { /*** begin the select ***/ $dropdown = '<select name="'.$name.'" id="'.$name.'">'."\n"; $selected = $selected; /*** loop over the options ***/ foreach($options as $key=>$option) { /*** assign a selected value ***/ $select = $selected==$key ? ' selected' : null; /*** add each option to the dropdown ***/ $dropdown.= '<option value="'.$key.'"'.$select.'>'.$option.'</option>'."\n"; } /*** close the select ***/ $dropdown.= '</select>'."\n"; /*** and return the completed dropdown ***/ return $dropdown; } ?> <form> <?php $name = 'minutes'; $options = array(00, 15, 30, 45); $selected = '2'; echo dropdown($name, $options, $selected); ?> </form>
  11. I have a function that adds an event to a db table, which stores it as: YYYY-MM-DD HH:MM:SS For the HH:MM:SS, I have 3 drop downs, Hours, Minutes, AM/PM, right now is 9:15am, so it'd go in as 09:15:00 if it was 4:15pm, it'd go in as 16:15:00 For Hours: 1-12, Minutes: 00, 15, 30, 45, and well AM/PM: AM or PM If it is set to PM, I just have it add 12 to the hour selected and I parse everything nicely into the datetime field in the table. Now the question is, for the update function, I want to display those same three drop downs for the time, Hours, Minutes, AM/PM, already selected with the time that was set when the event was initially added. I am assuming it is a while loop that goes thru and tries to match the value within the table up to the value within the drop down box. I am a little foggy on who to go about that, any help would be greatly appreciated. Here is the code that generates the drop downs for the add function: <?php //hour $h = 1; print '<select name="event_hour">'; while($h <= 12){ print '<option value="'.$h.'">'.$h.'</option>'; $h++; } print '</select> : '; //minute print '<select name="event_minute"> <option value="00">00</option> <option value="15">15</option> <option value="30">30</option> <option value="45">45</option> </select> '; //AM or PM print '<select name="event_am_pm"> <option value="AM">AM</option> <option value="PM">PM</option>'; print '</select>'; ?>
  12. You have it as <option name="venues_uid4"> options dont use the name element, shouldn't it be: <select name="venues_uid4"> so the # 4 stands for the user's id?
  13. I am using a script, that uses a pear library, I use to use the html mime mail library which did a great job w/ html email I am wondering how I could set this email msg to be in html. <?php require_once "Mail.php"; $from = "email@domain.edu"; $to = "receiver@ domain.edu"; $subject = "Hi!"; $body = "<p>Hi, How are you?</p>"; $host = "mail1.domain.edu"; $username = "user"; $password = "pass"; $headers = array ('From' => $from, 'To' => $to, 'X-From-Web' => $from, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if(PEAR::isError($mail)) { echo("<p>" . $mail->getMessage() . "</p>"); } else { echo("<p>Message successfully sent!</p>"); } ?> The email msg I receive, has the <p></p> tags in it.
  14. checked w/ the system admin, no @domain.com needed on it.
  15. I am using HTML Mime Mail for PHP (http://www.phpguru.org/static/mime.mail.html) to send a daily bulletin. I work at a college and we have two email accounts dedicated to sending to all accounts. one is for sending to all students, the other is for sending to all faculty/staff. Each morning a script put the day's events into an email and sends it out to both accounts. The problem is, the two email addresses can only be sent to if you are an authorized user on the mail system. Right now it is setup to just send using the script, but I can not get it to work using authentication. for example.... this is what i see when I look up the setSMTPParams: setSMTPParams(string $host, int $port, string $helo, bool $auth, string $user, string $pass) this is what I have setSMTPParams('mail1.domain.edu', 25, '', true, 'user', 'password'); If anyone has used this, any help would be great, but if there is another mail script you have used, let me know. Also, the server is an exchange server. Thanks for help in advance.
  16. now how would i go about updating multiple records by clicking submit. because i'll go thru and assign each volunteer to a venue by selecting one from a drop down list of venues, which will appear next to each volunteer's name.
  17. thanks TLG now i need to select the events current time into the drop downs. so if the hour was: 15:15:00 it will be <select name="hour"> <option value="1"> .... <option value="3" selected> </select> <select name="minute"> <option value="00">00</option> ... <option value="15" selected>15</option> ... </select> same as for AM and PM
  18. really? what about the part of automatically setting the select (drop-down) boxes to what current time is of that event. keep in mind, this is for the update function, to update events.
  19. its military, i plan on throwing a test in there. if less than 12, then its AM if its greater than 12, its PM 09 = AM 21 = PM
  20. thanks! that solves my first part. now i need to display the hour/minute/am or pm drop downs w/ the time already selected. so if it was 16:15 i want to have these showing up as selected in the drop down: 4:15 PM any takers? thanks so far!
  21. this is for updating an event day and time: i have a datetime for an event. i want to pull the hour and minutes from the datetime example: 2008-09-12 04:25:00 I want to pull out 04 and 25 Then I have three drop downs, one for hour, one for minute and the other is for AM or PM, based on whether the hour is less than 12, then its AM, otherwise I'll set it to PM. I want to figure out how to automatically set each drop down to the current value already selected in the drop down. This is what I have for the drop down right now: the column in the table to grab the current event_date, which would be: 2008-09-12 04:25:00 I am guessing I need to do some while loop to set the appropriate values as selected when displaying the drop downs on the menu. <?php //hour $h = 1; print '<select name="event_hour">'; while($h <= 12){ print '<option value="'.$h.'">'.$h.'</option>'; $h++; } print '</select> : '; print '<select name="event_minute"> <option value="00">00</option> <option value="15">15</option> <option value="30">30</option> <option value="45">45</option> </select> '; //AM or PM print '<select name="event_am_pm"> <option value="AM">AM</option> <option value="PM">PM</option>'; print '</select>'; ?> Thanks in advance, any help is appreciated.
  22. here is the code i have right now, to print out the drop downs for month, day, year, hour, minute, am/pm <?php print '<h3>Date of Event</h3>'; //month $m = 1; print '<select name="event_month">'; print '<option>Month</option>'; while($m <= 12){ print '<option value="'.$m.'">'.$m.'</option>'; $m++; } print '</select>'; //day $d = 1; print '<select name="event_day">'; print '<option>Day</option>'; while($d <= 31){ print '<option value="'.$d.'">'.$d.'</option>'; $d++; } print '</select>'; //year print '<select name="event_year">'; print '<option>Year</option> <option value="2008">2008</option> <option value="2009">2009</option>'; print '</select>'; print '<h3>Time of Event</h3>'; //hour $h = 1; print '<select name="event_hour">'; print '<option>Hour</option>'; while($h <= 12){ print '<option value="'.$h.'">'.$h.'</option>'; $h++; } print '</select>'; //minute $min = 1; print '<select name="event_minute">'; print '<option>Minute</option>'; while($min <= 60){ print '<option value="'.$min.'">'.$min.'</option>'; $min++; } print '</select>'; //AM or PM print '<select name="event_am_pm">'; print '<option>AM or PM</option> <option value="AM">AM</option>'; print '</select>'; ?> i was testing for AM or PM, if PM, add 12 onto the hour picked, for military time, and I knew this is a sloppy way of doing this and thought it would be good to ask for help on this. There must be a better way or even a way that is widely used that you could refer me to. I will add a screen shot of what it looks like as well. if($HTTP_POST_VARS['event_am_pm'] == 'pm') { $event_hour_military = $HTTP_POST_VARS['event_hour'] + 12; } $expiredate=$HTTP_POST_VARS['event_year'].'-'.$HTTP_POST_VARS['event_month'].'-'.$HTTP_POST_VARS['event_day'].' '.$event_hour_military.':'.$HTTP_POST_VARS['event_minute'].':00'; As always, thanks in advance. [attachment deleted by admin]
×
×
  • 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.