Jump to content

Modification in this code


darubillah

Recommended Posts

hi,

 

this is the code

 

<?php
if(!defined('GEN2_PROCESS')) { exit(); }
$ref_title = "Recharge";
if(!$loggedin)
{

function filter_data($val)
{
  return htmlentities($val,ENT_QUOTES);
}

if($_POST['ap'])
{

$post=array_map("filter_data",$_POST);

$url = $post['url'];
$clicks = $post['clicks'];
$name = $post['name'];
$bold = $post['bold'];
$highlight = $post['highlight'];
$email = $post['email'];
$cat = $post['cat'];
$desc = $post['desc'];
if($post['url'] == "" || $post['name'] == "") {
	$contents .= "You need to fill in all fields. Please press back.";
} else {
$price = mysql_query("SELECT price FROM ad_packages WHERE clicks='{$clicks}' LIMIT 1;");
$price = mysql_fetch_array($price);
$price = $price['price'];

if($bold) {
	$price = $price + $set['bold_link_price'];
}
if($highlight) {
	$price = $price + $set['highlight_link_price'];
}
if($desc) {
	$price = $price + $set['desc_link_price'];
}

mysql_query("INSERT INTO outsideads (`id`,`url`,`name`,`email`,`category`,`bold`,`highlight`,`desc`,`clicks`,`type`) 
VALUES (NULL,'{$url}','{$name}','{$email}','{$cat}','{$bold}','{$highlight}','{$desc}','{$clicks}','Alertpay')")or die(mysql_error());

$contents .= "Your ad has been submitted. Please click the Alertpay icon below to proceed with your payment.<br /><br />
			<form method='post' name='ap' action='https://www.alertpay.com/PayProcess.aspx'>
				<input type='hidden' name='ap_amount' value='{$price}'>
				<input type='hidden' name='ap_purchasetype' value='service'/>
				<input type='hidden' name='ap_merchant' value='{$set['ap_paymentemail']}'/>
				<input type='hidden' name='ap_itemname' value='{$set['outsideads']}'/>
				<input type='hidden' name='ap_currency' value='USD'/>
				<input type='hidden' name='ap_returnurl' value=''/>
				<input type='hidden' name='ap_quantity' value='1'/>
				<center><input type='image' name='ap_image' src='https://www.alertpay.com/PayNow/5B9DE53E8E9A4D8CB89C7EA37D4F04C5f.gif'/>
			</form>";
}
} elseif($_POST['pp'])
{

$post=array_map("filter_data",$_POST);

$url = $post['url'];
$clicks = $post['clicks'];
$name = $post['name'];
$bold = $post['bold'];
$highlight = $post['highlight'];
$email = $post['email'];
$cat = $post['cat'];
$desc = $post['desc'];
if($post['url'] == "" || $post['name'] == "") {
	$contents .= "You need to fill in all fields. Please press back.";
} else {
$price = mysql_query("SELECT price FROM ad_packages WHERE clicks='{$clicks}' LIMIT 1;");
$price = mysql_fetch_array($price);
$price = $price['price'];

if($bold) {
	$price = $price + $set['bold_link_price'];
}
if($highlight) {
	$price = $price + $set['highlight_link_price'];
}
if($desc) {
	$price = $price + $set['desc_link_price'];
}

mysql_query("INSERT INTO outsideads (`id`,`url`,`name`,`email`,`category`,`bold`,`highlight`,`desc`,`clicks`,`type`) 
VALUES (NULL,'{$url}','{$name}','{$email}','{$cat}','{$bold}','{$highlight}','{$desc}','{$clicks}','Paypal')")or die(mysql_error());

$contents .= "Your ad has been submitted. Please click the Paypal icon below to proceed with your payment.<br /><br />
<FORM ACTION='https://www.paypal.com/cgi-bin/webscr' METHOD='POST'>
<INPUT TYPE='hidden' NAME='cmd' VALUE='_xclick'>
<INPUT TYPE='hidden' NAME='business' VALUE='{$set['pp_paymentemail']}'>
<INPUT TYPE='hidden' NAME='quantity' VALUE='1'>
<INPUT TYPE='hidden' NAME='item_name' VALUE='{$set['outsideads']}'>
<input type='hidden' name='amount' value='{$price}' >
<INPUT TYPE='hidden' NAME='no_shipping' VALUE='1'>
<INPUT TYPE='hidden' NAME='notify_url' VALUE=''>
<INPUT TYPE='hidden' NAME='currency_code' VALUE='USD'>
<INPUT TYPE='image' SRC='http://www.paypal.com/en_US/i/btn/x-click-but01.gif' BORDER='0' NAME='submit' ALT='Make payments with PayPal - it's fast, free and secure!'>
</FORM>";
}
} else {
if($set['ap_enabled']) {

$contents .= "
<table>
<tr>
	<td><img src='themes/GeN3/images/chart.png' align='center'></td>
	<td><h3><font>Recharge</font></h3></td>
</tr>
</table>
<br />
<br />
<table width='600' border='1'>
<tr>
<td>Once payment is completed, we will have your advertisement up within 24 hours and then you can start clicking ads.<br /><br />
    <p align='left'><strong>ADS PACKAGE VALIDATION </strong></p>
<p align='left'>100 click = 10 days | 200 click = 20 days | 300 click = 30 days | 400 click = 40 days</p>
<p align='left'>500 click = 50 days | 1000 click = 100 days | 10,000 click = 1000 days</p>
<p align='left'><b>Note:</b> Use your current set Alertpay payment E-mail.</p><br /><br /></td>
</tr>
<tr>
	<td>
		<form method='post' name='ap'>
		<input type='hidden' name='ap' value='1'>
			<table width='675'>
				<tr>
					<td align='center' colspan='2'>
						<b><font size='2'>Pay with Alertpay</b></font>
					</td>
				</tr>
				<tr>
					<td width='213'>
						Your Payment E-mail:						</td>
					<td width='457'>
						<input type='text' name='email' value='' size='35' />
				  </td>
				</tr>
				<tr>
					<td>
						Your Website Name:
					</td>
					<td>
						<input type='text' name='name' value='' size='35' />
					</td>
				</tr>
				<tr>
					<td>
						Your Website URL:
					</td>
					<td>
						<input type='text' name='url' value='' size='35' />
					</td>
				</tr>
				<tr>
					<td>
						Your Website Description (<b>\${$set['desc_link_price']}</b>):
					</td>
					<td>
						<input type='text' name='desc' value='' size='35' />
					</td>
				</tr>
				<tr>
					<td>
						Click Package:
					</td>
					<td>
						<select name='clicks' value=''>";
						$a = mysql_query("SELECT * FROM ad_packages");
						while($b=mysql_fetch_array($a))
						{
							$contents .= "<option value='{$b['clicks']}'>".number_format($b['clicks'])." clicks - \$".number_format($b['price'],2)."</option>";
						}
						$contents .= "
						</select>
					</td>
				</tr>
				<tr>
					<td>
						Category:
					</td>
					<td>
						<select name='cat' value=''>";
						$c = mysql_query("SELECT * FROM ad_catagories");
						while($d=mysql_fetch_array($c))
						{
							$contents .= "<option value='{$d['ac_name']}'>{$d['ac_name']}</option>";
						}
						$contents .= "
						</select>
					</td>
				</tr>
				<tr>
					<td>
						Bold (<b>\${$set['bold_link_price']}</b>):
					</td>
					<td>
						<input type='checkbox' name='bold' value='1' {$ppauto}>
					</td>
				</tr>
				<tr>
					<td>
						Highlight (<b>\${$set['highlight_link_price']}</b>):
					</td>
					<td>
						<input type='checkbox' name='highlight' value='1' {$ppauto}>
					</td>
				</tr>
		  </table>
			<center><input type='submit' value='Submit Alertpay Order'></center>
		</form>
	</td>
</tr>
</table>";
if($set['pp_enabled']) {
$contents .= "
<br /><br />
<table>
<tr>
	<td>
		<form method='post'>
		<input type='hidden' name='pp' value='1'>
			<table>
				<tr>
					<td align='center' colspan='2'>
						<b><font size='2'>Pay with Paypal</b></font>
					</td>
				</tr>
				<tr>
					<td>
						Your Payment Email:
					</td>
					<td>
						<input type='text' name='email' value='' size='35' />
					</td>
				</tr>
				<tr>
					<td>
						Your Website Name:
					</td>
					<td>
						<input type='text' name='name' value='' size='35' />
					</td>
				</tr>
				<tr>
					<td>
						Your Website URL:
					</td>
					<td>
						<input type='text' name='url' value='' size='35' />
					</td>
				</tr>
				<tr>
					<td>
						Your Website Description (<b>\${$set['desc_link_price']}</b>):
					</td>
					<td>
						<input type='text' name='desc' value='' size='35' />
					</td>
				</tr>
				<tr>
					<td>
						Click Package:
					</td>
					<td>
						<select name='clicks' value=''>";
						$a = mysql_query("SELECT * FROM ad_packages");
						while($b=mysql_fetch_array($a))
						{
							$contents .= "<option value='{$b['clicks']}'>".number_format($b['clicks'])." clicks - \$".number_format($b['price'],2)."</option>";
						}
						$contents .= "
						</select>
					</td>
				</tr>
				<tr>
					<td>
						Category:
					</td>
					<td>
						<select name='cat' value=''>";
						$c = mysql_query("SELECT * FROM ad_catagories");
						while($d=mysql_fetch_array($c))
						{
							$contents .= "<option value='{$d['ac_name']}'>{$d['ac_name']}</option>";
						}
						$contents .= "
						</select>
					</td>
				</tr>
				<tr>
					<td>
						Bold (<b>\${$set['bold_link_price']}</b>):
					</td>
					<td>
						<input type='checkbox' name='bold' value='1' {$ppauto}>
					</td>
				</tr>
				<tr>
					<td>
						Highlight (<b>\${$set['highlight_link_price']}</b>):
					</td>
					<td>
						<input type='checkbox' name='highlight' value='1' {$ppauto}>
					</td>
				</tr>
			</table>
			<center><input type='submit' value='Submit Paypal Order'></center>
		</form>
	</td>
</tr>
</table>
";
}
$contents .= "";
} else {
$contents .= "Sorry, outside advertising is currently unavailable.";
}
}
} else {
$contents .= "You must be logged OUT to advertise this way. If you wish to advertise, please go to the advertise panel in your account.";
}
?></div>

 

 

when ever any LOGGED IN user visit this page namely recharge.php , this page show that

 

"You must be logged OUT to advertise this way. If you wish to advertise, please go to the advertise panel in your account."

 

 

Now i don't want this error,

 

i want that when any LOGGED IN user visit this page , it would appear as it appeared for LOGGED OUT user.

 

Please help me in it

 

THANKS

Shayan

 

Link to comment
Share on other sites

It appears that you have a broken if {} else {} ....

   </form>
      </td>
   </tr>
</table>
";
}
$contents .= ""; //<----- Here -----------<<
} else {
   $contents .= "Sorry, outside advertising is currently unavailable.";
   }
   }
} else {
$contents .= "You must be logged OUT to advertise this way. If you wish to advertise, please go to the advertise panel in your account.";
}
?></div>

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.