Jump to content

Nodral

Members
  • Posts

    397
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    UK

Nodral's Achievements

Regular Member

Regular Member (3/5)

1

Reputation

  1. Morning All I'm in the process of creating an email app, and I'm having an issue extracting anything useful from a certain email. 99.99% of emails received work absolutely fine, however I cannot get any content from one. The structure returned from $structure = imap_fetchstructure($MailboxConnection, $email_number, 0); is object(stdClass)#5 (11) { ["type"]=> int(1) ["encoding"]=> int(0) ["ifsubtype"]=> int(1) ["subtype"]=> string(5) "MIXED" ["ifdescription"]=> int(0) ["ifid"]=> int(0) ["ifdisposition"]=> int(0) ["ifdparameters"]=> int(0) ["ifparameters"]=> int(1) ["parameters"]=> array(1) { [0]=> object(stdClass)#6 (2) { ["attribute"]=> string( "boundary" ["value"]=> string(33) "--_com.android.email_313497894392" } } ["parts"]=> array(1) { [0]=> object(stdClass)#7 (12) { ["type"]=> int(0) ["encoding"]=> int(3) ["ifsubtype"]=> int(1) ["subtype"]=> string(4) "HTML" ["ifdescription"]=> int(0) ["ifid"]=> int(0) ["lines"]=> int(26) ["bytes"]=> int(2068) ["ifdisposition"]=> int(0) ["ifdparameters"]=> int(0) ["ifparameters"]=> int(1) ["parameters"]=> array(1) { [0]=> object(stdClass)#8 (2) { ["attribute"]=> string(7) "charset" ["value"]=> string(5) "utf-8" } } } }} Which part should I extract with $data = imap_fetchbody($MailboxConnection, $email_number, '????'); Been on this for a while now, and getting nowhere fast so any help would be greatly appreciated. I've read the documentation, but it doesn't go into detail of identifying what part can be identified and extracted from the stucture information.
  2. Hi All I have a screen which opens a jquery modal window (from jquery ui). This contains a div, which I need to populate via ajax. I have a fully working ajax function and can see the data being returned from the server. However I cannot get this to go into a div on the modal window. Any thoughts? I thought maybe it was running the ajax prior to the modal window opening and therefore cannot find the div to populate. I've tried alsorts, but cannot get this to work. Any ideas guys? $("#manualDialog").dialog({ resizable: false, autoOpen:false, modal: true, width:1000, height:800, open: function(){ getImages(worktype,'manualimages'); //function for getting the data from ajax }, buttons: { 'Continue': function() { $(this).dialog('close'); var plaincontentlength=0; var htmlcontentlength=0 var defContent=$('#manualdefaultemailplain').val(); var defHTMLContent=$('#manualdefaultemailhtml').val(); var htmlcontent=$('#manualhtmlinput').val(); var plaincontent=$('#manualplaininput').val(); if(defContent==0){ plaincontentlength=plaincontent.length; $('#manualplainsubmit').val(plaincontent); }else{ $('#manualplainsubmit').val(''); } if(defHTMLContent==0){ $('#manualhtmlsubmit').val(htmlcontent); htmlcontentlength=htmlcontent.length; }else{ $('#manualhtmlsubmit').val(''); } var overridelength=plaincontentlength+htmlcontentlength; if(overridelength >0){ $('#manualyes').show(); $('#manualno').hide(); }else{ $('#manualyes').hide(); $('#manualno').show(); } } }//end buttons });//end dialog function getImages(worktype,div){ ajaxGet('worktypes.php?ajax=yes&worktype='+worktype,getImageCallback) } function getImageCallback(result){ $('#manualimages').html(result); }
  3. You may want to check your spelling of the function in this line too Childish I know, but made me chuckle
  4. Check that your mysql server hasn't set up an anonymous user (''@localhost). This had me flumoxxed for ages.
  5. Nodral

    Hello

    mysql_affected_rows returns nothing on a select as nothing is 'affected' / changed. You want mysql_num_rows as this is the amount of rows returned by the previous sql statement. Try this $this->query = "SELECT hexnum FROM $this->tablename"; $this->result = mysql_query($this->query); if (mysql_num_rows]() > 0 )
  6. try this $i=1; while($row = sqlsrv_fetch_array( $result,SQLSRV_FETCH_ASSOC)){ if($i=1){ echo "<tr style='background-color:".$color1.">"; $i++; }else{ echo "<tr style='background-color:".$color2.">"; $i=1; } foreach($fields as $key=>$not_used) { echo "<td>$row[$key]</td>"; } echo "</tr>\n"; dirty, but works
  7. Hi All I am trying to read in some emails using the various functions within the PHP/IMAP library and all's going well. UNTIL I have to deal with an 'Alternative' type email. I cannot get the following to seperate the plain text part out. it's almost as if the MIMe boundary's are being ignored. Any thoughts anyone? Cheers
  8. so how would I use mklink to go from to , as the colon is not a valid character within a file path
  9. I have approx 50 sites set up on the server, and each uses one of 3 common config files. Therefore we dyamically change the include path to point at the relevant config file. This is fine for the Linux developer guys, as they can just recreate the file structure on their machines, however I have an issue with the Windows guys as when they copy the files, their include paths break, and I really don't fancy going through everything and changing the include path settings to an 'if' statement. I'd rather just change the php settings on 3 machines if possible. If there's a way to do this, I'd be much appreciative. If not within the php.ini, whether I can do some sort of dynamic redirect solely on the Windows machines (like a symbolic link on linux) without amending the site files.
  10. Can this be referenced in the php.ini as I really don't want to be adding loads of if statements to my files
  11. I am currently installing a subversion protocol within a business, some of the users develop in Windows on local Wamp servers, and others use local Lamp servers. The main site runs on a linux server. The issue I have is setting up the include paths within the php.ini file. As some of the live files change this setting on the fly, this is becoming a pain. The windows machines require a semi colon delimiter in the include paths, and the linux machines require a colon. Is there any way to change the configuration of the windows machines to use a colon as the include path delimiters?
  12. I now have However I am getting error Come on guys, I really need this one!! lol
  13. Hi All I'm a bit of a newbie to regex and am struggling with what seems like the most basic preg_replace. I need to validate numbers and remove anything non-numeric from a string. ie 4.5volts would become 4.5 -67 degrees would be -67 I have this however there can only be one minus and it must be at the start, and there can only be one decimal point. Any help is much appreciated.
  14. Morning all I have 2 multidimentional arrays, where theoretically they can continue to the nth dimension. Is there a way (without using a horrible recursive function) I can iterate through both arrays and only return values where the keys are the same but the values are different?
  15. Hi I have the following multidimensional array. array => [0] ([apples]=>5, [pears]=>3, [bananas]=>6) [1] ([apples]=>2, [pears]=>4, [bananas]=>1) [2] ([apples]=>8, [bananas]=>2) How can I iterate through it and produce one array with all the totals added up? eg array => [apples]=>15, [pears]=>7, [bananas]=>9 I've tried googling , but can't seem to find the right thing. Obviously these are example values, the arrays I'm using contain about 40 keys each, therefore this was easier to write / explain.
×
×
  • 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.