Jump to content

Help


ph34r007

Recommended Posts

Hey guys i just signed up, so hihi :P

The reason i came here is because im no expert in php and i reallllly really need help. ANyways i tried finding a simple shooping cart script and came about this.. [url=http://scripts.franciscocharrua.com/web-hosting-shopping-cart.php]http://scripts.franciscocharrua.com/web-hosting-shopping-cart.php[/url]
[code]
<form method="get">

<?
extract($_GET);
extract($_POST);

if(!isset($dn))
  {
  // domain type
  $d="n";   
  // payment frequency
  $f="y";
  // taxes quebec, taxes canada
  $tq="on"; $tc="on";
  }
 
// to catch the times when $tc is off on $tq is on, if tq is on the tc has to be on
if($tq==="on") $tc="on";
?>

<!-- DOMAIN NAME -->
<font face="tahoma,arial" size="2">
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr><td colspan="2" bgcolor="E9B0B1">
    <table width="100%" cellpading="0">
    <tr><td><b><font face="tahoma,arial" size="4" style="color:841718"><font size="5">1</font> Domain Name</font></b></td></tr>
    <tr><td colspan="2" align="right" bgcolor="FAE2E6">
    <table cellspacing=0 cellpadding=0><tr><td>
    <input type="text" size="40" name="dn" value="<?php echo $dn;?>"></td>
    <td><select name="tld">
        <option <? if($tld===".com") { ?>selected<? } ?>>.com</option>
        <option <? if($tld===".org") { ?>selected<? } ?>>.org</option>
        <option <? if($tld===".net") { ?>selected<? } ?>>.net</option>
        <option <? if($tld===".ca") { ?>selected<? } ?>>.ca</option>
        </select></td></tr>
    <tr><td colspan="2"><input type="radio" name="d" value="n" <? if($d==="n") {?>checked<? } ?> ><font face="tahoma,arial" size="2">$25 Purchase new domain<br/>
    <input type="radio" name="d" value="t" <? if($d==="t") {?>checked<? } ?> ><font face="tahoma,arial" size="2">$25 Transfer my domain<br/>
    <input type="radio" name="d" value="m" <? if($d==="m") {?>checked<? } ?> ><font face="tahoma,arial" size="2">$00 I will manage my own domain name</td></tr>
    </table></td></tr>
    </table>
</td></tr>

<tr><td colspan="2" height="10"></td></tr>
<!-- HOSTING PLANS -->
<tr><td colspan="2" bgcolor="D8A6E5">
    <table width="100%" cellpading="0">
    <tr><td><b><font face="tahoma,arial" size="4" style="color:430A51"><font size="5">2</font> Hosting Plans</font></b></td></tr>
    <tr><td colspan="2" bgcolor="EFDDFB">
    <table cellpadding=0 cellspacing=0 width="100%"><tr><td align="right"><font face="tahoma,arial" size="2">Plan</td>
    <td align="right"><select name="p" style="width:190px">
                      <option value="pp" <? if($p==="pp") { ?>selected<? } ?>>Professional 200MB 10GB</option>
                      <option value="p0" <? if($p==="p0") { ?>selected<? } ?>>No Hosting</option>
                      <option value="pb" <? if($p==="pb") { ?>selected<? } ?>>Basic 50MB 1GB</option>
                      <option value="pr2" <? if($p==="pr2") { ?>selected<? } ?>>Professional2 400MB 14GB</option>
                      <option value="pr5" <? if($p==="pr5") { ?>selected<? } ?>>Reseller5 1GB 35GB</option>
                      <option value="pr20" <? if($p==="pr20") { ?>selected<? } ?>>Reseller20 5GB 140GB</option>
                      <option value="pr50" <? if($p==="pr50") { ?>selected<? } ?>>Reseller50 15GB 350GB</option>
                      <option value="pd" <? if($p==="pd") { ?>selected<? } ?>>Dedicated 80GB 700GB</option>
                      </select></td></tr>
    <tr><td align="right"><font face="tahoma,arial" size="2">Additional Diskspace</td>
    <td align="right"><select name="dk" style="width:190px">
                      <option value="dk0" <? if($dk==="dk0") { ?>selected<? } ?>>+0MB - $0</option>
                      <option value="dk100" <? if($dk==="dk100") { ?>selected<? } ?>>+100MB - $2</option>
                      <option value="dk500" <? if($dk==="dk500") { ?>selected<? } ?>>+500MB - $10</option>
                      <option value="dk1000" <? if($dk==="dk1000") { ?>selected<? } ?>>+1000MB - $20</option>
                      <option value="dk4000" <? if($dk==="dk4000") { ?>selected<? } ?>>+4000MB - $60</option>
                      </select></td></tr>
    <tr><td align="right"><font face="tahoma,arial" size="2">Additional Bandwidth</td>
    <td align="right"><select name="b" style="width:190px">
                      <option value="b0" <? if($b==="b0") { ?>selected<? } ?>>+0GB - $0</option>
                      <option value="b1" <? if($b==="b1") { ?>selected<? } ?>>+1GB - $2</option>
                      <option value="b5" <? if($b==="b5") { ?>selected<? } ?>>+5GB - $10</option>
                      <option value="b25" <? if($b==="b25") { ?>selected<? } ?>>+25GB - $50</option>
                      <option value="b75" <? if($b==="b75") { ?>selected<? } ?>>+75GB - $100</option>
                      <option value="b200" <? if($b==="b200") { ?>selected<? } ?>>+200GB - $200</option>
                      <option value="b500" <? if($b==="b500") { ?>selected<? } ?>>+500GB - $400</option>
                      <option value="b1200" <? if($b==="b1200") { ?>selected<? } ?>>+1200GB - $600</option>
                      </select></td></tr></table>
    </td></tr></table>
</td></tr>

<tr><td colspan="2" height="10"></td></tr>
<!-- PAYMENT FREQUENCY -->
<tr><td colspan="2" bgcolor="A6C0E5">
    <table width="100%" cellpading="0">
    <tr><td><b><font face="tahoma,arial" size="4" style="color:0F2D5B"><font size="5">3</font> Payment Frequency</font></b></td></tr>
    <tr><td colspan="2" bgcolor="DDECFB">
    <input type="radio" name="f" value="y" <? if($f==="y") {?>checked<? } ?> ><font face="tahoma,arial" size="2">Pay Yearly<br/>
    <input type="radio" name="f" value="m" <? if($f==="m") {?>checked<? } ?> >Pay Monthly +$1.95/month (administrative costs)</font></td></tr>   
    </table></td></tr>

<tr><td colspan="2" height="10"></td></tr>
<!-- TAXES -->
<tr><td colspan="2" bgcolor="A4E39F">
    <table width="100%" cellpading="0">
    <tr><td><b><font face="tahoma,arial" size="4" style="color:0F540A"><font size="5">4</font> Taxes</font></b></td></tr>
    <tr><td colspan="2" bgcolor="DFFADA">
    <input type="checkbox" name="tq" <? if($tq==="on") { ?>checked<? } ?> ><font face="tahoma,arial" size="2">I live in Quebec (PST)<br/>
    <input type="checkbox" name="tc" <? if($tc==="on") { ?>checked<? } ?> ><font face="tahoma,arial" size="2">I live in Canada (GST)<br/>
    </td></tr>
    </table>
</td></tr>

<tr><td colspan="2" height="10"></td></tr>

<?
$frequency = "year";
if($f==="m") $frequency="month";
if($f==="y") $frequency="year";

$domain = "25";

$plandesc = "Professional";
$plan = "120";
if($p==="p0") {$plan="0";$plandesc="No hosting";}
if($p==="pb") {$plan="5";$plandesc="Basic";}
if($p==="pp") {$plan="10";$plandesc="Professional";}
if($p==="pr2") {$plan="14";$plandesc="Professional 2";}
if($p==="pr5") {$plan="35";$plandesc="Reseller 5";}
if($p==="pr20") {$plan="99";$plandesc="Reseller 20";}
if($p==="pr50") {$plan="199";$plandesc="Reseller 50";}
if($p==="pd") {$plan="399";$plandesc="Dedicated";}

$bandwidth = "0";
if($b==="b0") $bandwidth = "0";
if($b==="b1") $bandwidth = "2";
if($b==="b5") $bandwidth = "10";
if($b==="b25") $bandwidth = "50";
if($b==="b75") $bandwidth = "100";
if($b==="b200") $bandwidth = "200";
if($b==="b500") $bandwidth = "400";
if($b==="b1200") $bandwidth = "600";

$diskspace = "0";
if($dk==="dk0") $diskspace = "0";
if($dk==="dk100") $diskspace = "2";
if($dk==="dk500") $diskspace = "10";
if($dk==="dk1000") $diskspace = "20";
if($dk==="dk4000") $diskspace = "60";

if($f==="y") {$diskspace = ($diskspace*12); $bandwidth = ($bandwidth*12); $plan = ($plan*12);}
if($f==="m")
  {
  $domain = "2.09"; $plan = ($plan + 1.95);
  }
if ($d==="m") $domain="0";

$subtotal = $domain+$bandwidth+$diskspace+$plan;
$gst = "0";
$pst = "0";
if($tc==="on")
  {
  $gst = $subtotal*0.07;
  if($tq==="on") $pst = ($subtotal+$gst)*0.075;
  }
?>

<!-- CALCULATE -->
<tr><td colspan="2" bgcolor="D6CA0D">
    <table width="100%" cellpading="0">
    <tr><td><b><font face="tahoma,arial" size="4" style="color:605A00"><font size="5">5</font>
    <? if(isset($dn)) { ?>Recalculate<? } else { ?>Calculate<? } ?></font></b></td></tr>
    <tr><td colspan="2" bgcolor="F6F090">
   
    <table width="100%" border="0">
    <? if(isset($dn)) { ?>
    <tr><td><font size="1" face="tahoma,arial"><?= $dn . $tld ?> Domain Name</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$domain) ?></td>
    <tr><td><font size="1" face="tahoma,arial"><?= $plandesc ?> Plan</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$plan) ?></td>
    <tr><td><font size="1" face="tahoma,arial">Extra Diskspace</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$diskspace) ?></td>
    <tr><td><font size="1" face="tahoma,arial">Extra Bandwidth</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$bandwidth) ?></td>
    <tr><td><font size="1" face="tahoma,arial">Subtotal</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$subtotal) ?></td>
    <tr><td><font size="1" face="tahoma,arial">GST</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$gst) ?></td>
    <tr><td><font size="1" face="tahoma,arial">PST</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$pst) ?></td>
    <?php $total = sprintf("%01.2f",($subtotal+$gst+$pst));?>
    <tr><td bgcolor="958D05" colspan="2"><table width="100%"><tr><td><font size="5" face="tahoma,arial" style="color:FFFFFF">Total</td><td align="right"><font size="5" face="tahoma,arial" style="color:FFFFFF"><?php echo "$".$total;?></td></tr></table></td>
    <tr><td colspan="2"><font size="1" face="tahoma,arial">Payable every <?= $frequency ?></td>
    <? } ?>
    <tr><td colspan="2" align="right"><font size="1"></font> <input type="submit" Value="<? if(isset($dn)) { ?>Recalculate<? } else { ?>Calculate<? } ?>"></td></tr>
    </tr></table>   
         
    </td></tr>
    </table>
