Jump to content

devofash

Members
  • Posts

    81
  • Joined

  • Last visited

    Never

Everything posted by devofash

  1. Thanks. Point noted. But I'm filling in for someone and don't really want to change too much of their code.
  2. Hi, Could really do with some help. So I've got a Multidimensional array like so Array ( [Asia] => Array ( [0] => China [1] => Japan ) [Europe] => Array ( [0] => France [1] => Germany [2] => Spain [3] => UK ) ) I have a Mysql table (continents pre-filled) Continent - Country Asia Europe I need to update country where continent is xxx So I need a query/php function which will when run would fill in "china, japan" into "asia" and "france, germany, spain, uk" into "europe", like so Continent - Country Asia - China, Japan Europe - France, Germany, Spain, UK I don't really know where to start so I don't have a code. Would really appreciate some assistance.
  3. could really do with some help guys.
  4. Use client-side javascript to countdown and then redirect to a php script once the timer is up.
  5. please give more info on what you are trying to do
  6. Look into JOINs http://www.w3schools.com/sql/sql_join.asp
  7. put the below line outside the function. echo get_url_contents($url);
  8. Have you got curl enabled? If yes, I cant see you calling the function in the your script. Are you calling it?
  9. via xml and converting the xml to an array using the function available here http://www.bin-co.com/php/scripts/xml2array/
  10. Hi Guys, Could do with some help if possible. I've got an array of data and I need to paginate it. I'm not that good with arrays / pagination. Sorry I don't have any php code, coz I don't know where to start. The pagination doesn't have to be complex just a simple Next/Previous link will do and then i'll try to add the 1,2,3,4 pages in by myself. Any help is much appreciated. Thanks in advance. Array ( [Company] => Array ( [Employers] => Array ( [0] => Array ( [Name] => Array ( [value] => Person 1 ) [Email] => Array ( [value] => person1@company.com ) ) [1] => Array ( [Name] => Array ( [value] => Person 2 ) [Email] => Array ( [value] => person2@company.com ) ) [2] => Array ( [Name] => Array ( [value] => Person 3 ) [Email] => Array ( [value] => person3@company.com ) ) ) ) )
  11. oooh.... i changed the data type to mediumblob and it works =) but didn't work when i did it with blob why ?? anyways awesome ... thanks for your help PFMaBiSmAd
  12. hmm it works on smaller files so for example if i upload a logo 100x100 it works perfectly. checked the filecontent with strlen and it shows as 65535 even though the filesize in the database 347715 i've basically followed the steps from the tutorial http://www.php-mysql-tutorial.com/wikis/mysql-tutorials/uploading-files-to-mysql-database.aspx
  13. By corrupted I mean it cuts it off half way so for example if I upload an image 600px by 900px it displays say the first 100px of the file and the rest is greyed. The original filesize is in this case 339 KB and when I download it's 63.9 KB. In the database its 339KB. I've checked the database it stores the stuff as binary. I've opened it via PSPad and I see lots of binary stuff.
  14. its off, what can I do now? magic_quotes_gpc Off Off magic_quotes_runtime Off Off
  15. Hi Guys, Got a small issue. Am trying to upload files to mysql database. Works perfectly. Except for one small problem when downloading the image files are corrupted. Was wondering if someone could help me fix this. I have to have to store them in the database unfortunately. the field type is blob and have also tried text but same problems //upload.php if($_FILES['logo']['size'] > 0) { $filename = cleanFilename($_FILES['logo']['name']); $tempname = $_FILES['logo']['tmp_name']; $filesize = $_FILES['logo']['size']; $filetype = $_FILES['logo']['type']; $fp = fopen($tempname, 'r'); $content = fread($fp, filesize($tempname)); $filecontent = addslashes($content); fclose($fp); } // insert statement //download.php //sql statement .... $filename = $row['filename']; $filetype = $row['filetype']; $filesize = $row['filesize']; $filecontent = $row['filecontent']; header("Content-type:$filetype"); header("Content-length:$filesize"); header("Content-Disposition:attachment;filename=$filename"); echo $filecontent; exit(); PDF files work its just the image files that get corrupted. much appreciate the assistance.
  16. Its got all that, I just removed all that stuff just to keep the focus on the main script. I still don't understand why it sends out duplicate emails when I use it with 200 emails. I don't want to spam my clients again. Is there a feature in PHPMailer where I test it with my list ... without actually sending it out to my clients?
  17. Hi thanks for that. Here's the thing, whilst in testing i'm using about 4/5 emails addresses (don't want to spam the clients) and the script works perfectly with my code. But as soon as I try it with live data its screwes up. Is there anything wrong with my foreach loop?
  18. Hi Thanks you for the reply. The list is clean, no duplicates Yes I'm receiving a few copies too.
  19. Hi Guys, Need some help. I'm using phpmailer (for php4) i'm reading a textfile with about 200 email addresses and i'm sending 20 emails every 5 seconds. Works perfectly. But got a major problem, a lot of clients have comeback to me and said that they've received the same copy multiple times. I can't figure out why its doing this can someone please help me resolve this ?? Many thanks. <?php error_reporting(0); set_time_limit(0); include_once('phpmailer/class.phpmailer.php'); $body = 'This is a test'; $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = ""; $mail->From = "Me"; $mail->FromName = "FromName"; $mail->Subject = "Subject"; $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; $mail->MsgHTML($body); $myFile = "listmanagement/uploads/34_250210_1267104673.txt"; $data = file("$myFile"); foreach($data as $value) { $v = trim($value); $emails .= "$v,"; } $email_addrs = explode(",", $emails); $throttle = 20; $i = 0; // Now, run a loop through all the email addresses in the mailing list. foreach($email_addrs as $email_addr) { if ($i % $throttle == 0) { sleep(5); } $mail->AddBCC($email_addr); $mail->Send(); $mail->ClearBCCs(); $i++; } $mail->AddAddress("me@me.com", "Company"); if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message sent!"; } ?>
  20. Hi Guys I am using phpexcelreader to read excel files and displaying records as html http://sourceforge.net/projects/phpexcelreader/ It works all fine but what I want to do is search through that excel and display a particluar record. for example I want the details of a person with acc id 65. Here is my code: ExcelRead.php <html> <head> <style type="text/css"> table { border-collapse: collapse; } td { border: 1px solid black; padding: 0 0.5em; } </style> </head> <body> <table> <?php // include class file include 'Excel/reader.php'; // initialize reader object $excel = new Spreadsheet_Excel_Reader(); // read spreadsheet data $excel->read('book1.xls'); // iterate over spreadsheet cells and print as HTML table $x=1; while($x<=$excel->sheets[0]['numRows']) { echo "\t<tr>\n"; $y=1; while($y<=$excel->sheets[0]['numCols']) { $cell = isset($excel->sheets[0]['cells'][$x][$y]) ? $excel->sheets[0]['cells'][$x][$y] : ''; echo "\t\t<td>$cell</td>\n"; $y++; } echo "\t</tr>\n"; $x++; } ?> </table> </body> </html> book1.xls Acc No First Middle Last Email 123 Person 1 Middle name 1 Last name 1 email 1 32 Person 2 Middle name 2 Last name 2 email 2 445 Person 3 Middle name 3 Last name 3 email 3 65 Person 4 Middle name 4 Last name 4 email 4 I would really appreciate any help. Thanks
  21. any ideas guys ?? could really do with some help.
×
×
  • 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.