Jump to content

jazzman1

Staff Alumni
  • Posts

    2,713
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by jazzman1

  1. Take a look at this example, or..... you want to be something else ? <?php $pattern = '/(?<=Replaced )(?=(\w+))/'; $str = 'Replaced disk, Replaced floppy, Replaced memory'; if(preg_match_all($pattern, $str,$matches)){ echo '<pre>'.print_r($matches[1], true).'</pre>'; } else { echo 'No match'; } ?>
  2. Post a link to the script to check something.
  3. I think there is a mime type set up in yahoo -> http://filext.com/faq/office_mime_types.php http://filext.com/file-extension/CSV PS: Could you post a link to the script file to remote server. I want to check something.
  4. Hm....maybe you have a problem with "&" symbol in URL, use &amp html code. What kind of browser do you use ? Try this: <?php error_reporting(-1); ini_set('display_errors', 'On'); $stock_info = file_get_contents("http://stooq.pl/q/l/?s=cl.f&f=sd2t2ohlc&e=csv"); echo $stock_info; PS: I've noticed that, there is a "dot" symbol before csv url in yahoo.com
  5. There is nothing wrong in the ini-file Try this and tell us what happen. <?php error_reporting(-1); ini_set('display_errors', 'On'); $stock_info = file_get_contents("http://stooq.pl/q/l/?s=cl.f&f=sd2t2ohlc&e=csv"); echo $stock_info;
  6. I want to see "PHP Core Part".
  7. Could you give us a php version of you hoster ? Use the phpinfo() function and link to us.
  8. Can you edit php.ini file or it's your hosting provider?
  9. Open up php.ini file, find "allow_url_fopen" and tell me what kind value there is ?
  10. You have misunderstood me because of my EN :'( In both ways, the code woks fine to me: <?php // in a local machine $stock_info = file("cl.f-1.csv"); // to remote server $stock_info = file("http://stooq.pl/q/l/?s=cl.f&f=sd2t2ohlc&e=csv"); // print out result CL.F,2012-07-20,22:59:05,92.5,92.61,90.94,91.59
  11. Everything works fine with "cl.f-1.csv" by me. There is something wrong in your code. What result do you expect to be ?
  12. @ash992, take a look at how to php varible in sql query -> http://forums.mysql.com/read.php?52,144546,144546
  13. Try this: <?php // read the list of stocks from the file. $stock_info = file("cl.f-1.csv"); // count how many stocks there are. $total_stocks = count($stock_info); // go through the list and trim off the newline character. for ($counter = 0; $counter < $total_stocks; $counter++) { $stock_info[$counter] = trim($stock_info[$counter]); } // implode the list into a single variable, put commas in, apply as $to value. $allStocks = implode(",", $stock_info); echo $allStocks;
  14. Take off the single quotes from your query statement: <?php $a = mysql_query("SELECT * FROM Users WHERE Companyname=$Companyname");
  15. http://www.w3schools.com/ <> http://www.w3school.com/
  16. @piyusharora420, you could be use Form-Element-Specific-Methods in cakephp -> http://book.cakephp.org/1.3/en/view/1416/year For example( assuming that the name of the ctp file is called add.ctp) <?php echo $html->script('date.js'); // Include js file?> <?php echo $form->create('ModelName', array('action'=>'add')?> <fieldset> <legend>Add something</legend> <?php echo $form->year('year', 2008, 2016, date('Y'), array('empty' =>'Select year')); echo $form->month('month',null,array('empty'=>'Month')); echo $form->day('day', null, array('empty'=>'Day')) ?> </fieldset> <?php echo $form->end(); ?> After that, you can include a date js file on the top of the page, to modify default values by their id's. Of course, you need to declare "Js" helper method in your controller before use it. http://book.cakephp.org/1.3/en/view/1594/Using-a-specific-Javascript-engine
  17. It was just for example. You could be use js date object or modify monthDays array to every leap-year
  18. You want to be something like this, but in cakephp ? Take a look at my script -> http://canada.lesno.net
  19. @Barand, you're right. Sorry, about the extra post.
  20. Before query statemet ( $q = "INSERT INTO content VALUES (NULL,'$title', '$content', '$date')" ), add the code below and give us a result. <?php $x = array($title, $content, $date); echo '<pre>'.var_dump($x, true). '</pre>';
  21. You could be use js "onkeyup" event to grab the data from message field and send it up to php variable. Take a look this example -> http://www.w3schools.com/ajax/ajax_aspphp.asp jazzman
  22. Try in this wasy: <?php include("connector.php"); mysql_select_db("Table", $con); $sql = "UPDATE Persons SET FirstName='something not on english character' WHERE FirstName='test' AND LastName='test2'"; mysql_query('SET NAMES UTF8'); mysql_query($sql); // Close connection mysql_close($con); ?>
  23. Thank you guys.
  24. Hi guys, few months ago I've started a new project - http://stdimitar.org. The site was deployed and is being hosted by godaddy Economy hosting plan. I've created a php script using a php based mail function to send a mass of e-mails to our subscribers, around 1000 mails a day. My problem is that I don't know how many emails are actually sent to their email accounts. If anybody knows a better way to solve the problem, please tell me. I want to share my script and so sorry for my English. jazzman <?php if (isset($_POST['Submit'])) { $local = $_SERVER['SERVER_NAME']; $subject = $_POST['subject']; // associative array, this data comes from database $headerFields = array('BCC: example_1@example.com,example_2@example.com,example_3@example.com,example_4@example.com,example_5@example.com'); $headers = 'MIME-Version: 1.0' . "\n" . 'Content-type: text/plain; charset=UTF-8' . "\n" . 'Content-Transfer-Encoding: base64' . "\n"; 'X-Priority: 1 (Higuest)' . "\n"; 'X-MSMail-Priority: High' . "\n"; 'Importance: High' . "\n"; $headers .= implode(',', $headerFields)."\n"; $message = ''."\n"; $message .= $_POST['message'] . "\n"; // link to image or church bulletin $message .= 'http://' . $local . '/'. $folder_img.'/'. $filename ."\n"; if(mail(null, '=?UTF-8?B?'.base64_encode($subject).'?=', base64_encode($message), $headers . '')){ echo "Mail has been successfully sent"; exit; } } ?> <!DOCTYPE html> <html> <head> <title>Send a message to subscribers</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <fieldset> <legend><h2>Crop new image and send a message to subscribers</h2></legend> <form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post" enctype="multipart/form-data" accept-charset="utf-8"> <table border="0" width="100%" cellpadding="0" cellspacing="0"> <tr align="left" valign="top"> <th>Title:</th> <td><input type="text" name="subject" value="" /></td> </tr> <tr><td> </td></tr> <tr align="left" valign="top"> <th width="160">Message:</th> <td><textarea row="30" cols="50" name="message"></textarea></td> </tr> <tr><td> </td></tr> <tr align="left" valign="top"> <th>Send image:</th> <td><input type="file" name="fupload" value=""/></td> </tr> <tr><td> </td></tr> </table> <input type="submit" name="Submit" value="Go" /> </form> </fieldset> </body> </html>
×
×
  • 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.