</td></tr>

<tr><td colspan="2" height="10"></td></tr>

<? if(isset($dn)) { ?>
<!-- CHECKOUT -->
<tr><td colspan="2" bgcolor="DAA552">
    <table width="100%" cellpading="0" valign="center">
    <tr><td><b><font face="tahoma,arial" size="4" style="color:542410"><font size="5">6</font> Checkout</font></b></td></tr>
    <tr><td colspan="2" bgcolor="F4D7A9" align="right">
   
<?
$days="365";
$yahoof = "Y";
if($f==="m") {$days="30"; $yahoof="M";}

$company_id = "";

$paysystems = "https://secure.paysystems1.com/cgi-v310/payment/onlinesale-tpppro.asp?product1=" .
              $plandesc."-".$dn.$tld."-".$d."-".$p."-".$dk."-".$b."-".$f . "&companyid=" . $company_id . "&total=" .
              $total. "&repeatamount=" . $total .
              "&formget=N&redirect=http://www.webhostingcanada.org/success.php" .
              "&redirectfail=http://www.webhostingcanada.org/fail.php&reoccur=Y&cycle=" .
              $days . "&totalperiod=100";

$business_email = "";
             
$paypal = "https://www.paypal.com/subscriptions/business=" . $business_email . "&item_number=" .
          $plandesc."-".$dn.$tld."-".$d."-".$p."-".$dk."-".$b."-".$f . "&no_note=1&currency_code=CAD&a3=" .
          $total . "&p3=1&t3=" . $yahoof . "&src=1&sra=1";
?>
<? if($dn != "") { ?>
<a href="<?= $paysystems ?>"><font face="tahoma,arial" color="000000" size="3"><b>PaySystems</b></font></a>
&nbsp;&nbsp;&nbsp;&nbsp; <b>or</b> &nbsp;&nbsp;&nbsp;&nbsp;
<a href="<?= $paypal ?>"><font face="tahoma,arial" color="000000" size="3"><b>PayPal</b></font></a>
<? } else { ?>
<font face="tahoma,arial" color="000000" size="3">
Please type in your <b>Domain Name</b> in section 1 above, and then click on Recalculate.
</font>
<? } ?>
</td></tr>
</table>
</td></tr>
<? } ?>
   
