Jump to content

PHP code not working after update


erwin123

Recommended Posts

A few years ago I had somebody integrate a 'Add Hosting' button to the client area to be shown next to the clients domainregistrations.

 

After the update this button stopped working.

 

This is the phpcode:

 


define("CLIENTAREA",true);

require("dbconnect.php");

$domainparts = explode(".",$domainname,2);
$sld = $domainparts[0];
$tld = $domainparts[1];
$gotourl = "cart.php?a=add&pid=1&sld=".$sld."&tld=".$tld."&domainoption=owndomain";

header("Location: $gotourl");
exit;

 

1. Can anyone say whats wrong with it?

 

2. Its a mystery to me how customers can upgrade their domainregistration to hosting in a simple way.

I disabled the option to buy only hosting because I want our customers to register their domain with us to avoid fraude. Maybe that has something to do with it?

 

Thanks!

Link to comment
Share on other sites

1. Can anyone say whats wrong with it?

http://docs.whmcs.com/Version_6.0_Release_Notes#Removal_of_Dbconnect.php

 

Removal of Dbconnect.php

 

6.0 sees the removal of the dbconnect.php file from the root WHMCS directory. This file has been deprecated since WHMCS Version 5.2 and has remained only for backwards compatibility with older modules. As of 6.0 however, any scripts which still rely on including the dbconnect.php file to function will need to be updated to instead include the init.php file. When including the init.php file, it is not necessary to include any other WHMCS files.

 

For reference, the most up-to-date code sample for creating your own custom client area pages which works in WHMCS 5.2.0 and later is available @ http://docs.whmcs.com/Creating_Pages

Link to comment
Share on other sites

Great thanks, it works.

 

However I still wonder how you would update a domain to hosting without the custom button.

Do you have to create an 'hosting option' to the domains?

 

A standard button 'add hosting' next to the registered domains seems so logical to me...?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated