HOME  FORUM  LINKS

Site Menu

Development

Director

Hosting Support

Quick Links

PHP

Some PHP snippets and applications supporting hosting functions in the CPANEL/WHM environment

AddEmail.PHP

Download

* For the php file (Right-click and save) http://www.domaj.com/files/addemail.tar.gz

ADDEMAIL.PHP V1.0

<pre>
<?php
/*
    Simple example of creating a pop account using a PHP script
      Tony Domigan tony@domaj.com http://www.domaj.com Oct03
*/

// Domain Logon Details
$username="xxxxx";
$password="xxxxx";

// Domain details
$domain="www.xxxxx.com";
$theme="xxxxx";//eg "fantastico_bluelagoon";

// Parameters to parse
$eEmail="xxxxx";
$eDomain="xxxxx.com";
$ePassword="xxxxxx";
$eQuota="xx"; // eg"10";

// Put post fields variable together
$postfields = "email=$eEmail&domain=$eDomain&password=$ePassword&quota=$eQuota";

// initialise Curl
$popPost = curl_init();

// Set Curl Option: URL
$url="http://$domain:2082/frontend/$theme/mail/doaddpop.html";
curl_setopt($popPost, CURLOPT_URL, $url);

// Set Curl Option: Username:Password
curl_setopt($popPost, CURLOPT_USERPWD, "$username:$password");

// Set Curl Option: Post style request = true
curl_setopt($popPost, CURLOPT_POST, 1);

// Set Curl Option: Collect result from script
curl_setopt($popPost, CURLOPT_RETURNTRANSFER, 1);

// Set Curl Option: Set timeout to 15 seconds
curl_setopt($popPost, CURLOPT_TIMEOUT, 15);

// Set Curl Option: Post data
curl_setopt($popPost, CURLOPT_POSTFIELDS, $postfields);

// Execute Request, and store result in $tb_post
$popPost_result = curl_exec ($popPost);

// Close Curl
curl_close ($popPost);

//output results
$start = strpos($popPost_result,'<b>Account');
$end = strpos($popPost_result,'created.');
$subset=substr($popPost_result,$start,$end+8-$start);
$subset=str_replace('login ',"login<br>",$subset); //for neatness
$subset=str_replace("<!",'<-',$subset); //see the comments
print($subset);
?>
</pre>

Recent Topics

The latest topics from the forum.

  1. k-director.com: Post Updates
  2. A blog about Adobe Director
  3. Centerstage
  4. Custom Cursor...Why It Does Not Work?
  5. Director Game!
  6. cross platform
  7. database xtra for both mac and windows
  8. from windows to MAC
  9. SLIDER POSITION...
  10. Bullet points in text member
  11. Any VideoOut plugin / xtras for director mx ??
  12. Activex component install
  13. quiz
  14. how to export embedded flash swf?
  15. A BIG PROBLEM...
  16. Spining a model on a touchscreen
  17. 3D Fountain trail to avoid the Cursor
  18. HTTP
  19. SHOCKWAVE VIDEO
  20. Deleting Lines Comparing Time...I Have No Idea...
  21. Property not found error
  22. SHOCKWAVE PROBLEM
  23. PROBLEM SHOCKWAVE
  24. text field focus
  25. ExitLock CloseRequest Quit Close Gadget
  26. convert read only
  27. F10 Key Code Does Not Work
  28. Director Game Development Survey
  29. baPrintFile()
  30. How do check if a printer is printing??

Useful Links

Google Translate
AltaVista Translate
Google Glossary

Google
Web www.domaj.com