</table>
</font>
</form>
[/code]

The thing im trying to do with this script is manipulate and make it for a game hosting company. What i need this script to do is allow people to input the information they want their server to have such as password servername and other things.. I also want it to charge the customer their money thru paypal but send me the information of the server within the same script. Like i said im no expert at php a barly know anything, heck i dont even know if what im trying to do is possible but this is what i have come up with so far, it doesnt work, and gives me errors.. and when it actually worked the money calculator didnt want to work.

[code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<!-- TemplateBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- TemplateEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
</head>

<body>

<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr><td colspan="2" bgcolor="E9B0B1">
    <table width="100%" cellpading="0">
    <tr>
      <td><b><font face="tahoma,arial" size="4" style="color:841718"><font size="5">1</font> Server Info </font></b></td>
    </tr>
    <tr><td colspan="2" align="right" bgcolor="FAE2E6">
    <table cellspacing=0 cellpadding=0><tr>
      <td><div align="right">Server Name </div></td>
        <td><input type="text" size="40"  width="190" name="dn" value="<?php echo $dn;?>"></td>
    </tr>
    <tr>
      <td><div align="right">Rcon Pass </div></td><td><label>
        <input name="rpass" type="text" id="rpass" size="12" width="190">
      </label></td>
    </tr>
<tr>
  <td><div align="right">CP Pass</div></td><td><input name="cpass" type="text" id="cpass" size="12" width="190"></td>
</tr>
    </table></td></tr>
    </table>
</td></tr>

<tr><td colspan="2" height="10"></td></tr>
<!-- HOSTING PLANS -->
<tr><td colspan="2" bgcolor="D8A6E5">
    <table width="100%" cellpading="0">
    <tr><td><b><font face="tahoma,arial" size="4" style="color:430A51"><font size="5">2</font> Hosting Plans</font></b></td></tr>
    <tr><td colspan="2" bgcolor="EFDDFB">
    <table cellpadding=0 cellspacing=0 width="100%"><tr>
      <td width="34%" align="right"><font face="tahoma,arial" size="2">Public</td>
      <td width="66%" align="right"><select name="p" style="width:190px">
        <option value="p00" <? if($p==="p00") { ?>selected<? } ?>>-- None Selected --</option>           
<option value="pp" <? if($p==="pp") { ?>selected<? } ?>>10 Man Server</option>
                      <option value="p0" <? if($p==="p0") { ?>selected<? } ?>>12 Man Server</option>
                      <option value="pb" <? if($p==="pb") { ?>selected<? } ?>>14 Man Server</option>
                      <option value="pr2" <? if($p==="pr2") { ?>selected<? } ?>>16 Man Server</option>
                      <option value="pr5" <? if($p==="pr5") { ?>selected<? } ?>>18 Man Server</option>
                      <option value="pr20" <? if($p==="pr20") { ?>selected<? } ?>>20 Man Server</option>
                      <option value="pr50" <? if($p==="pr50") { ?>selected<? } ?>>22 Man Server</option>
                      <option value="pd" <? if($p==="pd") { ?>selected<? } ?>>24 Man Server</option>
                      <option value="pp1" <? if($p==="pp1") { ?>selected<? } ?>>26 Man Server</option>
<option value="pp2" <? if($p==="pp2") { ?>selected<? } ?>>28 Man Server</option>
<option value="pp3" <? if($p==="pp3") { ?>selected<? } ?>>30 Man Server</option>
<option value="pp4" <? if($p==="pp4") { ?>selected<? } ?>>32 Man Server</option>

</select></td></tr>
    <tr>
      <td align="right"><font face="tahoma,arial" size="2">Private</td>
      <td align="right"><select name="dk" style="width:190px">
          <option value="d00" <? if($dk==="d00") { ?>selected<? } ?>>-- None Selected --</option>           
<option value="dk0" <? if($dk==="dk0") { ?>selected<? } ?>>10 Man Server</option>
                      <option value="dk100" <? if($dk==="dk100") { ?>selected<? } ?>>12 Man Server</option>
                      <option value="dk500" <? if($dk==="dk500") { ?>selected<? } ?>>14 Man Server</option>
                      <option value="dk1000" <? if($dk==="dk1000") { ?>selected<? } ?>>16 Man Server</option>
                      <option value="dk4000" <? if($dk==="dk4000") { ?>selected<? } ?>>18 Man Server</option>
                      </select></td></tr>
 
    </table>
    </td></tr></table>
</td></tr>

<tr><td colspan="2" height="10"></td></tr>
<!-- PAYMENT FREQUENCY -->
<tr><td colspan="2" bgcolor="A6C0E5">
    <table width="100%" cellpading="0">
    <tr><td><b><font face="tahoma,arial" size="4" style="color:0F2D5B"><font size="5">3</font> Payment Frequency</font></b></td></tr>
    <tr><td colspan="2" bgcolor="DDECFB">
    <input type="radio" name="f" value="y" <? if($f==="y") {?>checked<? } ?> ><font face="tahoma,arial" size="2">Pay Yearly<br/>
    <input type="radio" name="f" value="m" <? if($f==="m") {?>checked<? } ?> >
    Pay Monthly</font></td>
    </tr>   
    </table></td></tr>




<?
$frequency = "year";
if($f==="m") $frequency="month";
if($f==="y") $frequency="year";



$plandesc = "Professional";
$plan = "0";
if($p==="p00") {$plan="0.0";$plandesc="0";}
if($p==="pp") {$plan="12.50";$plandesc="10";}
if($p==="p0") {$plan="15.00";$plandesc="12";}
if($p==="pb") {$plan="17.50";$plandesc="14";}
if($p==="pr2") {$plan="20.00";$plandesc="16";}
if($p==="pr5") {$plan="22.50";$plandesc="18";}
if($p==="pr20") {$plan="25.00";$plandesc="20";}
if($p==="pr50") {$plan="27.50";$plandesc="22";}
if($p==="pd") {$plan="30.00";$plandesc="24";}
if($p==="pp1") {$plan="32.50";$plandesc="26";}
if($p==="pp2") {$plan="35.00";$plandesc="28";}
if($p==="pp3") {$plan="37.00";$plandesc="30";}
if($p==="pp4") {$plan="40.00";$plandesc="32";}



$domain = "0";
if($d==="d00") $domain = "0";
if($d==="d1") $domain = "12.50";
if($d==="d5") $domain = "15.00";
if($d==="d25") $domain = "17.50";
if($d==="d75") $domain = "20.00";
if($d==="d200") $domain = "22.50";



if($f==="y") {$plan = ($plan*12); $domain = ($domain*12);}
if($f==="m")
  {
  domain = ($domain + 0); $plan = ($plan + 0);
  }
if ($d==="m") $domain="0";

$subtotal = $domain+$bandwidth+$plan;


?>

<!-- CALCULATE -->
<tr><td colspan="2" bgcolor="D6CA0D">
    <table width="100%" cellpading="0">
    <tr><td><b><font face="tahoma,arial" size="4" style="color:605A00"><font size="5">5</font>
    <? if(isset($dn)) { ?>Recalculate<? } else { ?>Calculate<? } ?></font></b></td></tr>
    <tr><td colspan="2" bgcolor="F6F090">
   
    <table width="100%" border="0">
    <? if(isset($dn)) { ?>
    <tr><td><font size="1" face="tahoma,arial"><?= $dn . $tld ?> Domain Name</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$domain) ?></td>
    <tr><td><font size="1" face="tahoma,arial"><?= $plandesc ?> Plan</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$plan) ?></td>
    <tr><td><font size="1" face="tahoma,arial">Extra Diskspace</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$diskspace) ?></td>
    <tr><td><font size="1" face="tahoma,arial">Extra Bandwidth</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$bandwidth) ?></td>
    <tr><td><font size="1" face="tahoma,arial">Subtotal</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$subtotal) ?></td>
    <tr><td><font size="1" face="tahoma,arial">GST</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$gst) ?></td>
    <tr><td><font size="1" face="tahoma,arial">PST</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$pst) ?></td>
    <?php $total = sprintf("%01.2f",($subtotal+$gst+$pst));?>
    <tr><td bgcolor="958D05" colspan="2"><table width="100%"><tr><td><font size="5" face="tahoma,arial" style="color:FFFFFF">Total</td><td align="right"><font size="5" face="tahoma,arial" style="color:FFFFFF"><?php echo "$".$total;?></td></tr></table></td>
    <tr><td colspan="2"><font size="1" face="tahoma,arial">Payable every <?= $frequency ?></td>
    <? } ?>
    <tr><td colspan="2" align="right"><font size="1"></font> <input type="submit" Value="<? if(isset($dn)) { ?>Recalculate<? } else { ?>Calculate<? } ?>"></td></tr>
    </tr></table>   
         
    </td></tr>
    </table>
