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. my road
  2. my truck game --- help
  3. opening microsoft word document and microsoft powerpoint slides
  4. My Director has no Text Field
  5. Toggle Sound On/Off for AVI Video
  6. Keyboard Input Fails to Trigger Handlers
  7. Center Movie In A Window
  8. Microsoft Word Web Browser v1.0
  9. Sine Graph Function
  10. The coloured problems
  11. A Little fix or two
  12. Sine Reverse
  13. Repeatedly replacing Director bitmap
  14. Japanese characters in Director MX
  15. k-director.com: Post Updates
  16. A blog about Adobe Director
  17. Centerstage
  18. Custom Cursor...Why It Does Not Work?
  19. Director Game!
  20. cross platform
  21. database xtra for both mac and windows
  22. from windows to MAC
  23. SLIDER POSITION...
  24. Bullet points in text member
  25. Any VideoOut plugin / xtras for director mx ??
  26. Activex component install
  27. quiz
  28. how to export embedded flash swf?
  29. A BIG PROBLEM...
  30. Spining a model on a touchscreen
  31. 3D Fountain trail to avoid the Cursor
  32. HTTP
  33. SHOCKWAVE VIDEO
  34. Deleting Lines Comparing Time...I Have No Idea...
  35. Property not found error
  36. SHOCKWAVE PROBLEM
  37. PROBLEM SHOCKWAVE
  38. text field focus
  39. ExitLock CloseRequest Quit Close Gadget
  40. convert read only
  41. F10 Key Code Does Not Work
  42. Director Game Development Survey
  43. baPrintFile()
  44. How do check if a printer is printing??

Useful Links

Google Translate
AltaVista Translate
Google Glossary

Google
Web www.domaj.com

EZ BAS Easy BAS.

Save hours of work on your Business Activity Statement using this simple, quick and efficient product.