Page 1 of 2

need help on hph paypal page will not work with firfox

Posted: Mon Dec 15, 2008 3:54 pm
by gene4848
Hi any have some kind of a snaplet code for my php paypal page for payments ,note it works fine with Internet Explorer browser ,but when you pull it up and hit the xclick botton in Mozilla Firefox all you get is a blank screen must be some kind of a code to put in there so it will work with both please help ,below is the php page:
tags
<?
session_start();
include("include/conn.php");

$sql = "SELECT MAX(siteid) AS siteid FROM tmp_ad";
$row = mysql_query($sql) or die(mysql_error());
$qr = mysql_fetch_array($row);
$orderID = $qr['siteid'];
setcookie('tempID', $orderID, time()+60*60*24*60, '/');

$sql = "SELECT * FROM packages where packageid = " . $_GET["pkid"];
$row = mysql_query($sql) or die(mysql_error());
$qr = mysql_fetch_array($row);
$pakcagename= $qr["title"];
$pakcageid= $qr["packageid"];
$amount = $qr['amount'];
$credits = $qr['no_days'];

if($amount == 0){

mysql_query("update users set package = $credits ,no_credits = no_credits + ". $credits . " WHERE email='".$_SESSION['session_login']."'") or die(mysql_error());
mysql_query("insert into payment (date,email,amount,credits) values ('". date('d.m.Y') ."','" . $_SESSION["session_login"] . "', 0, " . $credits . ")")or die(mysql_error());

header("Location:ad_advertisment.php");
}

$sql = "SELECT * FROM paymentinfo";
$row = mysql_query($sql) or die(mysql_error());
$qr = mysql_fetch_array($row);
$_SESSION["paynow"]="true";
?>
<form name="frm1" action="https://www.paypal.com/cgi-bin/webscr" method="POST" >

<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<?=$qr['payemail']?>">
<input type="hidden" name="item_name" value="<?=$pakcagename?>">
<input type="hidden" name="item_number" value="<?=$pakcageid?>">
<input type="hidden" name="amount" value="<?=@$amount?>">
<input type="hidden" name="return" value="<?=$qr['surl']?>/quote_thanks.php">
<input type="hidden" name="cancel_return" value="<?=$qr['surl']?>/quote_cancel.php">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="custom" value="<?=@$credits?>">
<input type="hidden" name="currency_code" value="USD">
</form>
<SCRIPT LANGUAGE=javascript>
document.frm1.submit();
</SCRIPT>

Re: need help on hph paypal page will not work with firfox

Posted: Mon Dec 15, 2008 4:10 pm
by cavemaneca
Make sure all of the proper settings are set up in Firefox to allow it to run, and edit your post to put the at the end of the section of code, not the beginning.

Re: need help on hph paypal page will not work with firfox

Posted: Mon Dec 15, 2008 4:27 pm
by gene4848
Im not following? what code do I include in the page to allow it to work in firefox?? firefox says conection not encrypted

Re: need help on hph paypal page will not work with firfox

Posted: Mon Dec 15, 2008 4:47 pm
by cavemaneca
I was saying that when you post code here, put the code between the tags, not after them. Also, your Firefox browser may have something disabled or the code uses IE exlusive features.

Re: need help on hph paypal page will not work with firfox

Posted: Mon Dec 15, 2008 4:58 pm
by gene4848
firefox says page or conection not encrypted

Re: need help on hph paypal page will not work with firfox

Posted: Mon Dec 15, 2008 5:10 pm
by cavemaneca
Don't use php shortcode
it should be <?php echo $var;?> not <?=$var?> on all of the inputs

Re: need help on hph paypal page will not work with firfox

Posted: Mon Dec 15, 2008 5:28 pm
by gene4848
sorry not sure what you mean can you resend the code the right way??

Re: need help on hph paypal page will not work with firfox

Posted: Mon Dec 15, 2008 7:09 pm
by cavemaneca
NOTE: This is also an example of how you SHOULD be posting your code, (i.e. going to the top and editing your first post putting the at the end)

Code: Select all

<?php
session_start();
include("include/conn.php");
 
$sql = "SELECT MAX(siteid) AS siteid FROM tmp_ad";
$row = mysql_query($sql) or die(mysql_error());
$qr = mysql_fetch_array($row);
$orderID = $qr['siteid'];
setcookie('tempID', $orderID, time()+60*60*24*60, '/');
 
