Jump to content

a hosting package output


cobrax

Recommended Posts

Hi,

 

is it posible to download my complete list of hosting packages in a nice html sheet

so also when i my updates that it wil chance on the page that it displays

 

so short

 

i need php or html code

that download my hosting packages and prices

to a php or html page

 

ho can i do that please help me out.

 

regards g.roos

Link to comment
Share on other sites

You will need to do a bit with this but:

 

nclude("configuration.php");

// Insert here the the title of your feed
$rss_title= ".com RSS feed";  
// Insert your site, in the format site.com
$rss_site= ".com" ;
// Insert the description of your website
$rss_description= "Description of your RSS feed";
// Applicable language of the feed. For spanish, change to "es"
$rss_language="en";                     
// Address of the logo file. It can be called whatever you want it to be!
$rss_logo="http://www.".$rss_site."/images/rss.gif";  
// the feed's author email
$emailadmin="your@emailaddress.com";   

// set the file's content type and character set
// this must be called before any output
header("Content-Type: text/xml;charset=utf-8");


// Open the database

mysql_connect($db_host,$db_username,$db_password);
   @mysql_select_db($db_name) or die("Unable to select DB");

// Select all the records from the Articles/Blog table - whatever you're using it for

$query = "
Select
   tblproducts.`id`,
   tblproducts.`type`,
   tblproducts.`gid`,
   tblproducts.`name`,
   tblproducts.`description`,
   tblproducts.`hidden`,
   tblproducts.`showdomainoptions`,
   tblproducts.`welcomeemail`,
   tblproducts.`stockcontrol`,
   tblproducts.`qty`,
   tblproducts.`proratabilling`,
   tblproducts.`proratadate`,
   tblproducts.`proratachargenextmonth`,
   tblproducts.`paytype`,
   tblproducts.`subdomain`,
   tblproducts.`autosetup`,
   tblproducts.`servertype`,
   tblproducts.`defaultserver`,
   tblproducts.`configoption1`,
   tblproducts.`configoption2`,
   tblproducts.`configoption3`,
   tblproducts.`configoption4`,
   tblproducts.`configoption5`,
   tblproducts.`configoption6`,
   tblproducts.`configoption7`,
   tblproducts.`configoption8`,
   tblproducts.`configoption9`,
   tblproducts.`configoption10`,
   tblproducts.`configoption11`,
   tblproducts.`configoption12`,
   tblproducts.`configoption13`,
   tblproducts.`configoption14`,
   tblproducts.`configoption15`,
   tblproducts.`configoption16`,
   tblproducts.`configoption17`,
   tblproducts.`configoption18`,
   tblproducts.`configoption19`,
   tblproducts.`configoption20`,
   tblproducts.`configoption21`,
   tblproducts.`configoption22`,
   tblproducts.`configoption23`,
   tblproducts.`configoption24`,
   tblproducts.`freedomain`,
   tblproducts.`freedomainpaymentterms`,
   tblproducts.`freedomaintlds`,
   tblproducts.`upgradepackages`,
   tblproducts.`configoptionsupgrade`,
   tblproducts.`billingcycleupgrade`,
   tblproducts.`tax`,
   tblproducts.`affiliateonetime`,
   tblproducts.`affiliatepaytype`,
   tblproducts.`affiliatepayamount`,
   tblproducts.`downloads`,
   tblproducts.`order`,
   tblproductgroups.`id`,
   tblproductgroups.`name` As `groups name`,
   tblproductgroups.`disabledgateways`,
   tblproductgroups.`hidden`,
   tblproductgroups.`order`,
   tblpricing.`id`,
   tblpricing.`type`,
   tblpricing.`currency`,
   tblpricing.`relid`,
   tblpricing.`msetupfee`,
   tblpricing.`qsetupfee`,
   tblpricing.`ssetupfee`,
   tblpricing.`asetupfee`,
   tblpricing.`bsetupfee`,
   tblpricing.`monthly`,
   tblpricing.`quarterly`,
   tblpricing.`semiannually`,
   tblpricing.`annually`,
   tblpricing.`biennially`
From
(tblproducts tblproducts LEFT OUTER JOIN tblproductgroups tblproductgroups ON (tblproducts.gid = tblproductgroups.id)) LEFT OUTER JOIN tblpricing tblpricing ON (tblpricing.relid = tblproducts.id)
Where 
    ( tblproductgroups.hidden <> 'on' ) 
   And ( tblpricing.`currency` = 1 ) 
   And ( tblpricing.type = 'product' )
Order by
   tblproductgroups.id Asc
