Jump to content

jhollin1138

Members
  • Content Count

    142
  • Joined

  • Last visited

Community Reputation

0 Neutral

About jhollin1138

  • Rank
    Distant Family

Contact Methods

  • Website URL
    http://www.jhollin1138.com
  • ICQ
    0

Profile Information

  • Location
    Cleveland, Ohio
  1. I spoke to soon. I forgot to change "Web Service Extensions".
  2. That is what I thought too. After I make the necessary changes and restart IIS, I can't get any php pages to load until I change everything back to point to php4. Any ideas on what I am missing? Is there something else that could be pointing to php4?
  3. Now that the TCH's servers I am hosting my accounts on have both been updated, I need to update my own Windows 2003 server to PHP5 from PHP4. This is the server I have at work for file storage and hosting a few web based applications, so I need to avoid downtime if possible. I am trying to find the best method or procedure possible to do this update. I found this procedure on another website. h**p://www.geekpedia.com/tutorial88_How-to-upgrade-from-PHP-4.x-to-PHP-5.x-on-Windows.html But since it involves uninstalling PHP4 I am weary of trying it in case it doesn't work. Does anyone have any suggestions or comments to get me going? I guess on a side note, instead of creating another thread I need to update MySQL to v5 also, any suggestions or comments about that too?
  4. Well if you want to stay with Gallery, I am not sure what you can use. If you consider switching to SPGM, I wrote a mod for it that adds video support. Information on my SPGM-Vid mod for SPGM can be found on my site here.
  5. Being a long time hotmail and yahoo user myself, I think I can answer this. I believe Hotmail doesn't have a a true spam filter like yahoo and the others use. When a hotmail user turns on spam filtering, basically if the email isn't from an address in the address book or the safe list, hotmail will assume the email is spam. The people receiving your email on their hotmail account need to have your email or "@solabroad.com" in their safe list. I believe because of this, there is nothing you can do with formating your email to get around this with hotmail.
  6. To be honest I am not sure why I did that either. Some of the code on php.net had them, and others didn't. I am not planning on hosting on a MAC or even Windows so I will never know if I needed them or not.
  7. I had a project a month ago or so to add a form to my company's website. My goal was to have the email in both html and plain text as well as include an attachment. I read all the posts on sending mail on php.net and combined the best of the information to build a function for handling mail. Here is the function I came up with, of course there is a little bit of nearly every post in it. >function send_mail($fromname, $emailaddress, $fromaddress, $emailsubject, $body, $fileattach = false) { # Is the OS Windows or Mac or Linux if (strtoupper(substr(PHP_OS,0,3)=='WIN')) $eol="\r\n"; elseif (strtoupper(substr(PHP_OS,0,3)=='MAC')) $eol="\r"; else $eol="\n"; $mime_boundary_1 = md5(time()); $mime_boundary_2 = "1_".$mime_boundary_1; $mail_sent = false; # Common Headers $headers = ""; $headers .= 'From: '.$fromname.'<'.$fromaddress.'>'.$eol; $headers .= 'Reply-To: '.$fromname.'<'.$fromaddress.'>'.$eol; $headers .= 'Return-Path: '.$fromname.'<'.$fromaddress.'>'.$eol; // these two to set reply address $headers .= "Message-ID: <".$now."webmaster@".$_SERVER['SERVER_NAME'].">".$eol; $headers .= "X-Mailer: PHP v".phpversion().$eol; // These two to help avoid spam-filters # Boundry for marking the split & Multitype Headers $headers .= 'MIME-Version: 1.0'.$eol; $headers .= "Content-Type: multipart/mixed;".$eol; $headers .= " boundary=\"".$mime_boundary_1."\"".$eol; $msg = ""; # Building Message Body $msg .= "--".$mime_boundary_1.$eol; $msg .= "Content-Type: multipart/alternative;".$eol; $msg .= " boundary=\"".$mime_boundary_2."\"".$eol.$eol; # Text Version $msg .= "--".$mime_boundary_2.$eol; $msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol; $msg .= "Content-Transfer-Encoding: 8bit".$eol; $msg .= strip_tags(str_replace("<br>", $eol, $body)).$eol.$eol; # HTML Version $msg .= "--".$mime_boundary_2.$eol; $msg .= "Content-Type: text/html; charset=iso-8859-1".$eol; $msg .= "Content-Transfer-Encoding: 8bit".$eol; $msg .= str_replace($eol, "<br>", $body).$eol.$eol; # Finished Message Body $msg .= "--".$mime_boundary_2."--".$eol.$eol; # Begin Adding Attachments if ($fileattach) { for($i=0; $i < count($fileattach); $i++) { if (is_file($fileattach[$i]["file"])) { # File for Attachment $file_name = substr($fileattach[$i]["file"], (strrpos($fileattach[$i]["file"], "/")+1)); $handle=fopen($fileattach[$i]["file"], 'rb'); $f_contents=fread($handle, filesize($fileattach[$i]["file"])); $f_contents=chunk_split(base64_encode($f_contents)); //Encode The Data For Transition using base64_encode(); //Remove file unlink($fileattach[$i]["file"]); # Attachment $msg .= "--".$mime_boundary_1.$eol; $msg .= "Content-Type: ".$fileattach[$i]["content_type"].";".$eol; $msg .= " name=\"".$file_name."\"".$eol; $msg .= "Content-Transfer-Encoding: base64".$eol; $msg .= "Content-Disposition: attachment;".$eol; $msg .= " filename=\"".$file_name."\"".$eol.$eol; // !! This line needs TWO end of lines !! IMPORTANT !! $msg .= $f_contents.$eol.$eol; } } } # Finished $msg .= "--".$mime_boundary_1."--".$eol.$eol; // finish with two eol's for better security. see Injection. # SEND THE EMAIL ini_set(sendmail_from, $fromaddress); // the INI lines are to force the From Address to be used ! if (mail($emailaddress, $emailsubject, $msg, $headers)) $mail_sent = true; ini_restore(sendmail_from); return $mail_sent; } I realize this is more then the original post asked for, but I figured it might be useful.
  8. I finally got everything working. The solution came to me when I was giving the kids a bath. Instead of trying to figure out which radio button was picked and set a variable, just set a variable. This is what I came up with for the html section: ><div id="box" class="dialog"> <form method="post" name="printDialog" action="printWin('./print.php?id=4306&PrintSheet=');"> <table align="center"> <tr><td colspan="2">Print Sheet: </td></tr> <tr><td colspan="2"><input type="radio" name="PrintSheet" onclick="printPage='order'" /> Order</td></tr> <tr><td colspan="2"><input type="radio" name="PrintSheet" onclick="printPage='spec'" /> Specification</td></tr> <tr><td colspan="2"><input type="radio" name="PrintSheet" onclick="printPage='est'" /> Estimate</td></tr> <tr> <td> <input type="submit" name="submit" value="OK" onclick="hm('box');" /> </td> <td> <input type="reset" value="Cancel" onclick="hm('box');" /> </td> </tr> </table> </form> </div> Here is the java script: >MyPrintWin=null; function printWin(linkName) { if(MyPrintWin != null) MyPrintWin.close(); printPageLink = linkName + printPage; MyPrintWin = window.open(printPageLink, "printWindow", "width=700,height=500,menubar=no,resizable,toolbar=no,scrollbars"); }
  9. Unfortunately, the only thing I know about cookies is how to eat them.
  10. Here is an update. I tried the following javascript code, still no luck. >MyPrintWin=null; function printWin(linkName, printPageDefault) { if(MyPrintWin != null) MyPrintWin.close(); var printPage = printPageDefault; for (var i=0; i < document.printDialog.PrintSheet.length; i++) { if (document.printDialog.PrintSheet[i].checked) { printPage = document.printDialog.PrintSheet[i].value; } } printPageLink = linkName + printPage; MyPrintWin = window.open(printPageLink, "printWindow", "width=700,height=500,menubar=no,resizable,toolbar=no,scrollbars"); } I also tried using onsubmit instead of action in my html form, no luck. ><div id="box" class="dialog"> <form method="post" name="printDialog" onsubmit="printWin('./print.php?id=4306&PrintSheet=', 'spec');return false;"> <table align="center"> <tr><td colspan="2">Print Sheet: </td></tr> <tr><td colspan="2"><input type="radio" name="PrintSheet" value="order" checked="checked" /> Order</td></tr> <tr><td colspan="2"><input type="radio" name="PrintSheet" value="spec" /> Specification</td></tr> <tr><td colspan="2"><input type="radio" name="PrintSheet" value="est" /> Estimate</td></tr> <tr> <td> <input type="submit" name="submit" value="OK" onclick="java script:hm('box');" /> </td> <td> <input type="reset" value="Cancel" onclick="java script:hm('box');" /> </td> </tr> </table> </form> </div> Any help would be appreciated.
  11. I feel like a javascript knucklehead here. I am trying to implement the "Modal Dialog Box" script found here h**p://javascript.about.com/b/a/256836.htm. I have been able to get the front end of things working fine; it is the back end of things that isn't working. I am working on a script, in PHP, that is pulling information together and generates one of three different reports. I am using the "Modal Dialog Box" to generate an interface for the user to select which of the reports they want to generate. When the user clicks 'OK', I want to pop-up a new window with their report. Here is my HTML code for the "Modal Dialog Box". ><div id="box" class="dialog"> <form method="post" name="printDialog" action="printWin('./print.php?id=4306&PrintSheet=', 'order');"> <table align="center"> <tr><td colspan="2">Print Sheet: </td></tr> <tr><td colspan="2"><input type="radio" name="PrintSheet" value="order" checked="checked" /> Order</td></tr> <tr><td colspan="2"><input type="radio" name="PrintSheet" value="spec" /> Specification</td></tr> <tr><td colspan="2"><input type="radio" name="PrintSheet" value="est" /> Estimate</td></tr> <tr> <td> <input type="submit" name="submit" value="OK" onclick="hm('box');" /> </td> <td> <input type="reset" value="Cancel" onclick="hm('box');" /> </td> </tr> </table> </form> </div> Here is my javascript that is handling the pop-up window. >MyPrintWin=null; function printWin(linkName, printPageDefault) { if(MyPrintWin != null) MyPrintWin.close(); for (var i=0; i < document.printDialog.PrintSheet.length; i++) { if (document.printDialog.PrintSheet[i].checked) { var printPage = document.printDialog.PrintSheet[i].value; } } printPageLink = linkName + printPage; MyPrintWin = window.open(printPageLink, "printWindow", "width=700,height=500,menubar=no,resizable,toolbar=no,scrollbars"); } When I click 'OK', the "Modal Dialog Box" is disappearing, but the pop-up isn't showing up. If I change my javascript to: >MyPrintWin=null; function printWin(linkName, printPageDefault) { if(MyPrintWin != null) MyPrintWin.close(); printPageLink = linkName + printPageDefault; MyPrintWin = window.open(printPageLink, "printWindow", "width=700,height=500,menubar=no,resizable,toolbar=no,scrollbars"); } Everything works the way I would like, although obviously the value for the radio button is not being used. Am I missing something here?
  12. :oops:I found my problem. Replacing the similar section of code in my first post with the code below, fixes the it. >for ($i=0; $i<count($arr_Multiplier); $i++) { $arr_EstimateTotal[$i]['ItemType'] = $arr_Multiplier[$i]['ItemType']; $arr_EstimateTotal[$i]['Multiplier'] = 1 + $arr_Multiplier[$i]['Multiplier']; for ($j=0; $j<count($arr_Estimate); $j++) { if ($arr_Multiplier[$i]['ItemTypeID'] == $arr_Estimate[$j]['ItemTypeID']) { $arr_EstimateTotal[$i]['ItemTotal'] = $arr_EstimateTotal[$i]['ItemTotal'] + $arr_Estimate[$j]['Total']; $arr_EstimateTotal[$i]['MultTotal'] = ceil($arr_EstimateTotal[$i]['ItemTotal'] * $arr_EstimateTotal[$i]['Multiplier']); } } $OverallTotal = $OverallTotal + $arr_EstimateTotal[$i]['MultTotal']; }
  13. I am working on script and I am having the addition problems with PHP. Here is a sample piece of code that I am having a problem with. ><?php $OverallTotal = 0; for ($i=0; $i<count($arr_Multiplier); $i++) { $arr_EstimateTotal[$i]['ItemType'] = $arr_Multiplier[$i]['ItemType']; $arr_EstimateTotal[$i]['Multiplier'] = 1 + $arr_Multiplier[$i]['Multiplier']; for ($j=0; $j<count($arr_Estimate); $j++) { if ($arr_Multiplier[$i]['ItemTypeID'] == $arr_Estimate[$j]['ItemTypeID']) { $arr_EstimateTotal[$i]['ItemTotal'] = $arr_EstimateTotal[$i]['ItemTotal'] + $arr_Estimate[$j]['Total']; $arr_EstimateTotal[$i]['MultTotal'] = ceil($arr_EstimateTotal[$i]['ItemTotal'] * $arr_EstimateTotal[$i]['Multiplier']); $OverallTotal = $OverallTotal + $arr_EstimateTotal[$i]['MultTotal']; } } } for ($i=0; $i<count($arr_LaborMultiplier); $i++) { $arr_LaborTotal[$i]['LaborType'] = $arr_LaborMultiplier[$i]['LaborType']; $arr_LaborTotal[$i]['LaborTotal'] = ceil($int_LaborTotal * $arr_LaborMultiplier[$i]['LaborMultiplier']); $OverallTotal = $OverallTotal + $arr_LaborTotal[$i]['LaborTotal']; } // Building Table echo '<table class="estimate">'."\n"; for ($i=0; $i<count($arr_EstimateTotal); $i++) { echo ' <tr>'."\n"; echo ' <td align="right" colspan="8">'; echo str_replace($cfg['lang']['tag_total'],$arr_EstimateTotal[$i]['ItemType'],money_format($cfg['lang']['est_Material'], $arr_EstimateTotal[$i]['ItemTotal'])); echo ':</td>'."\n"; echo estimate_box('ETotal'.'_'.$arr_EstimateTotal[$i]['ItemTypeID'], $arr_EstimateTotal[$i]['MultTotal'], 50, 'Text', 7, 'right', 0, 0); echo ' </tr>'."\n"; } for ($i=0; $i<count($arr_LaborMultiplier); $i++) { echo ' <tr>'."\n"; echo ' <td align="right" colspan="8">Total '.$arr_LaborTotal[$i]['LaborType'].':</td>'."\n"; echo estimate_box('LTotal'.'_'.$arr_LaborTotal[$i]['LaborTypeID'], $arr_LaborTotal[$i]['LaborTotal'], 50, 'Text', 7, 'right', 0, 0); echo ' </tr>'."\n"; } echo ' <tr>'."\n"; echo ' <td align="right" colspan="8">Total:</td>'."\n"; echo estimate_box('OTotal'.'_'.'T', $OverallTotal, 50, 'Text', 7, 'right', 0, 0); echo ' </tr>'."\n"; echo '</form>'."\n"; ?> I am pulling data into the arrays "$arr_Multiplier", "$arr_Estimate" & "$arr_LaborMultiplier" and variable "$int_LaborTotal" from a MySQL database. The data is all correct. The problem is the value for "$OverallTotal" is incorrect. PHP is saying 4193, but when I add the values I get 4075 (791+269+810+585+1620=4075). See this link to the stripped down source code of the output (I have a screen-shot of the output but I couldn't get it to attach it). Some items don't have the problem, while others do. Does anyone have any ideas?
  14. It shouldn't be hard to do. I will see if I have some time this evening.
×
×
  • Create New...