Jump to content

sawade

Members
  • Posts

    181
  • Joined

  • Last visited

    Never

Everything posted by sawade

  1. No, no spamming involved. The URL needs to be hidden for security reasons. Will give this a shot. Thanks.
  2. Hi PHP experts, I need to run a URL from a .php file. I dont need to grab its output or do anything. All I want to do is just call a URL [that was created from the .php file] so that the server receives a request for the URL and executes the request. Any help would be great. Thanks Additional Info: - Standalone App - Must be submitted via post and not SQL - Must hide user URL and make sure server submitted for security
  3. So basically I just want it to give me 2 values. One to go to the hidden field and the 2nd to be displayed as text (not in a textbox). I know it's doable I've seen it, I am just not good with js to know how to implement it into this pre-existing code. Thank you for the help.
  4. I read through the code and I think this is what you are asking about... // Simple method to interface popup calendar with a text-entry box function CP_select(inputobj, linkname, format) { var selectedDate=(arguments.length>3)?arguments[3]:null; if (!window.getDateFromFormat) { alert("calendar.select: To use this method you must also include 'date.js' for date formatting"); return; } if (this.displayType!="date"&&this.displayType!="week-end") { alert("calendar.select: This function can only be used with displayType 'date' or 'week-end'"); return; } if (inputobj.type!="text" && inputobj.type!="hidden" && inputobj.type!="textarea") { alert("calendar.select: Input object passed is not a valid form input object"); window.CP_targetInput=null; return; } if (inputobj.disabled) { return; } // Can't use calendar input on disabled form input! window.CP_targetInput = inputobj; window.CP_calendarObject = this; this.currentDate=null; var time=0; if (selectedDate!=null) { time = getDateFromFormat(selectedDate,format) } else if (inputobj.value!="") { time = getDateFromFormat(inputobj.value,format); } if (selectedDate!=null || inputobj.value!="") { if (time==0) { this.currentDate=null; } else { this.currentDate=new Date(time); } } window.CP_dateFormat = format; this.showCalendar(linkname); } // Return a string containing all the calendar code to be displayed function CP_getCalendar() { var now = new Date(); // Reference to window if (this.type == "WINDOW") { var windowref = "window.opener."; } else { var windowref = ""; } var result = ""; // If POPUP, write entire HTML document if (this.type == "WINDOW") { result += "<HTML><HEAD><TITLE>Calendar</TITLE>"+this.getStyles()+"</HEAD><BODY MARGINWIDTH=0 MARGINHEIGHT=0 TOPMARGIN=0 RIGHTMARGIN=0 LEFTMARGIN=0>\n"; result += '<CENTER><TABLE WIDTH=100% BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>\n'; } else { result += '<TABLE CLASS="'+this.cssPrefix+'cpBorder" WIDTH=144 BORDER=1 BORDERWIDTH=1 CELLSPACING=0 CELLPADDING=1>\n'; result += '<TR><TD ALIGN=CENTER>\n'; result += '<CENTER>\n'; } // Code for DATE display (default) // ------------------------------- if (this.displayType=="date" || this.displayType=="week-end") { if (this.currentDate==null) { this.currentDate = now; } if (arguments.length > 0) { var month = arguments[0]; } else { var month = this.currentDate.getMonth()+1; } if (arguments.length > 1 && arguments[1]>0 && arguments[1]-0==arguments[1]) { var year = arguments[1]; } else { var year = this.currentDate.getFullYear(); } var daysinmonth= new Array(0,31,28,31,30,31,30,31,31,30,31,30,31); if ( ( (year%4 == 0)&&(year%100 != 0) ) || (year%400 == 0) ) { daysinmonth[2] = 29; } var current_month = new Date(year,month-1,1); var display_year = year; var display_month = month; var display_date = 1; var weekday= current_month.getDay(); var offset = 0; offset = (weekday >= this.weekStartDay) ? weekday-this.weekStartDay : 7-this.weekStartDay+weekday ; if (offset > 0) { display_month--; if (display_month < 1) { display_month = 12; display_year--; } display_date = daysinmonth[display_month]-offset+1; } var next_month = month+1; var next_month_year = year; if (next_month > 12) { next_month=1; next_month_year++; } var last_month = month-1; var last_month_year = year; if (last_month < 1) { last_month=12; last_month_year--; } var date_class; if (this.type!="WINDOW") { result += "<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>"; } result += '<TR>\n'; var refresh = windowref+'CP_refreshCalendar'; var refreshLink = 'javascript:' + refresh; if (this.isShowNavigationDropdowns) { result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="78" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpMonthNavigation" name="cpMonth" onmouseup="CP_stop(event)" onChange="'+refresh+'('+this.index+',this.options[this.selectedIndex].value-0,'+(year-0)+');">'; for( var monthCounter=1; monthCounter<=12; monthCounter++ ) { var selected = (monthCounter==month) ? 'SELECTED' : ''; result += '<option value="'+monthCounter+'" '+selected+'>'+this.monthNames[monthCounter-1]+'</option>'; } result += '</select></TD>'; result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"> </TD>'; result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="56" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpYearNavigation" name="cpYear" onmouseup="CP_stop(event)" onChange="'+refresh+'('+this.index+','+month+',this.options[this.selectedIndex].value-0);">'; for( var yearCounter=year-this.yearSelectStartOffset; yearCounter<=year+this.yearSelectStartOffset; yearCounter++ ) { var selected = (yearCounter==year) ? 'SELECTED' : ''; result += '<option value="'+yearCounter+'" '+selected+'>'+yearCounter+'</option>'; } result += '</select></TD>'; } else { if (this.isShowYearNavigation) { result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+last_month+','+last_month_year+');"><</A></TD>'; result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="58"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[month-1]+'</SPAN></TD>'; result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+next_month+','+next_month_year+');">></A></TD>'; result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"> </TD>'; result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="'+refreshLink+'('+this.index+','+month+','+(year-1)+');"><</A></TD>'; if (this.isShowYearNavigationInput) { result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><INPUT NAME="cpYear" CLASS="'+this.cssPrefix+'cpYearNavigation" SIZE="4" MAXLENGTH="4" VALUE="'+year+'" onBlur="'+refresh+'('+this.index+','+month+',this.value-0);"></TD>'; } else { result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><SPAN CLASS="'+this.cssPrefix+'cpYearNavigation">'+year+'</SPAN></TD>'; } result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="'+refreshLink+'('+this.index+','+month+','+(year+1)+');">></A></TD>'; } else { result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+last_month+','+last_month_year+');"><<</A></TD>\n'; result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="100"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[month-1]+' '+year+'</SPAN></TD>\n'; result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+next_month+','+next_month_year+');">>></A></TD>\n'; } } result += '</TR></TABLE>\n'; result += '<TABLE WIDTH=120 BORDER=0 CELLSPACING=0 CELLPADDING=1 ALIGN=CENTER>\n'; result += '<TR>\n'; for (var j=0; j<7; j++) { result += '<TD CLASS="'+this.cssPrefix+'cpDayColumnHeader" WIDTH="14%"><SPAN CLASS="'+this.cssPrefix+'cpDayColumnHeader">'+this.dayHeaders[(this.weekStartDay+j)%7]+'</TD>\n'; } result += '</TR>\n'; for (var row=1; row<=6; row++) { result += '<TR>\n'; for (var col=1; col<=7; col++) { var disabled=false; if (this.disabledDatesExpression!="") { var ds=""+display_year+LZ(display_month)+LZ(display_date); eval("disabled=("+this.disabledDatesExpression+")"); } var dateClass = ""; if ((display_month == this.currentDate.getMonth()+1) && (display_date==this.currentDate.getDate()) && (display_year==this.currentDate.getFullYear())) { dateClass = "cpCurrentDate"; } else if (display_month == month) { dateClass = "cpCurrentMonthDate"; } else { dateClass = "cpOtherMonthDate"; } if (disabled || this.disabledWeekDays[col-1]) { result += ' <TD CLASS="'+this.cssPrefix+dateClass+'"><SPAN CLASS="'+this.cssPrefix+dateClass+'Disabled">'+display_date+'</SPAN></TD>\n'; } else { var selected_date = display_date; var selected_month = display_month; var selected_year = display_year; if (this.displayType=="week-end") { var d = new Date(selected_year,selected_month-1,selected_date,0,0,0,0); d.setDate(d.getDate() + (7-col)); selected_year = d.getYear(); if (selected_year < 1000) { selected_year += 1900; } selected_month = d.getMonth()+1; selected_date = d.getDate(); } result += ' <TD CLASS="'+this.cssPrefix+dateClass+'"><A HREF="javascript:'+windowref+this.returnFunction+'('+selected_year+','+selected_month+','+selected_date+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+this.cssPrefix+dateClass+'">'+display_date+'</A></TD>\n'; } display_date++; if (display_date > daysinmonth[display_month]) { display_date=1; display_month++; } if (display_month > 12) { display_month=1; display_year++; } } result += '</TR>'; } var current_weekday = now.getDay() - this.weekStartDay; if (current_weekday < 0) { current_weekday += 7; } result += '<TR>\n'; result += ' <TD COLSPAN=7 ALIGN=CENTER CLASS="'+this.cssPrefix+'cpTodayText">\n'; if (this.disabledDatesExpression!="") { var ds=""+now.getFullYear()+LZ(now.getMonth()+1)+LZ(now.getDate()); eval("disabled=("+this.disabledDatesExpression+")"); } if (disabled || this.disabledWeekDays[current_weekday+1]) { result += ' <SPAN CLASS="'+this.cssPrefix+'cpTodayTextDisabled">'+this.todayText+'</SPAN>\n'; } else { result += ' <A CLASS="'+this.cssPrefix+'cpTodayText" HREF="javascript:'+windowref+this.returnFunction+'(\''+now.getFullYear()+'\',\''+(now.getMonth()+1)+'\',\''+now.getDate()+'\');'+windowref+'CP_hideCalendar(\''+this.index+'\');">'+this.todayText+'</A>\n'; } result += ' <BR>\n'; result += ' </TD></TR></TABLE></CENTER></TD></TR></TABLE>\n'; } The code I am using..... // Author: Matt Kruse <matt@mattkruse.com> // WWW: http://www.mattkruse.com/
  5. That's what I figured. Darn. I suck at Javascript! LOL Thank you!
  6. What about a do while loop?
  7. Is there a way with js to do an automatic refresh once a the variable is filled? For example.... <td><a href="#" onClick="cal.select(document.forms['addappt'].date1,'anchor1','MM/dd/yyyy'); return false;" name="anchor1" id="anchor1"><img src="calendar.png" /></a><input type="hidden" name="date1" value="" size="10" /> <?php if (!empty($date)) echo $full_date; ?></td> Once date1 has a value to have the page refresh. That way the php code should run and echo out the value???
  8. I have a question: What I want to happen is if a variable is not empty for the page to reload whichout a button or link. So an automatic refresh/reload once a certain variable has been filled. I am thinking this will need to be done with javascript since php is a server side language. Am I correct? I have written a php code that does work for this, but i have to click a button to run the code. Thanks.
  9. I have a functioning js popup calendar. The value selected on the calendar currently populates in an input field. What I want to do is make the field hidden (which I can do easily) and make the value appear in regular text beside the hidden field. I am having troubles getting the value to appear as text. I also want the text value to be formatted the same way as the PHP variable $full_date. But I do want the initial value also. I am a js beginner, if that helps. PHP variables are used to help pass the values into a db and so on and so forth. Thank you!!! PHP variables $date = $_POST["date1"]; $full_date = date('l, F d, Y', strtotime($date)); JAVASCRIPT <A HREF="#" onClick="cal.select(document.forms['addappt'].date1,'anchor1','MM/dd/yyyy'); return false;" NAME="anchor1" ID="anchor1"><img src="calendar.png" /></A><INPUT TYPE="text" NAME="date1" VALUE="" SIZE="25" />
  10. The code does create and send the email successfully. However, the message shows as html code and not an html email. Any ideas what is causing this? Thanks. // Email require_once "/mail.php"; require_once "/mime.php"; require_once "/Crypt/GPG.php"; require_once "/EDITED FOR PRIVACY"; $to = FORM_MAILER; $crlf = "\n"; $hdrs = array( 'From' => EDITED, 'Subject' => "Test Email - Received $date", 'Reply-to' => EDITED ); $smtp["host"] = SMTP_HOST; $smtp["port"] = SMTP_PORT; $smtp["auth"] = true; $smtp["username"] = SMTP_USERNAME; $smtp["password"] = SMTP_PASSWORD; $html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <style type="text/css"> * { margin: 0; padding: 0; } </style> </head> <body> <div id="body"> <h1>TEST</h1> <p><br /></p> <p>TEST</p> <p><br /></p> <table> <tr> <td>Date:</td> <td>' . $date . '</td> <td></td> <td></td> </tr> <tr> <td>First Name:</td> <td>' . $first_name . '</td> <td>Last Name:</td> <td>' . $last_name . '</td> </tr> </table></div></body></html>'; $mime = new Mail_mime($crlf); //$mime->setTXTBody(strip_tags($html)); $mime->setHTMLBody($html); //$mime->addAttachment(); // Encryption $data = $mime->setHTMLBody($html); $gpg = new Crypt_GPG(); $gpg -> addEncryptkey(GPG_SECURE); $encrypted = $gpg -> encrypt($data); $body = $mime->get(); $hdrs = $mime->headers($hdrs); ob_start(); $mail = Mail::factory('smtp', $smtp); $mail->send($to, $hdrs, $encrypted) or die('Error while processing your submission.'); ob_end_clean(); I am thinking it is the gpg that is causing the issue. But all my attempts to get around it aren't going well. If I take out the gpg the email is received fine. Thanks for the help.
  11. Cool beans. I figured that.
  12. Here is my dumb question for the day... week... month... If you have an SSL Certificate with HOST A. Can you move that certificate with you when you move your domain to HOST B?? Thank ya! Happy Holidays!
  13. Thanks, I'll give that a wurl.
  14. Hi. I am not real good with javascript. I am trying to make a script that will auto tab through an html/php form. But also will allow back tab and highlighting/replacement of fields. Here is what I have so far.... function autoTab(field1, len, field2) { if (document.getElementById(field1).value.length == len) { document.getElementById(field2).focus(); } } And... Phone Number: (<input type="text" name="area" id="area" size="3" maxlength="3" onkeyup="autoTab('area', '3', 'prefix')"/>) <input type="text" name="prefix" id="prefix" size="3" maxlength="3" onkeyup="autoTab('prefix', '3', 'suffix')"/> - <input type="text" name="suffix" id="suffix" size="4" maxlength="4"/> Thank you!
  15. It is very hard finding info on this. That is an idea though. I will try to encryption the file and then attach it into the email. I will post after I have tried that. Thanks for the help.
  16. Yeah, everything works great until I input the encryption block... $data = $body; $gpg = new Crypt_GPG(); $gpg -> addEncryptkey(GPGCONSTANT); $encrypted = $gpg -> encrypt($data); If I remove this the code works fine. I am beginning to wonder if PEAR is not compatible with the encryption or if I need another PEAR componet that I haven't found yet. Baffeling.
  17. I would ask the person I made the site for.
  18. Good to hear.... Remember to hit the solved button on the bottom.
  19. Drop Menu <select name="name" id="name"> <option value="Mr" <?php if(isset($_POST['name']) && $_POST['name'] == 'Mr') { echo 'selected="selected"'; } ?> >Mr</option> </select> Radio <input type="radio" name="yes" id="yes" value="Is Yes" <?php if(isset($_POST['yes']) && $_POST['yes'] == 'Is Yes') { echo 'checked="checked"'; } ?> />Yes Checkbox <input type="checkbox" name="checkbox[]" id="name" value="Value01" <?php if (isset ($_POST['checkbox']) && in_array ("Value01", $_POST['checkbox'])) echo ' checked="checked"'; ?> />Field Name
  20. Both snips of code look the same... Please use code tags. Thanks.
×
×
  • 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.