php file_get_contents()

  • florilamaj203
  • Born
  • Born
  • florilamaj203
  • Posts: 1

Post 3+ Months Ago

Hello everyone i have a problem with the
PHP Code: [ Select ]
file_get_contents()
I'm trying to send an automatic email from my webpage. Practically i want to send an email to specific persons the content of a table in my page but this table is full of php code witch take values from db, so when i send the mail it arrives but with no php value and no css effect, it shows the table and the php code of the page.

Can you help me with this
Thank you
  • ScottG
  • Proficient
  • Proficient
  • ScottG
  • Posts: 477

Post 3+ Months Ago

I don't think file_get_contents will work or the right command for the task you are trying to do.

To clarify you want to send an email to some people of a table that is dynamically filled with PHP?

Try to use a fullpath to get the info you are wanting
PHP Code: [ Select ]
file_get_contents('http://somewebsite.com/page_that_has_table.php');


If that doesn't work try doing a curl to get the info

PHP Code: [ Select ]
<?php
// create curl resource
$ch = curl_init();
 
// set url
curl_setopt($ch, CURLOPT_URL, "example.com");
 
//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 
// $output contains the output string
$output = curl_exec($ch);
 
// close curl resource to free up system resources
curl_close($ch);    
?>
 
  1. <?php
  2. // create curl resource
  3. $ch = curl_init();
  4.  
  5. // set url
  6. curl_setopt($ch, CURLOPT_URL, "example.com");
  7.  
  8. //return the transfer as a string
  9. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  10.  
  11. // $output contains the output string
  12. $output = curl_exec($ch);
  13.  
  14. // close curl resource to free up system resources
  15. curl_close($ch);    
  16. ?>
  17.  

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 72 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.