</td></tr>

<tr><td colspan="2" height="10"></td></tr>

<? if(isset($dn)) { ?>
<!-- CHECKOUT -->
<tr><td colspan="2" bgcolor="DAA552">
    <table width="100%" cellpading="0" valign="center">
    <tr><td><b><font face="tahoma,arial" size="4" style="color:542410"><font size="5">6</font> Checkout</font></b></td></tr>
    <tr><td colspan="2" bgcolor="F4D7A9" align="right">
   
<?
$days="365";
$yahoof = "Y";
if($f==="m") {$days="30"; $yahoof="M";}

$company_id = "";

$paysystems = "https://secure.paysystems1.com/cgi-v310/payment/onlinesale-tpppro.asp?product1=" .
              $plandesc."-".$dn.$tld."-".$d."-".$p."-".$dk."-".$b."-".$f . "&companyid=" . $company_id . "&total=" .
              $total. "&repeatamount=" . $total .
              "&formget=N&redirect=http://www.webhostingcanada.org/success.php" .
              "&redirectfail=http://www.webhostingcanada.org/fail.php&reoccur=Y&cycle=" .
              $days . "&totalperiod=100";

$business_email = "";
             
$paypal = "https://www.paypal.com/subscriptions/business=" . $business_email . "&item_number=" .
          $plandesc."-".$dn.$tld."-".$d."-".$p."-".$dk."-".$b."-".$f . "&no_note=1&currency_code=CAD&a3=" .
          $total . "&p3=1&t3=" . $yahoof . "&src=1&sra=1";
?>
<? if($dn != "") { ?>
<a href="<?= $paysystems ?>"><font face="tahoma,arial" color="000000" size="3"><b>PaySystems</b></font></a>
&nbsp;&nbsp;&nbsp;&nbsp; <b>or</b> &nbsp;&nbsp;&nbsp;&nbsp;
<a href="<?= $paypal ?>"><font face="tahoma,arial" color="000000" size="3"><b>PayPal</b></font></a>
<? } else { ?>
<font face="tahoma,arial" color="000000" size="3">
Please type in your <b>Domain Name</b> in section 1 above, and then click on Recalculate.
</font>
<? } ?>
</td></tr>
</table>
</td></tr>
<? } ?>
   
