Jump to content

Demonwolf

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by Demonwolf

  1. Thanks. I have tried adding the "from" into the call of mail. It is how I had it originally and it changed nothing. I went hunting for more logs and found something in the PHP logs that it is not connecting to the mail server at all. I think it may be my SMTP, I cannot telnet to that server on port 25.
  2. Hi all I have a MS Server 2008R2 set up with IIS7 In IIS I have set up an SMTP (with the IIS6 requirements) and the standard PHP that you get with it all. The SMTP server works. Reason we have to use a local SMTP server to interface with our actual mail server is because the external server requires TLS authentication and many smaller office scanning machines don't support it. I am able to send mail through the SMTP without issue, both from an office MFP and from a mail client like Outlook 2010. The PHP works too. I have it displaying PHP webpages and even going as far as accessing ODBC data resources. However, the two of them don't work together. I create a basic webpage that is as follows: <html><body> <?php if (mail("me@example.com","Test Subject","Test body")) {echo "success";} else {echo "failed";} ?></body><html> I also have the following in the PHP.ini I found in "C:\Program Files (x86)\PHP\v5.3\" [mail function]SMTP = localhostsmtp_port = 25sendmail_from = no-reply@example.com And yet, all I get is "failed" each time I have run the webpage. Anyone have any ideas on where I can get the PHP/SMTP/Other logs to give me more information? I have monitored the queue folder for the SMTP and it doesn't seem to even receive the mail from the PHP site.
  3. MAGIC! Thanks and sorry for the mistake.
  4. Thanks. That is an idea, however it doesn't seem to be working. Here is my full code. I tried to edit what you gave me and this is where i am now: <html> <head><title>Website</title><link rel="shortcut icon" href="/favicon.ico" /><link rel="icon" href="/favicon.ico" /> <script type="text/javascript">function jsFilter(strInc){document.getElementByID("display").src = 'dbDisplay.php?month=' + strInc;}</script> </head> <body style="background-image:url('Background.png');background-repeat:no-repeat;background-position:right top;background-color:#000066;color:#FFFFFF"> <form><input type="button" onclick="jsFilter('Jan2012')" value="Jan" /></form> <button type='button' onClick="document.getElementById('display').src='dbDisplay.php?month=feb' ">Feb</button> <button type='button' onClick="jsFilter('Mar')">Mar</button> <br /><iframe id="display" width="100%" height="65%" frameborder="0" marginwidth="0" marginheight="0" src="dbDisplay.php?month=All"></iframe> </body> </html> None of the 3 buttons do anything
  5. Hello I hope someone can help me. I have an internal website that hosts a support schedule. In short, people submit details via a form and it dumps it into an ODBC linked MS Access database. I also have a PHP page that retrieves all the tables from the database. I have a basic iframe calling it up as follows: <iframe name="display" width="100%" height="80%" frameborder="0" marginwidth="0" marginheight="0" src="dbDisplay.php?month=all"></iframe> If I create this <a href="dbDisplay.php?month=All" target="display">All</a><a href="dbDisplay.php?month=Jan" target="display">Jan</a><a href="dbDisplay.php?month=Feb" target="display">Feb</a> This creates clickable links on the page that work in affecting the PHP-calling iframe. In the PHP I can use the $_GET['month'] to call up the item I have clicked on. How do I get the links to be buttons? I have tried the following: <button href="dbDisplay.php?month=Feb" target="display">Feb</button> and If I change the iframe name to an id and try this <iframe id="display" width="100%" height="80%" frameborder="0" marginwidth="0" marginheight="0" src="dbDisplay.php?month=all"></iframe> <button onclick="display.src=dbDisplay.php?month=Feb">Feb</button> I have also tried a form <form><input type="button" value="Feb" onclick="display.src=dbDisplay.php?month=Feb"><form> However, nothing has worked yet. Any ideas?
  6. Yes. As I said, it doesn't fail to send (unless the script is terminated) it just takes a long time because of authentication with the SMTP server.
  7. XAMPP has the sendmail program which allows SMTP authentication, which the normal mail() in PHP does not support. I have updated to the latest version and included the dlls that allow TLS authentication. Here is my PHP.ini [mail function] section [mail function]sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"mail.add_x_header = Off And in the sendmail we have: [sendmail]smtp_server=pod*****.outlook.comsmtp_port=587smtp_ssl=tlserror_logfile=error.logdebug_logfile=debug.logauth_username=no-reply@//our domain nameauth_password=***force_sender=no-reply@//our domain name It sends the mail so there is no complication with it, except it takes a while. I think it is related to the fact that we do not have an internal SMTP and the one online required authentication, which can take some time. Our mail lines look as follows mail("support@//our domain name","Support Ref #".Date("Ym").$sPost,wordwrap($_POST["sName"]."\n\nContact details: \n".$_POST["sEmail"]."\n".$_POST["sContact"]."\n\nHas submitted a query with regards to the ".$_POST["sDevice"]." in ".$_POST["sLocation"]."\n\n".$_POST["sProblem"],70),"From: Query Submission <no-reply@//our domain name>"); mail($_POST["sEmail"],"Your support Ref #".Date("Ym").$sPost,wordwrap("Your support reference code is ".Date("Ym").$sPost."\n\nThank you and someone should be in contact soon.",70),"From: Query Submission <no-reply@//our domain name>"); Sorry for all the "bleeping out", company policy is a pain sometimes. I am looking into the pages. The connection handling looks like it holds the most promise. I just hope I can figure it out.
  8. HI all I hope someone can help me. I am using XAMPP and hosting an internal support website. With help from W3Schools and various other online pages, I have put together something quite simple. A user enters information on a page that is set out as follows: <?php session_start();$_SESSION["Valid"] = true;?><html><head> <script type="text/javascript"> function validateForm() { var sFName=document.forms["fQuery"]["sName"].value; var sEma=document.forms["fQuery"]["sEmail"].value; var sLoca=document.forms["fQuery"]["sLocation"].value; var sProb=document.forms["fQuery"]["sProblem"].value; var atpos=sEma.indexOf("@"); var dotpos=sEma.lastIndexOf("."); var blFormChk = true; if (sFName==null || sFName=="") { alert("Name must be filled in"); blFormChk = false; } if (sEma==null || sEma=="") { alert("A valid email address must be filled in"); blFormChk = false; } if (checkEmail(sEma) == false) { alert("Not a valid e-mail address"); blFormChk = false; } if (sLoca==null || sLoca=="") { alert("Please give the location"); blFormChk = false; } if (sProb.length < 30) { alert("Please submit a more detailed query"); blFormChk = false; } return blFormChk; } function checkEmail(checkStr) { var blValid = false; for (var i=0; i<checkStr.length; i++) { var chAtI = checkStr.charCodeAt(i); if ((chAtI<45) || (chAtI==47) || ((chAtI>57) && (chAtI<64)) || ((chAtI>90) && (chAtI<95)) || (chAtI==96) || (chAtI>122)) { blValid = false; } else { blValid = true; } if (blValid == false) { break; } } if (blValid == true) { sConv = checkStr.split("@"); if (sConv.length == 2) { blValid = true;} else { blValid = false; } if (blValid == true) { if ((sConv[0].length > 0) && (sConv[1].length > 0)) { blValid = true; } else { blValid = false; } } if (blValid == true) { sDom = sConv[1].split("."); if (sDom.length==1) { blValid = false; } else { for (var j=0; j<sDom.length; j++) { if (sDom[j].length > 0) { blValid = true; } else { blValid = false; break; } } } } } return blValid; } </script><title>Support Query</title><link rel="shortcut icon" href="/favicon.ico" /></head><body style="background-color:#000066;color:#FFFFFF"> <h1>Company</h1> <h2>Submit a Support Query</h2> <table border=0> <form name="fQuery" action="QueryList.php" onsubmit="return validateForm()" method="post"> <tr> <td> <p>* Required fields</p> <br /> * Name: <br /> <input type="text" name="sName" size="60" maxlength="120" value=""/> <br /> * E-mail address: <br /> <input type="text" name="sEmail" size="60" maxlength="120" value="" /> <br /> Where to find you or contact number: <br /> <input type="text" name="sContact" size="60" maxlength="120" value="" /> <br /> * Location related to query (eg. Room 23, Staffroom): <br /> <input type="text" name="sLocation" size="60" maxlength="180" value="" /> <br /> Type of device related to query (eg. Projector, Sound Box, Computer): <br /> <input type="text" name="sDevice" size="60" maxlength="180" value="" /><br /> <br /> * Query (Please give details): <br /> <textarea name="sProblem" cols='60' rows='6' onkeypress="nCount.innerHTML=250-sProblem.value.length" onkeyup="nCount.innerHTML=250-sProblem.value.length" onkeydown="nCount.innerHTML=250-sProblem.value.length"></textarea> <label for="sProblem" id="nCount">250</label> </tr> <tr> <td> <br /> Please only click submit ONCE and wait for your ticket number.<br /> It may take up to a minute for a confirmation page to be displayed. </td> </tr> <tr> <td> <br /> <input type="submit" value="Submit"/> </td> </tr> </form> </table></body></html> Then they click the submit button and the information goes to the next page: <?php session_start();?><html><head> <link rel="shortcut icon" href="/favicon.ico" /></head><body style="background-color:#000066;color:#FFFFFF"><?php $sFileDate = Date("Ym"); $fDataFile = "./Datafiles/".$sFileDate.".csv"; $fQueries = fopen($fDataFile,"a"); $nCounter = count(file($fDataFile)); if ($nCounter == 0) { fwrite($fQueries,("TicketNo,Name,Email,ContactNo,Location,Device,Query")); $nCounter = 1; } $sPost = vsprintf("%'04s",$nCounter); if ($_SESSION["Valid"] === true) { $_SESSION["Valid"] = false; $aData = array(Date("Ym"),$sPost,",",str_ireplace(",",";",$_POST["sName"]),",",str_ireplace(",",";",$_POST["sEmail"]),",",str_ireplace(",",";",$_POST["sContact"]),",",str_ireplace(",",";",$_POST["sLocation"]),",",str_ireplace(",",";",$_POST["sDevice"]),",","\"".(str_ireplace(array("\n","\r","\r\n")," ",str_ireplace(",",";",$_POST["sProblem"])))."\""); fwrite($fQueries,("\r\n".implode($aData))); fclose($fQueries); set_time_limit(60); mail("//data has been removed"); set_time_limit(60); mail("//data has been removed"); } else {$sPost = vsprintf("%'04s",$nCounter-1);}?><h1>Thank you</h1><p>Your support ticket number is <h2><b><?php print_r(Date("Ym").$sPost);?></b></h2>This ticket number has been emailed to: <?php print_r($_POST["sEmail"]);?></p><p>An email has been sent to support with your query. You should be contacted soon.</p></body></html> And it all works wonderfully... except that the two mail() entries take a while to send. This appears to be causing complications. Before I had the "set_time_limit(60);" lines in, 30seconds in and the script would terminate with an error that the users see. The time limits now stop the error but the user can wait up to 1:59s before it displays the page. Anything beyond that and it gives an error. Is there a way I can display the output page, giving them their reference number while running the mail sending in the background? And if they try close the page, it should give a message saying that it is still sending the mails? Your help would be greatly appreciated.
  9. Hey all.I'm having a bit of an issue. I have created an active desktop to be used in schools. It looks wonderful thanks to the help I've received here and now I'm hoping I can get some help once again. I have a link on the page to Office 2007 applications but when I click on them... nothing happens. If I right click and click "Save Target as..." I am definitely able to save the file I want to link to but I can't get it to run.The link looks as follows: <a href="c:\Program Files\Microsoft Office\Office12\WINWORD.EXE">MS Word 2007</a>I have found on one or two PCs that if I open it in IE and click on the link, I get a dialog asking if I want to Run or Save the file, but this is rare. What I want to do is get it to run without prompts and from the Active Desktop. Anyone have any ideas?Thanks in advance.
  10. I'm sorry... but WHAT?! Very little of that made sense. Okay, I got that backdrops won't resize. Inline images? Are those images inserted with the "img" line but with text over them? How would I do that? And how do I set absolute and relative (I wish knew what that means)? Like I said... I'm relatively new to all this...Thanks for telling me backgrounds won't resize though, means I won't spend the next two nights fighting to figure that out.
  11. Hey all.I have to create a backdrop to be used at schools as an active desktop. There is no standard for the desktop resolution because each student has their own personal preference. My issue is that our background on the webpage is not easily resized to their current resolution. I have managed to get the tables, text, links and everything else all lined up and fitting wonderfully on most monitors from the 800x600 resolutions all the way up to the odd sizes of the 22" wide monitors. Only thing I cannot figure out, is the background image.Currently I have "background:#000000 url('/image location/') no-repeat center center" details calling in my background. It shows up but I have no idea how to make it scale down to the right size relative to the resolution.I'm still relatively new to all this and using html with a splash of CSS styles embedded (ie: <table width="100%" height="100%" style="background:#ffffff url(/image location/') no-repeat center center" border="0"> to call a slightly different backdrop on my table compared to my basic desktop) as it doesn't have to be too big and fancy with as few files as possible.Help would be appreciated.Thanks
×
×
  • Create New...