" ;
$result = mysql_query($query) or die("Query failed") ;

$num_rows = mysql_num_rows($result);
echo
'<?xml version="1.0" encoding="utf-8" ?>
   <channel>
     <title>'.$rss_title.'</title>
     <link>http://www.'.$rss_site.'</link>
     <description>'.$rss_description.'</description>';


for($i=0;$i<$num_rows; $i++) //will loop through 500 times to generate 500 RSS items
{

   $photo_name = 'where-ever a photo for this article could be found - needs to be http://www.yoursite.com/images/whatever.gif';     

   $title = mysql_result($result,$i,'name'); //subject line for the RSS item
   $groupsname = mysql_result($result,$i,'groups name');
   // Pass the record URL_product to the variable $url_product. It also
   // has to include the relative path, like in: "path/product1.htm"
   $productinfopid = mysql_result($result,$i,'id');
$url_product = '/cart.php?a=add&pid='.$productinfopid.''; //define the URL of where people could read this blog/article entry
$url_product_image = '/templates/new_portal/images/products/'.$productinfopid.'.jpg'; //define the URL of where people could read this blog/article entry

   // Define a description of the item http://westonehosting.com/cart.php?a=add&pid=85

   $description = mysql_result($result,$i,'description'); //easiest way is by grabbing the content

   // Clean the description

   $description = str_replace ("&","",htmlspecialchars(strip_tags($descripti  on)));
   $description = str_replace ("nbsp;","",htmlspecialchars(strip_tags($descripti  on)));

   //This is a teaser of your article, basically what RSS readers will show the user in their inbox.  
   //This is how you entice users to come over and read the full article

   //the easiest way is to just take the first few hundred characters of the content (description)

   $short_description = substr($description,0,50) . "...";

   $mygid = mysql_result($result,$i,'gid');
   $mypid = mysql_result($result,$i,'id');
   //outputs the RSS item groups name

   echo
   '
       <item>
           <title>'.$title.'</title>
           <description>'.$description.'</description>
           <link>http://www.'.$rss_site.$url_product.'</link>
               <guid>http://www.'.$rss_site.$url_product.'</guid>
       </item>    
   ';


} //end of the for-loop

mysql_close(); //close the DB

echo //close the XML file
' </channel>
</rss>'; 			 		

 

I am not saying this will work out-the-box.

 

If you get it working let me now.

Link to comment
Share on other sites

its full of errors and now after // som lines i get this:

XML-parsefout: syntaxisfout
Locatie: http://scriptmarketplace.org/webhosting/webhostingtest.php
Regelnummer 1, kolom 1:Query failed
^

 

so maybe the code must be altered

 

my test file is now this

 

<?php
include("members/configuration.php");

// Insert here the the title of your feed
$rss_title= ".com RSS feed";  
// Insert your site, in the format site.com
$rss_site= ".com" ;
// Insert the description of your website
$rss_description= "Description of your RSS feed";
// Applicable language of the feed. For spanish, change to "es"
$rss_language="en";                     
// Address of the logo file. It can be called whatever you want it to be!
$rss_logo="http://www.".$rss_site."/images/rss.gif";  
// the feed's author email
$emailadmin="your@emailaddress.com";   

// set the file's content type and character set
// this must be called before any output
header("Content-Type: text/xml;charset=utf-8");


// Open the database

mysql_connect($db_host,$db_username,$db_password);
   @mysql_select_db($db_name) or die("Unable to select DB");

// Select all the records from the Articles/Blog table - whatever you're using it for