</table>
</font>
</form>

</body>
</html>[/code]

If anyone could help me with this it would be greatly appreciated. My friend is trying to start his own gaming hosting company but in order to legitamize this proccess there has to be some kind of ordering form rather then handling everything thru msn. Thanks in advance guys :)
Link to comment
Share on other sites

Update/Bump

i got rid of the error, heck i dunno what i did, but if anyone could help me with the amount calculator it would be GREATLY appreciated. currently when i click calculate it does like... nothing

[code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<!-- TemplateBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- TemplateEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
</head>

<body>

<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr><td colspan="2" bgcolor="E9B0B1">
    <table width="100%" cellpading="0">
    <tr>
      <td><b><font face="tahoma,arial" size="4" style="color:841718"><font size="5">1</font> Server Info </font></b></td>
    </tr>
    <tr><td colspan="2" align="right" bgcolor="FAE2E6">
    <table cellspacing=0 cellpadding=0><tr>
      <td><div align="right">Server Name </div></td>
        <td><input type="text" size="40"  width="190" name="dn" value="<?php echo $dn;?>"></td>
    </tr>
    <tr>
      <td><div align="right">Rcon Pass </div></td><td><label>
        <input name="rpass" type="text" id="rpass" size="12" width="190">
      </label></td>
    </tr>
<tr>
  <td><div align="right">CP Pass</div></td><td><input name="cpass" type="text" id="cpass" size="12" width="190"></td>
</tr>
    </table></td></tr>
    </table>
</td></tr>

<tr><td colspan="2" height="10"></td></tr>
<!-- HOSTING PLANS -->
<tr><td colspan="2" bgcolor="D8A6E5">
    <table width="100%" cellpading="0">
    <tr><td><b><font face="tahoma,arial" size="4" style="color:430A51"><font size="5">2</font> Hosting Plans</font></b></td></tr>
    <tr><td colspan="2" bgcolor="EFDDFB">
    <table cellpadding=0 cellspacing=0 width="100%"><tr>
      <td width="34%" align="right"><font face="tahoma,arial" size="2">Public</td>
      <td width="66%" align="right"><select name="p" style="width:190px">
        <option value="p00" <? if($p==="p00") { ?>selected<? } ?>>-- None Selected --</option>           
<option value="pp" <? if($p==="pp") { ?>selected<? } ?>>10 Man Server</option>
                      <option value="p0" <? if($p==="p0") { ?>selected<? } ?>>12 Man Server</option>
                      <option value="pb" <? if($p==="pb") { ?>selected<? } ?>>14 Man Server</option>
                      <option value="pr2" <? if($p==="pr2") { ?>selected<? } ?>>16 Man Server</option>
                      <option value="pr5" <? if($p==="pr5") { ?>selected<? } ?>>18 Man Server</option>
                      <option value="pr20" <? if($p==="pr20") { ?>selected<? } ?>>20 Man Server</option>
                      <option value="pr50" <? if($p==="pr50") { ?>selected<? } ?>>22 Man Server</option>
                      <option value="pd" <? if($p==="pd") { ?>selected<? } ?>>24 Man Server</option>
                      <option value="pp1" <? if($p==="pp1") { ?>selected<? } ?>>26 Man Server</option>
<option value="pp2" <? if($p==="pp2") { ?>selected<? } ?>>28 Man Server</option>
<option value="pp3" <? if($p==="pp3") { ?>selected<? } ?>>30 Man Server</option>
<option value="pp4" <? if($p==="pp4") { ?>selected<? } ?>>32 Man Server</option>

</select></td></tr>
    <tr>
      <td align="right"><font face="tahoma,arial" size="2">Private</td>
      <td align="right"><select name="dk" style="width:190px">
          <option value="d00" <? if($dk==="d00") { ?>selected<? } ?>>-- None Selected --</option>           
<option value="dk0" <? if($dk==="dk0") { ?>selected<? } ?>>10 Man Server</option>
                      <option value="dk100" <? if($dk==="dk100") { ?>selected<? } ?>>12 Man Server</option>
                      <option value="dk500" <? if($dk==="dk500") { ?>selected<? } ?>>14 Man Server</option>
                      <option value="dk1000" <? if($dk==="dk1000") { ?>selected<? } ?>>16 Man Server</option>
                      <option value="dk4000" <? if($dk==="dk4000") { ?>selected<? } ?>>18 Man Server</option>
                      </select></td></tr>
 
    </table>
    </td></tr></table>
</td></tr>

<tr><td colspan="2" height="10"></td></tr>
<!-- PAYMENT FREQUENCY -->
<tr><td colspan="2" bgcolor="A6C0E5">
    <table width="100%" cellpading="0">
    <tr><td><b><font face="tahoma,arial" size="4" style="color:0F2D5B"><font size="5">3</font> Payment Frequency</font></b></td></tr>
    <tr><td colspan="2" bgcolor="DDECFB">
    <input type="radio" name="f" value="y" <? if($f==="y") {?>checked<? } ?> ><font face="tahoma,arial" size="2">Pay Yearly<br/>
    <input type="radio" name="f" value="m" <? if($f==="m") {?>checked<? } ?> >
    Pay Monthly</font></td>
    </tr>   
    </table></td></tr>




<?
$frequency = "year";
if($f==="m") $frequency="month";
if($f==="y") $frequency="year";



$plandesc = "Professional";
$plan = "0";
if($p==="p00") {$plan="0.0";$plandesc="0";}
if($p==="pp") {$plan="12.50";$plandesc="10";}
if($p==="p0") {$plan="15.00";$plandesc="12";}
if($p==="pb") {$plan="17.50";$plandesc="14";}
if($p==="pr2") {$plan="20.00";$plandesc="16";}
if($p==="pr5") {$plan="22.50";$plandesc="18";}
if($p==="pr20") {$plan="25.00";$plandesc="20";}
if($p==="pr50") {$plan="27.50";$plandesc="22";}
if($p==="pd") {$plan="30.00";$plandesc="24";}
if($p==="pp1") {$plan="32.50";$plandesc="26";}
if($p==="pp2") {$plan="35.00";$plandesc="28";}
if($p==="pp3") {$plan="37.00";$plandesc="30";}
if($p==="pp4") {$plan="40.00";$plandesc="32";}



$domain = "0";
if($d==="d00") $domain = "0";
if($d==="d1") $domain = "12.50";
if($d==="d5") $domain = "15.00";
if($d==="d25") $domain = "17.50";
if($d==="d75") $domain = "20.00";
if($d==="d200") $domain = "22.50";


if($f==="y") {$plan = ($plan*12); $domain = ($domain*12);}
if($f==="m")
  {
  $domain = ($domain + 0); $plan = ($plan + 0);
  }
if ($d==="m") $domain="0";

$subtotal = $domain+$bandwidth+$plan;


?>

<!-- CALCULATE -->
<tr><td colspan="2" bgcolor="D6CA0D">
    <table width="100%" cellpading="0">
    <tr><td><b><font face="tahoma,arial" size="4" style="color:605A00"><font size="5">5</font>
    <? if(isset($dn)) { ?>Recalculate<? } else { ?>Calculate<? } ?></font></b></td></tr>
    <tr><td colspan="2" bgcolor="F6F090">
   
    <table width="100%" border="0">
    <? if(isset($dn)) { ?>
    <tr><td><font size="1" face="tahoma,arial"><?= $dn . $tld ?> Domain Name</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$domain) ?></td>
    <tr><td><font size="1" face="tahoma,arial"><?= $plandesc ?> Plan</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$plan) ?></td>
    <tr><td><font size="1" face="tahoma,arial">Extra Diskspace</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$diskspace) ?></td>
    <tr><td><font size="1" face="tahoma,arial">Extra Bandwidth</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$bandwidth) ?></td>
    <tr><td><font size="1" face="tahoma,arial">Subtotal</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$subtotal) ?></td>
    <tr><td><font size="1" face="tahoma,arial">GST</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$gst) ?></td>
    <tr><td><font size="1" face="tahoma,arial">PST</td><td align="right"><font size="1" face="tahoma,arial"><?= sprintf("$%01.2f",$pst) ?></td>
    <?php $total = sprintf("%01.2f",($subtotal+$gst+$pst));?>
    <tr><td bgcolor="958D05" colspan="2"><table width="100%"><tr><td><font size="5" face="tahoma,arial" style="color:FFFFFF">Total</td><td align="right"><font size="5" face="tahoma,arial" style="color:FFFFFF"><?php echo "$".$total;?></td></tr></table></td>
    <tr><td colspan="2"><font size="1" face="tahoma,arial">Payable every <?= $frequency ?></td>
    <? } ?>
    <tr><td colspan="2" align="right"><font size="1"></font> <input type="submit" Value="<? if(isset($dn)) { ?>Recalculate<? } else { ?>Calculate<? } ?>"></td></tr>
    </tr></table>   
         
    </td></tr>
    </table>
