Jump to content

Customize Client Homepage for cPanel Login


BigT

Recommended Posts

I want to customize the client homepage to add a button so my customers can login to cPanel without having to make the three clicks to get to the product details page.

 

I have the code that shows the clients domain and a button for cPanel but i'm not sure how to complete the rest. I need to pull the user and password from the database for the client product and put them in the action position of the form but I've had no luck.

 

Can someone help point me in the right direction? The code I have so far is listed below. I've pieced it together with other code from the forums so I'm sure it will look familier.

 

<table class="data" width="100%" border="0" cellpadding="10" cellspacing="0">

<tr>

<th>{$LANG.orderproduct}</th>

<th> </th>

<th> </th>

<th width="20"> </th>

</tr>

{php}

$ii=1;

$result = mysql_query("SELECT * FROM tblhosting WHERE userid='".$_SESSION['uid']."'");

while($data = mysql_fetch_array($result))

{

echo '<tr><td>'.$data['domain'].'</td><td>';{/php}{php} echo '</a></td><td><form method="post" action="need help here"><input name="domainid" value="'.$data['id'].'" type="hidden"><input value="Login to cPanel" class="button" type="submit"></form></td></tr>';

$ii=0;

}

if ($ii) {

echo '<tr><td colspan=6>';{/php}{$LANG.norecordsfound}{php} echo '</td></tr>';

}

{/php}

</table>

 

thanks,

Tony

Link to comment
Share on other sites

I got it to work. The code that I used is below. My main issue was with the syntax of the post action.

 

This will not work for accounts that are not resolving in DNS yet as I use the $domain variable versus IP. Perhaps in the future i'll join another table and add the ServerIP variable.

 

I had looked a Sparky's client homepage but part of it for me is the challenge of figuring it out even if I do have help.

 

 

<br />

<table class="data" width="100%" border="0" cellpadding="10" cellspacing="0">

<tr>

<th>{$LANG.orderproduct}</th>

<th>Domain cPanel Login</th>

<th>IP cPanel Login</th>

</tr>

{php}

$ii=1;

$result = mysql_query("SELECT * FROM tblhosting WHERE userid='".$_SESSION['uid']."'");

while($data = mysql_fetch_array($result))

{

echo '<tr><td>'.$data['domain'].'</td>';{/php}{php} echo '<td><form method="post" action="http://'.$data['domain'].':2082/login?user='.$data['username'].'&pass='.decrypt($data['password']).'"><input name="domainid" value="'.$data['id'].'" type="hidden"><input value="Login to cPanel" class="button" type="submit"></form></td></tr>';

 

 

$ii=0;

}

if ($ii) {

echo '<tr><td colspan=6>';{/php}{$LANG.norecordsfound}{php} echo '</td></tr>';

}

{/php}

</table>

Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...

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