$query = "
Select
   tblproducts.`id`,
   tblproducts.`type`,
   tblproducts.`gid`,
   tblproducts.`name`,
   tblproducts.`description`,
   tblproducts.`hidden`,
   tblproducts.`showdomainoptions`,
   tblproducts.`welcomeemail`,
   tblproducts.`stockcontrol`,
   tblproducts.`qty`,
   tblproducts.`proratabilling`,
   tblproducts.`proratadate`,
   tblproducts.`proratachargenextmonth`,
   tblproducts.`paytype`,
   tblproducts.`subdomain`,
   tblproducts.`autosetup`,
   tblproducts.`servertype`,
   tblproducts.`defaultserver`,
   tblproducts.`configoption1`,
   tblproducts.`configoption2`,
   tblproducts.`configoption3`,
   tblproducts.`configoption4`,
   tblproducts.`configoption5`,
   tblproducts.`configoption6`,
   tblproducts.`configoption7`,
   tblproducts.`configoption8`,
   tblproducts.`configoption9`,
   tblproducts.`configoption10`,
   tblproducts.`configoption11`,
   tblproducts.`configoption12`,
   tblproducts.`configoption13`,
   tblproducts.`configoption14`,
   tblproducts.`configoption15`,
   tblproducts.`configoption16`,
   tblproducts.`configoption17`,
   tblproducts.`configoption18`,
   tblproducts.`configoption19`,
   tblproducts.`configoption20`,
   tblproducts.`configoption21`,
   tblproducts.`configoption22`,
   tblproducts.`configoption23`,
   tblproducts.`configoption24`,
   tblproducts.`freedomain`,
   tblproducts.`freedomainpaymentterms`,
   tblproducts.`freedomaintlds`,
   tblproducts.`upgradepackages`,
   tblproducts.`configoptionsupgrade`,
   tblproducts.`billingcycleupgrade`,
   tblproducts.`tax`,
   tblproducts.`affiliateonetime`,
   tblproducts.`affiliatepaytype`,
   tblproducts.`affiliatepayamount`,
   tblproducts.`downloads`,
   tblproducts.`order`,
   tblproductgroups.`id`,
   tblproductgroups.`name` As `groups name`,
   tblproductgroups.`disabledgateways`,
   tblproductgroups.`hidden`,
   tblproductgroups.`order`,
   tblpricing.`id`,
   tblpricing.`type`,
   tblpricing.`currency`,
   tblpricing.`relid`,
   tblpricing.`msetupfee`,
   tblpricing.`qsetupfee`,
   tblpricing.`ssetupfee`,
   tblpricing.`asetupfee`,
   tblpricing.`bsetupfee`,
   tblpricing.`monthly`,
   tblpricing.`quarterly`,
   tblpricing.`semiannually`,
   tblpricing.`annually`,
   tblpricing.`biennially`
From
(tblproducts tblproducts LEFT OUTER JOIN tblproductgroups tblproductgroups ON (tblproducts.gid = tblproductgroups.id)) LEFT OUTER JOIN tblpricing tblpricing ON (tblpricing.relid = tblproducts.id)
Where 
    ( tblproductgroups.hidden <> 'on' ) 
   And ( tblpricing.`currency` = 1 ) 
   And ( tblpricing.type = 'product' )
Order by
   tblproductgroups.id Asc
" ;
$result = mysql_query($query) or die("Query failed") ;

$num_rows = mysql_num_rows($result);
echo
'<?xml version="1.0" encoding="utf-8" ?>
   <channel>
     <title>'.$rss_title.'</title>
     <link>http://www.'.$rss_site.'
     <description>'.$rss_description.'</description>';


//for($i=0;$i<$num_rows; $i++) //will loop through 500 times to generate 500 RSS items
{

   $photo_name = 'where-ever a photo for this article could be found - needs to be http://www.yoursite.com/images/whatever.gif';     

   $title = mysql_result($result,$i,'name'); //subject line for the RSS item
   $groupsname = mysql_result($result,$i,'groups name');
   // Pass the record URL_product to the variable $url_product. It also
   // has to include the relative path, like in: "path/product1.htm"
   $productinfopid = mysql_result($result,$i,'id');
$url_product = '/cart.php?a=add&pid='.$productinfopid.''; //define the URL of where people could read this blog/article entry
$url_product_image = '/templates/new_portal/images/products/'.$productinfopid.'.jpg'; //define the URL of where people could read this blog/article entry

   // Define a description of the item http://westonehosting.com/cart.php?a=add&pid=85

   $description = mysql_result($result,$i,'description'); //easiest way is by grabbing the content

   // Clean the description

//    $description = str_replace ("&","",htmlspecialchars(strip_tags($descripti  on)));
//    $description = str_replace ("nbsp;","",htmlspecialchars(strip_tags($descripti  on)));

   //This is a teaser of your article, basically what RSS readers will show the user in their inbox.  
   //This is how you entice users to come over and read the full article

   //the easiest way is to just take the first few hundred characters of the content (description)

//   $short_description = substr($description,0,50) . "...";

   $mygid = mysql_result($result,$i,'gid');
   $mypid = mysql_result($result,$i,'id');
   //outputs the RSS item groups name

   echo
   '
       <item>
           <title>'.$title.'</title>
           <description>'.$description.'</description>
           <link>http://www.'.$rss_site.$url_product.'
               <guid>http://www.'.$rss_site.$url_product.'</guid>
       </item>    
   ';


} //end of the for-loop

mysql_close(); //close the DB

echo //close the XML file
' </channel>
</rss>';

?>

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