{"id":3295,"date":"2014-03-21T20:23:26","date_gmt":"2014-03-21T20:23:26","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/21\/phpfilefile-uploadphpmailerrelated-issues-collection-of-common-programming-errors\/"},"modified":"2014-03-21T20:23:26","modified_gmt":"2014-03-21T20:23:26","slug":"phpfilefile-uploadphpmailerrelated-issues-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/21\/phpfilefile-uploadphpmailerrelated-issues-collection-of-common-programming-errors\/","title":{"rendered":"php,file,file-upload,phpmailerRelated issues-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e687aeec6465e187c58e900ef09b6a56?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nshin<br \/>\nphp<br \/>\nI have the following array structure in MySQL. There could be no items or many items; the example shows only three.Array ([0] =&gt; Array([id] =&gt; 1&#8230;[start_time] =&gt; 09:00:00[finish_time] =&gt; 10:20:00&#8230;)[1] =&gt; Array([id] =&gt; 2&#8230;[start_time] =&gt; 13:00:00[finish_time] =&gt; 14:20:00&#8230;)[2] =&gt; Array([id] =&gt; 23&#8230;[start_time] =&gt; 18:05:00[finish_time] =&gt; 19:35:00&#8230;)etc etc)I want to add the time difference between start_time and finish_time and find out the total time wi<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1fbb09c05d984fe0c385e7cf124400bb?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nthemerlinproject<br \/>\nphp<br \/>\nLooping through a dynamically-named array and comparing results to the previous positions results.if($s&gt;1 &amp;&amp; $s&lt;=10){if( ${&#8220;strat{$s}&#8221;}[total] &gt; ${&#8220;strat{$s-1}&#8221;}[total] )$sl_best = $sl_mult; \/\/if this one did better than the previous one, then grab the value} And I&#8217;m getting error messages related the the ${&#8220;strat{$s-1}&#8221;}[total], specifically the {$s-1} portion. Here is the error message:Parse error: syntax error, unexpected &#8216;-&#8216;, expecting &#8216;}&#8217; &#8230;Any thoughts on how to check the<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e0507c26d492e96b74a0a087bcb4a3d5?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmoogeek<br \/>\nphp oop class object<br \/>\nHow can I dynamically pass &#8220;items&#8221; to class function? For example here it is a piece of some class and its function where I declare an element of object (items) as $b:\/\/&#8230;&#8230;&#8230;.public function __add2SomeObj($b) { $namespc = $this -&gt; __someObj(); \/\/ __someObj() returns object$namespc -&gt; cats = $b;} \/\/&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.Can I pass any other name instead cats dynamically so it won&#8217;t be declared as a string? i.e. something like:\/\/&#8230;&#8230;&#8230;.public function __add2SomeObj($a,$b) { $namespc<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/eaf01a3b0f700d01dd4cf51311178055?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBrad<br \/>\nphp ubuntu apache2<br \/>\nI have a VM with ubuntu 12.04 and running apache2 as a web server. I&#8217;ve installed PHP 5.3.10 and every time I run a php application, my php.ini throws this error: PHP: syntax error, unexpected BOOL_FALSE in \/etc\/php5\/cli\/php.ini on line 1020I&#8217;d expect that something wasn&#8217;t commented out correctly in the php.ini but when I look at it, I can&#8217;t see what&#8217;s wrong: 1007 [Pcre] 1008 ;PCRE library backtracking limit. 1009 ; http:\/\/php.net\/pcre.backtrack-limit 1010 ;pcre.backtrack_limit=100000 1011 10<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/554224acf304e2205560fa09f1d22345?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\njs111<br \/>\nphp wordpress<br \/>\nI&#8217;m working with a WordPress theme (genesis framework) and i need to input a php snippet into the post meta function (right after post_edit). I cannot seem to get this to work without throwing an error. This is the function I need to work with:add_filter( &#8216;genesis_post_info&#8217;, &#8216;sp_post_info_filter&#8217; ); function sp_post_info_filter($post_info) {$post_info = &#8216;[post_date] by [post_author_posts_link] [post_comments] [post_edit]&#8217;;return $post_info; }And this is the PHP snippet I need to use&lt;?php ech<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/62a2717b4b02fc0a126d7b68d4e2a1bb?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJulibear Police<br \/>\nphp<br \/>\nI have this code below for updating a line on a text file.$filename = &#8220;flat-file-data.txt&#8221;; \/\/ File which holds all data $rowToUpdate = 1; \/\/ This is line need to be updated $newString = &#8220;This text is updated\\n&#8221;; \/\/ This is what you want to replace it with$arrFp = file( $filename ); \/\/ Open the data file as an array \/\/ Replace the current element in array which needs to be updated with new string $arrFp[$rowToUpdate-1] = $newString; $numLines = count( $arrFp ); \/\/ Count the elements in the arra<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0e44cab33882834db488bb6fae1e8a0d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nShawn31313<br \/>\nphp json object<br \/>\nThis question already has an answer here:PHP dynamic name for object property2 answersI basically know how to add a new key value pair to JSON through PHP like:$json-&gt;newObject = &#8220;value&#8221;;What I can&#8217;t however figure out is how to give the key of the pair, a random ID.I&#8217;ve tried something like:$id = rand(99, 9999); $json[&#8220;newObject&#8221; . $id] = &#8220;value&#8221;;With an error of: Fatal error: Cannot use object of type stdClass as array in \/home\/methodjs\/public_html\/projects\/chat\/send.php on line 8And:$id =<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2cb10012e7ca5f591156020bcf969c6a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDuncan<br \/>\nphp arrays pdo<br \/>\nUsing the guidelines suggested by netnuts for the use of Data Objects for Database access, specifically in relation to unnamed placeholders# the data we want to insert $data = array(&#8216;Cathy&#8217;, &#8216;9 Dark and Twisty Road&#8217;, &#8216;Cardiff&#8217;); $STH = $DBH-&gt;(&#8220;INSERT INTO folks (name, addr, city) values (?, ?, ?); $STH-&gt;execute($data);unfortunately seems to produce a parse error for the code# the data we want to insert $data = array($first_name, $second_name, $email_from, $telephone, $dateofbirth, $address<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/819d06def41efa9364316b454e116b5f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ndaNullSet<br \/>\nphp<br \/>\nLook at the code below&lt;?php \/\/The array is storing a blog entry in it $entry = array (&#8216;title&#8217; =&gt; &#8216;sample title&#8217;,&#8217;date&#8217; =&gt; &#8216;August 9, 2011&#8242;,&#8217;author&#8217; =&gt; &#8216;daNullSet&#8217;,&#8217;body&#8217; =&gt; &#8216;I shall become a web developer IA&#8217;,); echo &#8220;The title of the blog is &#8220;.$entry[&#8216;title&#8217;].&#8221;&lt;br \/&gt;&#8221;; ?&gt;The code above executes quite well, but it returns the following parse error when I enclose $entry[&#8216;title&#8217;] in double quotes while concatenating with other strings in echo statement.Parse error: syntax e<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/xBwfL.jpg?s=32&amp;g=1\" \/><br \/>\nFrancisco Presencia<br \/>\nphp class variables assign<br \/>\nHow can I assign multiple variables at once in PHP? This is basically what I&#8217;m trying to achieve but it throws a parsing error on private $from = private $to saying syntax error, unexpected &#8216;private&#8217;:&lt;?php namespace Library;class Localize{\/\/ Default data for both fields. Localization must be specified.private $from = private $to = array(&#8216;language&#8217; =&gt; &#8216;en&#8217;, \/\/ Language: English&#8217;country&#8217; =&gt; &#8216;usa&#8217;, \/\/ Country: USA&#8217;currency&#8217; =&gt; &#8216;dollar&#8217;, \/\/ Currency: dollar $&#8217;units&#8217; =&gt; &#8216;is&#8217;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b94cb43eea11babc4716100967fa44fa?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAdam Liss<br \/>\nc file line<br \/>\nI&#8217;m trying to read a file one line at a time, print out that line, then analyze each character to determine what to do with it (all the analyzing takes place in the driver, mark it as an error if the character is anything except a letter or number)My current input file is:Hello$ is asdSo this is what I am doing to read one line at a time:char GetSourceChar() {char line[MAXLINE];if (changeLine == 1) {if (fgets(line, sizeof line, file) != NULL) {char str1[10];sprintf(str1,&#8221;%d&#8221;, row); \/\/ convert in<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/7d0d66b076e3bc70819e50f8a25af8df?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJonathan Leffler<br \/>\nc file pointers struct<br \/>\nI would like to store a struct in a file. I used this code:#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt;typedef struct {int a;short b;char *ch; } wrFile;main() {FILE* fd=fopen(&#8220;Result.txt&#8221;,&#8221;w+&#8221;);wrFile wf={12451,14,&#8221;result&#8221;};fwrite(&amp;wf,sizeof(wrFile),1,fd);fclose(fd); }the resul that I obtained in Result.txt is:\u00a30^@^@^N^@^@^@^Z^G@^@^@^@^@^@The question is why?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/aba2f9a66d9249c819e3ef397c994d05?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDiego Favero<br \/>\nphp file exec ls<br \/>\nI Just wanna to list all files and subdirectories and store this list in file &#8230; in MS-DOS, Linux and MAC OS, the command line &#8212; .ls( or .dir) &gt;&gt; files.txt &#8212; would give me what I want &#8230; But, how to make a php script run it ? if I use (on php)exec (&#8216;ls &gt;&gt; files.txt&#8217;); I will get a error like this: Warning: Unexpected character in input: &#8221; (ASCII=28) state=0 in \/Applications\/XAMPP\/xamppfiles\/htdocs\/DjUtilities\/makeLabels.php on line 29&#8230;please, any idea ???The use of this will be to set la<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c4b8e4c9612ceb322ce8541f381c3716?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nTemplar<br \/>\nphp string file operators<br \/>\nLet&#8217;s say I have file foo.txt in which I have one digit which is 0. Then I read that file and 0 is stored into array. I want to increment number by 1 so I just use shorthand operator ++ but it doesn&#8217;t work however += does.$poo = file(&#8220;foo.txt&#8221;); $poo[0]++; echo $poo; \/\/ gives me 0 $poo[0] += 1; echo $poo; \/\/ gives me 1I know that when I read file value of poo[0] is string with space &#8220;0 &#8221; but why it doesn&#8217;t work with ++?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/93deb8e8a53289e3536217b3db884818?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nEitan T<br \/>\nfile for-loop batch-file copy<br \/>\nLooking for a batch file that would copy a file into multiple folders (within the same directory that the batch file was placed), but not their subfolders.For example: I need K:\\NewCustomers\\NewPartNumber.Bat to go into K:\\NewCustomers\\Customer Name\\ but not any subfolder of \\Customer Name\\, there being 200-300 &#8220;Customer Name&#8221; folders.I was using:for \/R &#8220;K:\\NewCustomers\\&#8221; %%a in (.) do copy &#8220;K:\\NewCustomers\\NewPartNumber.bat&#8221; &#8220;%%a&#8221;But this is recursive, and now that there are folders inside of t<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/d60dc2082f1b58ce24508fb40d852124?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAbs<br \/>\nphp windows file<br \/>\nI open a Microsoft Access file normally and I can see its locked by Micorsoft Office. I then attempt to check if its writeable with PHP:echo &#8216;|&#8211;&gt; &#8216;.is_writeable(&#8216;C:\\wamp\\www\\Database1.accdb&#8217;);But it returns a 1. Surley, it should return a 0 when open?Just to test, I then attempt to write to it:$fh = fopen(&#8216;C:\\wamp\\www\\Database1.accdb&#8217;, &#8216;w+&#8217;);fwrite($fh, &#8216;hello&#8217;);It lets me do so! Is there anyway I can make sure if a file is not open by another program?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/fc763c6ff6c160ddad05741e87e517b6?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBill the Lizard<br \/>\nfile interprocess<br \/>\nI was recently downvoted (which only bugged me a little \ud83d\ude42 ) for an answer I gave to this question. The person offered no explanation for the down vote which started me thinking: &#8220;Why would you avoid producing intermediate files?&#8221; Especially in a language like Python where File IO is laughably easy.There seemed to be consensus that it was a bad idea, but I know for a fact that intermediate files are used regularly in practice. I worked for a very well respected research firm (let&#8217;s just say S<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/66a4a3e5b6a8ba8e22c36966f4c5f7b3?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJhon Woodwrick<br \/>\nphp file directory<br \/>\nwhat im trying to do here, get the current file and then upload it,find the extension of the file and rename it! and echo the result!! but it seems wrong, and i dnt know which part!! :(($fieldname = $_REQUEST[&#8216;fieldname&#8217;];$uploaddir = &#8216;uploads\/&#8217;;$uploadfile = $uploaddir . basename($_FILES[$fieldname][&#8216;name&#8217;]);if (move_uploaded_file($_FILES[$fieldname][&#8216;tmp_name&#8217;], $uploadfile)) {\/\/find the extension$extension= pathinfo($uploadfile);\/\/rename the filerename ($uploadfile, &#8220;newfile.&#8221;.$extenion[&#8216;exte<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e77327f7ef0c6213525de4dcea19b200?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nTIMEX<br \/>\npython linux file unix<br \/>\nimport time import traceback import sys import tools from BeautifulSoup import BeautifulSoupf = open(&#8220;randomwords.txt&#8221;,&#8221;w&#8221;) while 1:try:page = tools.download(&#8220;http:\/\/wordnik.com\/random&#8221;)soup = BeautifulSoup(page)si = soup.find(&#8220;h1&#8221;)w = si.stringprint wf.write(w)f.write(&#8220;\\n&#8221;)time.sleep(3)except:traceback.print_exc()continuef.close()It prints just fine. It just won&#8217;t write to the file. It&#8217;s 0 bytes.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/25b02331ea03bb3408ed04bfa4a885af?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nTim<br \/>\nc# file<br \/>\nI try to write a console app C# to move my etxt files to another folder. The functions just copies certain .txt files from folder A to folder AAstring source = &#8220;C:\\\\A\\\\ResultClassA.txt&#8221;; File.Move(Source, &#8220;C:\\\\AA&#8221;);But its always giving this error message:Access to the path is denied.Troubleshooting tips: Make sure you have sufficient privileges to access this resource. If you are attempting to access a file, make sure it is not ReadOnly. Get general help for this exception.Do i really need to<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f1276375045749262988772b09ff625d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nUnit 342<br \/>\nphp file-upload<br \/>\nI have a PHP app that requires semi-frequent code updates. What I do now is that I bring down the app for maintenance whenever I have to upload new scripts, effectively turning the app off for all users except myself.If I don&#8217;t do this I always see a lot of &#8220;unexpected $end&#8221; error messages in the logs, as PHP tries to interpret half-uploaded scripts. Which I of course want to avoid.My question is: Is there a safe way of doing this without bringing the app down for maintenance? In an environment<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/graph.facebook.com\/503055122\/picture?type=large\" \/><br \/>\nSaeid Ghaferi<br \/>\nphp jquery-ui file-upload blueimp<br \/>\nI&#8217;ve set up the jQuery File Upload &#8211; blueimp on my local server and everything works great! I uploaded the script onto my server and when I upload images I recieve this error SyntaxError: Unexpected token &lt;my files are uploaded, both the originals and the thumbnails, but for some reason it wont show the files that are uploaded. Please help Thank you<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/acfb059457d47b1086189cddb2f3857c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nIgoru<br \/>\najax ruby-on-rails-3 file-upload<br \/>\nI&#8217;m using qqfileupload (http:\/\/valums.com\/ajax-upload\/) to create a single drag &amp; drop image upload interface. The request is being sent to rails, and my rails console is returning!! Unexpected error while processing request: invalid %-encoding (????JFIFdd??Ducky??Adobed)which I assume is rails attempting to read the file.I set my controller to outputreturn render :text =&gt; paramsthinking that I could look at what the server was recieving, but I only get the Unexpected error again, which to m<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/89841cf57849bbe957c155d3d68252f6?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJason<br \/>\nc# csv file-upload .net-4.0 webclient<br \/>\nI am attempting to upload a csv file but I can&#8217;t seem to get it to work programatically. If I use Postman in Chrome to send the file it works and here is what it sends (Fiddler output):&#8212;&#8212;WebKitFormBoundary2YsMyLR3QAPruTy4 Content-Disposition: form-data; name=&#8221;Content-Type&#8221;; filename=&#8221;613022.csv&#8221; Content-Type: application\/vnd.ms-excel\/\/ File Content here&#8212;&#8212;WebKitFormBoundary2YsMyLR3QAPruTy4&#8211;However, using this code:WebClient wc = new WebClient();wc.Credentials = new NetworkCredential(use<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/871a22a93b3c93d0abea42e5827bc6d1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAditya Mohan<br \/>\nphp mysql database file-upload<br \/>\ni am trying to insert data in a &#8216;songs&#8217; column of a table with name same as the current session variable username. but it is giving following errorParse error: syntax error, unexpected &#8216;&#8221;&#8216;, expecting T_STRING or T_VARIABLE or T_NUM_STRINGmysql_query(&#8220;INSERT INTO &#8220;.$_SESSION[&#8216;username&#8217;].&#8221;(&#8216;songs&#8217;) VALUES(\\&#8221;$_FILES[&#8220;file&#8221;][&#8220;name&#8221;]\\&#8221;)&#8221;);<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/lyp2e.png?s=32&amp;g=1\" \/><br \/>\n???n B?rtiL<br \/>\nandroid file file-upload cordova file-transfer<br \/>\nI am using phonegap to upload file to a server. I am making android app which takes picture and send to server. I am getting error &#8220;Response Parse error syntax error, unexpected T_STRING in this line&#8221; I am also pasting the code this is my phonegap code.navigator.camera.getPicture( cameraSuccess, cameraError, {quality : 75,destinationType : Camera.DestinationType.FILE_URI,sourceType : Camera.PictureSourceType.PHOTOLIBRARY,mediaType: navigator.camera.MediaType.ALLMEDIA,allowEdit : true,targetWid<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/3d4eaaf1310f06330c0515e3d7fedba8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nPravin<br \/>\nobjective-c file-upload asp.net-web-api<br \/>\nI have following ASP.net WebAPI code which handles file uploads. Works great using a simple HTML file upload form.public Task&lt;IEnumerable&lt;string&gt;&gt; UploadFile() {if (Request.Content.IsMimeMultipartContent()){string fullPath = HttpContext.Current.Server.MapPath(&#8220;~\/uploads&#8221;);MultipartFormDataStreamProvider streamProvider = new MultipartFormDataStreamProvider(fullPath);var task = Request.Content.ReadAsMultipartAsync(streamProvider).ContinueWith(t =&gt;{if (t.IsFaulted || t.IsCanceled<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b9da2ca6abf3a1e28fb470f2b3ae2c34?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nabatishchev<br \/>\nc# wcf file-upload exception-handling<br \/>\nMy server config file:&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt; &lt;configuration&gt;&lt;system.webServer&gt;&lt;security&gt;&lt;requestFiltering&gt;&lt;requestLimits maxAllowedContentLength=&#8221;500000000&#8243;&gt;&lt;\/requestLimits&gt;&lt;\/requestFiltering&gt;&lt;\/security&gt;&lt;\/system.webServer&gt;&lt;system.serviceModel&gt;&lt;bindings&gt;&lt;basicHttpBinding&gt;&lt;binding name=&#8221;HttpEndpointBinding&#8221; receiveTimeout=&#8221;00:10:30&#8243; maxBufferPoolSize=&#8221;2147483647&#8243; maxReceivedMessageSize=&#8221;2147483647&#8243; max<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1b95a41e4faa85e3aa38e44473fc98d2?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\njpo<br \/>\nasp.net file-upload web-config app-config endpoint<br \/>\nThere are a number of post already out there but I cannot get this to work. The posts suggest to define the tags endpoints and binding both client side and server side. All I have is the applications web.config file. How do I make the distinction between client side and server side. In my web.config, i defined a services tag, but it seems as if it is not used as the face binding configurations defined in there is never called out when debugging. My web.config looks like this:&lt;?xml version=&#8221;1.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/884a795250ab6d23ae2bf052ba831610?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nLoki<br \/>\nphp jquery file-upload<br \/>\nI want use prduct but when upload image i see error SyntaxError: JSON.parse: unexpected non-whitespace character after JSON datascript directory: Folder2 directory Jquery-file-upload: function\/blueimp-jQuery-File-Upload\/ in main.js i edit rows$(&#8216;#fileupload&#8217;).fileupload({ \/\/ Uncomment the following to send cross-domain cookies: \/\/xhrFields: {withCredentials: true}, url: &#8216;server\/php\/&#8217; });on$(&#8216;#fileupload&#8217;).fileupload({ \/\/ Uncomment the following to send cross-domain cookies: \/\/xhrFields: {withCre<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/WhSyn.jpg?s=32&amp;g=1\" \/><br \/>\nKatie<br \/>\nforms phpmailer comments<br \/>\nI have a site that is hosted on inmotion hosting and requires a phpMailer in order to send an email form (such as a contact form) from a site. I&#8217;ve put the necessary files and code on the contact page, but I am getting a parse error once I hit submit. Here&#8217;s the error message:Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or &#8216;}&#8217; in \/home\/username\/public_html\/phpmailer\/class.phpmailer.php on line 53Line 53 according to DreamWeaver is public $Prio<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/241b7939150146969d15d7d48fc0bb3d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDarsshan Nair<br \/>\nphp html html-email phpmailer swiftmailer<br \/>\n$transport = Swift_SmtpTransport::newInstance(&#8216;smtp.gmail.com&#8217;, 465, &#8220;ssl&#8221;)-&gt;setUsername(&#8216;username&#8217;)-&gt;setPassword(&#8216;password&#8217;);$username = $_SESSION[&#8216;username&#8217;]; $from = $_POST[&#8216;from&#8217;];$to = $_POST[&#8216;to&#8217;];$subject = $_POST[&#8216;subject&#8217;];$body = $_POST[&#8216;message&#8217;];$message = Swift_Message::newInstance($subject)-&gt;setFrom(array($from =&gt; $username)) -&gt;setTo(array($to)) -&gt;setBody($body);$mailer = Swift_Mailer::newInstance($transport); $result = $mailer-&gt;send($message);Error on Webpag<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ba84eb0a0e332197163f4e431d84144a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJason George<br \/>\nphp try-catch phpmailer<br \/>\nI have a mailer script that is looping, processing outgoing emails from my server. Occasionally it hangs up with the following error.PHP Fatal error: Uncaught exception &#8216;phpmailerException&#8217; with message &#8216;SMTP Error: Data not accepted.&#8217;This causes my script to die before the reminder of the messages can complete.Here is the code that kicks off the email.$message = new \\PHPMailer(true); $message -&gt; IsSMTP(); try {$message -&gt; SMTPAuth = true;$message -&gt; Host = Config::HOST;$message -&gt; Port = Conf<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f8f3db32ac21fcbc85c5464079a87c2b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmatino<br \/>\nphp email phpmailer<br \/>\nI&#8217;m trying to create a contact form using phpMailer and I get in firebug this: NetworkError: 500 Internal Server Error &#8211; path\/process.php uncaught exception: [object Object]each time I&#8217;m trying to run the code below. Please note that the error is not shown anymore if I remove $mail-&gt;AddAddress line, that&#8217;s why I suspect this line to be the cause. Instead a new error is displayed: You must provide at least one recipient email address when I remove it.&lt;?php $name = $_POST[&#8216;firstName&#8217;]; $ema<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b6116ac3c4b5835c6745570ea73a85c1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nCharles<br \/>\nphp phpmailer<br \/>\nI am getting the error Fatal error: Uncaught exception &#8216;phpmailerException&#8217; with message &#8216;Invalid address: &#8216; etc. etc. etc. and it is a real eye sore on the page.So I want to capture the error or suppress it or something &#8211; and then have it be returned to the form so the user can be told there is an error and to re-input their email address. All this will be neat and tidy and not the mess of an error it is now.Does anyone know how to do this?Thanks<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/7e2ec587a7079672873f3410692a4f8e?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAlfabravo<br \/>\nphp phpmailer<br \/>\nIm new to classes and im trying to create a static email class that uses the phpmailer class.What I&#8217;d like to do is something like&#8230;Email::send(&#8216;from&#8217;, &#8216;to&#8217;, &#8216;subject&#8217;, &#8216;html message&#8217;); \/\/ worksbut if i want to add an attachment&#8230;Email::send(&#8216;from&#8217;, &#8216;to&#8217;, &#8216;subject&#8217;, &#8216;html message&#8217;)-&gt;attach(&#8216;file\/blah.txt&#8217;);This throws a fatal error: Call to undefined method PHPMailer::attach(), I understand why, I just don&#8217;t know how to go about it making the Email class do the above code, if it&#8217;s even poss<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6510cbcead4d65156069f2f8f9452680?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJonah Katz<br \/>\nphp phpmailer email-attachments<br \/>\nIve been working on create a file upload form using PHPmailer to send as attachments. Ive finally got it to send the email, but its not sending the attachment. Here&#8217;s my HTML form:&lt;input type=&#8221;file&#8221; class=&#8221;fileupload&#8221; name=&#8221;images[]&#8221; size=&#8221;80&#8243; \/&gt;And here&#8217;s my php processor code:&lt;?php require(&#8220;css\/class.phpmailer.php&#8221;); \/\/Variables Declaration $name = &#8220;the Submitter&#8221;; $email_subject = &#8220;Images Attachment&#8221;; $Email_msg =&#8221;A visitor submitted the following :\\n&#8221;; $Email_to = &#8220;jonahkatz@yahoo.c<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ca2f7d5d2e329671cf8e05d7fcdb51c5?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nhooligan<br \/>\nphp phpmailer<br \/>\nI&#8217;ve just updated a contact form to use PHPMailer to stop emails being marked as junk, with no luck. It&#8217;s a fairly straight forward setup I&#8217;m using but its still going into peoples junk mail.Here is my script, I was wondering if anyone could tell what was wrong?include_once(&#8216;..\/inc\/phpmailer\/class.phpmailer.php&#8217;);$mail = new PHPMailer();$name = $_POST[&#8216;name&#8217;]; $email = $_POST[&#8217;email&#8217;]; $body = &#8220;Name: &#8220;.$name.&#8221;\\r\\n&#8221;; $body .= &#8220;Email: &#8220;.$email.&#8221;\\r\\n&#8221;; $body .= &#8220;Message: &#8220;.$_POST[&#8216;message&#8217;];$mail-&amp;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6510cbcead4d65156069f2f8f9452680?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJonah Katz<br \/>\nphp file file-upload phpmailer<br \/>\nI have an HTML \/ javascript form written with a loop to upload an unlimited amount of files with names=&#8221;file1&#8243;,&#8221;file2&#8243;,etc. (i++)So now i have a PHP form to process it (get all files, save to temporary folder &#8220;uploads&#8221;, and email as attachments using phpmailer). &lt;?php require(&#8220;class.phpmailer.php&#8221;); \/\/Variables Declaration $name = &#8220;the Submitter&#8221;; $email_subject = &#8220;Images Attachment&#8221;; $Email_msg =&#8221;A visitor submitted the following :\\n&#8221;; $Email_to = &#8220;you@yourSite.com&#8221;; \/\/ the one that recieves<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/884e48ac8045ffd8873a46a15fb97c3e?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nGatura<br \/>\nphp phpmailer<br \/>\nam getting these errors while running php mailer. What could be the problemMAMP\/htdocs\/practice\/email\/email.php on line 2 [06-Jun-2011 09:53:40] PHP Notice: Undefined variable: from in \/Applications\/MAMP\/htdocs\/practice\/phpmailer\/phpmailer.inc.php on line 259 [06-Jun-2011 09:53:40] PHP Notice: Undefined variable: Encoding in \/Applications\/MAMP\/htdocs\/practice\/phpmailer\/phpmailer.inc.php on line 271 [06-Jun-2011 09:53:40] PHP Fatal error: Cannot access empty property in \/Applications\/MAMP\/<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>shin php I have the following array structure in MySQL. There could be no items or many items; the example shows only three.Array ([0] =&gt; Array([id] =&gt; 1&#8230;[start_time] =&gt; 09:00:00[finish_time] =&gt; 10:20:00&#8230;)[1] =&gt; Array([id] =&gt; 2&#8230;[start_time] =&gt; 13:00:00[finish_time] =&gt; 14:20:00&#8230;)[2] =&gt; Array([id] =&gt; 23&#8230;[start_time] =&gt; 18:05:00[finish_time] =&gt; 19:35:00&#8230;)etc etc)I want to add the time difference [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3295","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3295"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3295\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}