$sql = "SELECT * FROM packages where packageid = " . $_GET["pkid"];
$row = mysql_query($sql) or die(mysql_error());
$qr = mysql_fetch_array($row);
$pakcagename= $qr["title"];
$pakcageid= $qr["packageid"];
$amount = $qr['amount'];
$credits = $qr['no_days'];
 
if($amount == 0){
 
mysql_query("update users set package = $credits ,no_credits = no_credits + ". $credits . " WHERE email='".$_SESSION['session_login']."'") or die(mysql_error());
mysql_query("insert into payment (date,email,amount,credits) values ('". date('d.m.Y') ."','" . $_SESSION["session_login"] . "', 0, " . $credits . ")")or die(mysql_error());
 
header("Location:ad_advertisment.php");
}
 
$sql = "SELECT * FROM paymentinfo";
$row = mysql_query($sql) or die(mysql_error());
$qr = mysql_fetch_array($row);
$_SESSION["paynow"]="true";
?>
<form name="frm1" action="https://www.paypal.com/cgi-bin/webscr" method="POST" >    
 
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<?php echo $qr['payemail']; ?>">
<input type="hidden" name="item_name" value="<?php echo $pakcagename; ?>">
<input type="hidden" name="item_number" value="<?php echo $pakcageid; ?>">
<input type="hidden" name="amount" value="<?php echo @$amount; ?>">
<input type="hidden" name="return" value="<?php echo $qr['surl']; ?>/quote_thanks.php">
<input type="hidden" name="cancel_return" value="<?php echo $qr['surl']; ?>/quote_cancel.php">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="custom" value="<?php echo $credits; ?>">
<input type="hidden" name="currency_code" value="USD">
</form>
<SCRIPT LANGUAGE=javascript>
document.frm1.submit();
</SCRIPT>

Re: need help on hph paypal page will not work with firfox

Posted: Mon Dec 15, 2008 7:56 pm
by gene4848
Hi thankyou for helping but same thing works with explorer but not with firefos just blank :cry:

Re: need help on hph paypal page will not work with firfox

Posted: Mon Dec 15, 2008 8:19 pm
by cavemaneca
Then I would just have to say you have something wrong with your firefox. Try giving us a link to the page and I'll see if it works in my firefox, or google chrome.

Re: need help on hph paypal page will not work with firfox

Posted: Mon Dec 15, 2008 8:40 pm
by gene4848
hERE IS OUR PAGE :http://www.copylathe.com/post/index.php PLEASE NOTE TO GET THE pay option you have to regester for free ,youl get an admin pannel click plase an ad youl see option to buy click that do,nt worry as long as you do,nt go through the paypal process all the way you wo,nt get charged ) try that in firefox

Re: need help on hph paypal page will not work with firfox

Posted: Mon Dec 15, 2008 8:47 pm
by gene4848
also have one more bug in the number of credits when you click on the number link i get this message :You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 not sure where the problem is

Re: need help on hph paypal page will not work with firfox

Posted: Mon Dec 15, 2008 8:49 pm
by gene4848
Package Name No of Credits Price Pic.View Detail
its when you click on number for details:
50 Posts 30days ea. 50 $100 Buy Now

One post 30 days 1 $12 Buy Now

127 posts 30 days ea 127 $127 Buy Now

Ten PostS 30days ea 10 $40 Buy Now

25 Posts 30days ea 25 $75 Buy Now

Re: need help on hph paypal page will not work with firfox

Posted: Mon Dec 15, 2008 9:04 pm
by cavemaneca
Post your other script here too so we can see it. also, for the first problem, I check it in chrome and it worked, as well as IE. As you said firefox did not work. I think there is a problem with the script at the bottom that autosubmits.

Change it to this(the only change is at bottom) or find a different script at the end that will work with firefox.

Code: Select all

<?php
session_start();
include("include/conn.php");
 
$sql = "SELECT MAX(siteid) AS siteid FROM tmp_ad";
$row = mysql_query($sql) or die(mysql_error());
$qr = mysql_fetch_array($row);
$orderID = $qr['siteid'];
setcookie('tempID', $orderID, time()+60*60*24*60, '/');
 
