I have a forum, and when someone registers I want them to get a subdomain directed to their profile in the format username.mydomain.com. I figured out that all I needed to do was visit two pages on my cpanel so I did
(cPanel username, server ip and password hidden for security reasons)
<?php
$add_subdomain = fopen("http://username:here_password@SERVER_IP:2082/frontend/x2/subdomain/doadddomain.html?domain=".$user."&rootdomain=mydomain.com");
fclose($add_subdomain);
?>
This part would work every time and create the subdomain, but to create the redirection I used the same idea but for some reason the line was never executed:
<?php
$add_redirection = fopen("http://username:here_password@SERVER_IP:2082/frontend/x2/subdomain/dosaveredirect.html?domain=".$user."_mydomain.com&url=www.mydomain.com/forum/index.php?showuser=".$userid);
fclose($add_redirection);
?>
I talked to my hosts tech support and they said that there were no restricitons to multiple fopen's. Can someone take a look and tell me what wrong? Thanks.