Jump to content

Need help with using Post Back! Willing to make a great deal


raven2424

Recommended Posts

hey guys i am not sure if i posted this in the right place but here it goes i have a script and im trying to get post back to work correctly and so far i have everything set up and spent hours doing so now i am hung up on this post back.

 

If there is anyone here who has a lot of experience with this and can help please reply here or PM me i am willing to make a awesome deal!!  :D

not looking to hire someone just barter basicly if i can get this set up i can then pay them.

 

Basicly i am working with offer script and when the user gets credit for a action they will earn points so the postback would update my site to show how much they earned so far

below is the code for my postback.php file which i named back.php and well it worked fine with this old link code

 

<script type="text/javascript" src="http://data.xxxxxx.com/asd/asd_load.php?pub=1369&subid=<?echo $m_id;?>"></script>

 

 

but there new code looks like this

 

<script type="text/javascript" src="http://www.xxxxxx.com/mygateway.php?pub=1369&gateid=MTcxODM%3D"></script>

 

so i added

 

&subid=<?echo $m_id;?>

 

to get

 

<script type="text/javascript" src="http://www.xxxxxx.com/mygateway.php?pub=1369&gateid=MTcxODM%3D&subid=<?echo $m_id;?>"></script>

 

and it never worked...

 

this is the advice that they have for using post backs

 

3. Create the necessary scripts on your website to interact with our system. Determine a filename for the script you intend our server to call after a survey is successfully completed. Input full path to file in the "Server URL" field. Example: http://www.yousite.com/my-postback.php 

 

4. To secure postback, we recommend using a password, Input this password into the 'Password' field.

 

5. To pass subid, use &subid=SUBIDHERE on your script src tag. Example: <script src="http://www.xxxxx.com/mygateway.php?pub=007&gateid=MTIyNjI%3D&subid=SUBIDHERE" language="JavaScript" type="text/javascript"></script>

 

hope this helps or we can get somewere with this

 

 

<?

include ("includes/store_security.php");

// get user information

//print_r($_REQUEST);


// amount earned by formula

$pdtshow = $_REQUEST["pdtshow"];

$password = $_REQUEST["password"];

//user id

$subid = $_REQUEST["subid"];

// earnings in dollar amount

$earn = $_REQUEST["earn"];

// name of survey

$survey = addslashes($_REQUEST["survey"]);

// numeric id of survey

$survid = $_REQUEST["survid"];

// bypass

$pdtshow = $earn * 10;

$pdtshow = round($pdtshow);

// make sure password matches

if ($password != "d3f4g5h6") {

$message = "Security Error";

header("location: index.php?message=$message");

exit;


} else {



// insert into transaction table

$sql="INSERT INTO tbl_trans(user_id, survid, survey, earn, pdtshow, date) VALUES ('$subid', '$survid', '$survey', '$earn', '$pdtshow', NOW())";

//echo $sql;

$result=mysql_query($sql,$conn);




// update user points

if ($pdtshow > 0) {

// get current points


$sql="SELECT * FROM tbl_user WHERE id ='$subid'";
$result=mysql_query($sql,$conn);

//echo $sql;

while ($row = mysql_fetch_array($result)) {

// display list

$m_id = $row["id"];

$points = $row['points'];

$all_time_points = $row['all_time_points'];

}


$total = $points + $pdtshow;

$total_all_time_points = $all_time_points + $pdtshow;




// update points


$sql="UPDATE tbl_user SET points = '$total', all_time_points = '$total_all_time_points' WHERE id ='$subid'";
$result=mysql_query($sql,$conn);


$message = "You've earned $pdtshow points!";

header("location: earn.php?message=$message");




}



}









?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.