$sql = "SELECT * FROM packages where packageid = " . $_GET["pkid"];
$row = mysql_query($sql) or die(mysql_error());
$qr = mysql_fetch_array($row);
$pakcagename= $qr["title"];
$pakcageid= $qr["packageid"];
$amount = $qr['amount'];
$credits = $qr['no_days'];
 
if($amount == 0){
 
mysql_query("update users set package = $credits ,no_credits = no_credits + ". $credits . " WHERE email='".$_SESSION['session_login']."'") or die(mysql_error());
mysql_query("insert into payment (date,email,amount,credits) values ('". date('d.m.Y') ."','" . $_SESSION["session_login"] . "', 0, " . $credits . ")")or die(mysql_error());
 
header("Location:ad_advertisment.php");
}
 
$sql = "SELECT * FROM paymentinfo";
$row = mysql_query($sql) or die(mysql_error());
$qr = mysql_fetch_array($row);
$_SESSION["paynow"]="true";
?>
<form name="frm1" action="https://www.paypal.com/cgi-bin/webscr" method="POST" >   
 
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<?php echo $qr['payemail']; ?>">
<input type="hidden" name="item_name" value="<?php echo $pakcagename; ?>">
<input type="hidden" name="item_number" value="<?php echo $pakcageid; ?>">
<input type="hidden" name="amount" value="<?php echo @$amount; ?>">
<input type="hidden" name="return" value="<?php echo $qr['surl']; ?>/quote_thanks.php">
<input type="hidden" name="cancel_return" value="<?php echo $qr['surl']; ?>/quote_cancel.php">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="custom" value="<?php echo $credits; ?>">
<input type="hidden" name="currency_code" value="USD">
If This Page Does Not Change In Five Seconds, Click This Button
<input type="submit">
</form>
<SCRIPT LANGUAGE=javascript>
document.frm1.submit();
</SCRIPT>

Re: need help on hph paypal page will not work with firfox

Posted: Mon Dec 15, 2008 9:12 pm
by gene4848
heres the other one :



<?php
session_start();
if(!isset($_SESSION['session_login']) || $_SESSION['session_login'] == "")
header("Location:loginform.php?errFlag=1");

require("include/conn.php");

?>
<html>
<head>
<title>Online Classifieds; Add Advertisment</title>
<link href="include/style.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#ffffff" style="text-align: center" topmargin="0">
<table width="780" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2"><?php include("include/top.php"); ?></td>
</tr>
<tr>
<td width="224" valign="top" bgcolor="#E8E3E8"><? require("include/left.php");?></td>
<td width="560" valign="top">
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="0" class="brd">
<tr>
<td bgcolor="#B3A2B2" class="whitetxt">Select Package</td>
</tr>
<?

/* $sql = "SELECT * FROM page_text WHERE page_id=1";
$result = mysql_query($sql) or die(mysql_error());
$qr = mysql_fetch_array($result);
$page_text = $qr['page_text'];
*/
?>
<tr>
<td height="23"><br><form action="save_ad.php" method="post" name="frm_ad" onSubmit="return validateForm(this);">
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="0" class="brd">
<tr bgcolor="#E0D2DF">
<td width="33%" class="blacktxt">Package Name</td>
<td width="28%" class="blacktxt"><div align="center">No of Credits</div></td>
<td width="12%" class="blacktxt">Price</td>
<td class="blacktxt"><div align="center">Pic.View Detail </div></td>
</tr>
<?
$result=mysql_query("Select * from packages order by amount asc");
$rc=mysql_num_rows($result);
while($qr = mysql_fetch_array($result)) {
?>
<tr>
<td height="5" colspan="4"></td>
</tr>
<tr class="leftlinks">
<td><? echo $qr["title"];?> </td>
<td><div align="center"><a href="detail.php?sid=<? echo $qr['siteid)'];?>" class="leftlinks">
<? echo $qr['no_days'];?>
</a></div></td>
<td>$<?=$qr['amount']?>
</td>
<td><div align="center"><A href="paypal.php?pkid=<? echo $qr["packageid"];?>"><font color="#000000">Buy
Now</font></A></div></td>
</tr>
<? }?>
</table>
</form></td>
</tr>
<tr>
<td class="leftlinks">&nbsp;</td>
</tr>
<tr>
<td align="right"></td>
</tr>
</table>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br></td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2" bgcolor="#E0D2DF"><? require("include/footer.php");?></td>
</tr>
</table>
</body>
</html>