</td></tr>

<tr><td colspan="2" height="10"></td></tr>

<? if(isset($dn)) { ?>
<!-- CHECKOUT -->
<tr><td colspan="2" bgcolor="DAA552">
    <table width="100%" cellpading="0" valign="center">
    <tr><td><b><font face="tahoma,arial" size="4" style="color:542410"><font size="5">6</font> Checkout</font></b></td></tr>
    <tr><td colspan="2" bgcolor="F4D7A9" align="right">
   
<?
$days="365";
$yahoof = "Y";
if($f==="m") {$days="30"; $yahoof="M";}

$company_id = "";

$paysystems = "https://secure.paysystems1.com/cgi-v310/payment/onlinesale-tpppro.asp?product1=" .
              $plandesc."-".$dn.$tld."-".$d."-".$p."-".$dk."-".$b."-".$f . "&companyid=" . $company_id . "&total=" .
              $total. "&repeatamount=" . $total .
              "&formget=N&redirect=http://www.webhostingcanada.org/success.php" .
              "&redirectfail=http://www.webhostingcanada.org/fail.php&reoccur=Y&cycle=" .
              $days . "&totalperiod=100";

$business_email = "";
             
$paypal = "https://www.paypal.com/subscriptions/business=" . $business_email . "&item_number=" .
          $plandesc."-".$dn.$tld."-".$d."-".$p."-".$dk."-".$b."-".$f . "&no_note=1&currency_code=CAD&a3=" .
          $total . "&p3=1&t3=" . $yahoof . "&src=1&sra=1";
?>
<? if($dn != "") { ?>
<a href="<?= $paysystems ?>"><font face="tahoma,arial" color="000000" size="3"><b>PaySystems</b></font></a>
&nbsp;&nbsp;&nbsp;&nbsp; <b>or</b> &nbsp;&nbsp;&nbsp;&nbsp;
<a href="<?= $paypal ?>"><font face="tahoma,arial" color="000000" size="3"><b>PayPal</b></font></a>
<? } else { ?>
<font face="tahoma,arial" color="000000" size="3">
Please type in your <b>Domain Name</b> in section 1 above, and then click on Recalculate.
</font>
<? } ?>
</td></tr>
</table>
</td></tr>
<? } ?>
   
</table>
</font>
</form>

</body>
</html>
[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.