BigT Posted September 25, 2009 Share Posted September 25, 2009 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 0 Quote Link to comment Share on other sites More sharing options...
rangermoore Posted September 26, 2009 Share Posted September 26, 2009 Hi, Sparky offers a great client area homepage. The client can login to their cpanel from there.. https://tshosting.com.au/cart.php?gid=10 0 Quote Link to comment Share on other sites More sharing options...
BigT Posted September 26, 2009 Author Share Posted September 26, 2009 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> 0 Quote Link to comment Share on other sites More sharing options...
crownpointdesign Posted September 23, 2011 Share Posted September 23, 2011 BigT, you rock! I was trying to find some documentation on doing the same thing and ran accross your post. Worked like a charm. Thanks again! 0 Quote Link to comment Share on other sites More sharing options...
inyerface Posted December 11, 2012 Share Posted December 11, 2012 How would we add this to the services page? I just want to add an extra <td> the already exisitng {foreach} service listed. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.