raven2424 Posted November 25, 2009 Share Posted November 25, 2009 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!! Link to comment https://forums.phpfreaks.com/topic/182968-need-help-with-using-post-back-willing-to-make-a-great-deal/ Share on other sites More sharing options...
Goldeneye Posted November 26, 2009 Share Posted November 26, 2009 What do you mean by "post back"? Are you talking about using $_POST variables? Also, if you are looking to hire someone, you will have better luck of doing so in the PHPFreaks Freelance Forum. Link to comment https://forums.phpfreaks.com/topic/182968-need-help-with-using-post-back-willing-to-make-a-great-deal/#findComment-965739 Share on other sites More sharing options...
raven2424 Posted November 26, 2009 Author Share Posted November 26, 2009 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 Link to comment https://forums.phpfreaks.com/topic/182968-need-help-with-using-post-back-willing-to-make-a-great-deal/#findComment-965740 Share on other sites More sharing options...
Goldeneye Posted November 26, 2009 Share Posted November 26, 2009 This is essentially an advice/correction forum. I think I understand what you want, but in order to give you any advice relevant to you, you'll have to post some code. Link to comment https://forums.phpfreaks.com/topic/182968-need-help-with-using-post-back-willing-to-make-a-great-deal/#findComment-965760 Share on other sites More sharing options...
raven2424 Posted November 26, 2009 Author Share Posted November 26, 2009 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"); } } ?> Link to comment https://forums.phpfreaks.com/topic/182968-need-help-with-using-post-back-willing-to-make-a-great-deal/#findComment-965772 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.