Jump to content

having news from outside


sinanata

Recommended Posts

hi folks,

 

I'm the designer of tarmhost.com using whmcs and I made a small code snippet. If you are using whmcs like me. And want to have the announcements on your html site (outside of whmcs) you can use this small code and style it however you wany. Peace!

 

<?php

     $baglan = mysql_connect("yourhost/generaly localhost","your db user","users pass")||die("Mysql connection error");
     @mysql_select_db("your db name")||die("mysql connection error");


   $tablo="SELECT * FROM tblannouncements";
   $a=mysql_query($tablo);
   $maxeksibes=mysql_num_rows($a);



$sonuc = mysql_query(" SELECT * FROM `tblannouncements` ORDER BY `tblannouncements` . `date` DESC LIMIT 0, 5 ");





   	while ($satir = mysql_fetch_row($sonuc)) 
{


	if ( $satir[4]==on )

	echo 
	'		
<h1 class="news_heading">'.$satir[2].'</h1>
<p class="news_front">'.$satir[3].' /http://www.tarmhost.com/base/announcements.php"] devamı >> </p>



';


}

?>

Link to comment
Share on other sites

  • 5 years later...

Thanks for the code, but do I have to add any information to this or is it just a simple copy and paste code, how does it get the information from my WHMCS site?

 

Thanks,

Adam.

 

hi folks,

 

I'm the designer of tarmhost.com using whmcs and I made a small code snippet. If you are using whmcs like me. And want to have the announcements on your html site (outside of whmcs) you can use this small code and style it however you wany. Peace!

 

<?php

     $baglan = mysql_connect("yourhost/generaly localhost","your db user","users pass")||die("Mysql connection error");
     @mysql_select_db("your db name")||die("mysql connection error");


   $tablo="SELECT * FROM tblannouncements";
   $a=mysql_query($tablo);
   $maxeksibes=mysql_num_rows($a);



$sonuc = mysql_query(" SELECT * FROM `tblannouncements` ORDER BY `tblannouncements` . `date` DESC LIMIT 0, 5 ");





   	while ($satir = mysql_fetch_row($sonuc)) 
{


	if ( $satir[4]==on )

	echo 
	'		
<h1 class="news_heading">'.$satir[2].'</h1>
<p class="news_front">'.$satir[3].' /http://www.tarmhost.com/base/announcements.php"] devamı >> </p>



';


}

?>

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