Advertisement
Advertisement
| 07.13.2008 at 09:19PM PDT, ID: 23561677 | Points: 500 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: |
// Input Form Fields
<p align='Center'>
<form action="createpages.php">
PayPal email:<br>
<input type="Text" name="email"><br><br>
File name:<br>
<input type="Text" name="filename"><br><br>
Name of product:<br>
<input type="Text" name="sys_item_name"><br><br>
Personal Identifier (Product ID) of product:<br>
<input type="Text" name="sys_item_number"><br><br>
Price of product:<br>
<input type="Text" name="sys_item_cost"><br><br>
Thank You page URL:<br>
<input type="Text" name="sys_item_download_url"><br><br>
PayPal Cancel URL:<br>
<input type="Text" name="sys_item_cancel_url"><br><br>
Exact Ebook Download location<br>
<input type="Text" name="DLURL"><br><br>
<input type="reset" name="Clear">
<input type="submit" name="Submit">
</form>
</p>
// =======================================
//======================================================
// createpages.php below:
<?php
// Get data from previous input form,
// then create and write the file...
$order_contents="
// PayPal Email Address<br>
$email=$_GET["email"];<br>
// THIS is what the NEW file name will be (.php)<br>
$filename=$_GET["filename"];<br>
// Product Name<br>
$sys_item_name=$_GET["sys_item_name"];
// Product Number specified on the previous form<br>
$sys_item_number=$_GET["sys_item_number"];<br>
// Cost of Item<br>
$sys_item_cost=$_GET["sys_item_cost"];<br>
// Login page to product<br>
$sys_item_download_url=$_GET["sys_item_download_url"];<br>
// Where user will go if they press cancel instead of ordering<br>
$sys_item_cancel_url=$_GET["sys_item_cancel_url"];<br><br>
// This is the EXACT URL for the .pdf file.<br>
// All of the stuff below must be sent to the "order[filename].php" file:
// basically, the file should show the $var="actual var" with
// the above examples...
// and what is written below:
$email = urlencode($email);<br>
$sys_item_name = urlencode($sys_item_name);<br>
$sys_item_number = urlencode($sys_item_number);<br>
$sys_item_cost = urlencode($sys_item_cost);<br>
//$sys_item_download_url = urlencode($sys_item_download_url . "?orderid=" . time());<br>
$sys_item_download_url = urlencode($sys_item_download_url);<br>
$sys_item_cancel_url = urlencode($sys_item_cancel_url);<br><br>
header("Location: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=$email&item_name=$sys_item_name&item_number=$sys_item_number&amount=$sys_item_cost&no_shipping=2&return=$sys_item_download_url&cancel_return=$sys_item_cancel_url&no_note=1¤cy_code=USD&lc=US&bn=PP%2dBuyNowBF&charset=UTF%2d8");<br>
exit;<br>
"
// now, create order$filename.php and write $order_contents to the file.
// End of "order[filename].php content,
// create and write file code goes here!
//======================================================
// now, let's move on to login[filename].php
$login_contents="<?
session_start();
if($_POST["submit"]) {
// Load up from POST
$email=$_POST['email'];
$_SESSION['email'] = $email;
//echo "Session is set as - $_SESSION[\'email\']";
// Validate Email Address
if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
if (isset($_SESSION['email'])) {
// echo "Valid email address.";
header ("Location: http://test.com/gateway + . + $filename");
exit;
} else {
// echo "Invalid email address.";
die("you must log in.");
}
}
} ELSE {
?>
<HTML>
<head>
<meta name="robots" content="noindex,nofollow">
<title>Login to ebook</title>
</head>
<BODY>
<p>Please Enter Your email Address to access Your Ebook<br>
(it MUST Be a VALID Email Address)</p>
<form action="<?php print $_SERVER["PHP_SELF"]; ?>" method="post">
<input type="text" name="email" size="15" maxlength="150">
<input type="hidden" name="submit" value="Submit">
<input type="submit" name="submit" value="Submit">
<input type="reset"></div>
</form>
</body>
</html>
<? } ?> "
// now, create login$filename.php and write $login_contents to the file.
//======================================================
// next, let's move on to gateway[filename].php
$gateway_contents="<?
//php sessions code goes here!
session_start();
$ip = $_SERVER['REMOTE_ADDR'];
$fullhost = gethostbyaddr($ip);
$host = preg_replace("/^[^.]+./", "*.", $fullhost);
// Build message parts
$recipient = "$email";
$headers .= "From: Gateway$filename <$email>\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
if (isset($_SESSION['email'])) {
$email = $_SESSION['email'];
$subject = "Gateway$filename has been Accessed.";
$message = "Gateway$filename has been Accessed by IP address: $ip - | Host: $host.<br>with the following email address: $email";
$message = stripslashes($message);
// Send mail
mail($recipient,$subject,$message,$headers);
?>
<HTML>
<meta name="robots" content="noindex,nofollow">
<BODY>
<p>Would You like to Download the file or read it online?
<p>Please Choose by clicking the appropriate link below.
<p>Click This Link to Download Your Ebook:<br>
<a href="$filenamedl.php">$sys_item_name</a>
<p>
<p>Please forward any Technical Difficulties to <a href="mailto:$email">Here by Clicking This Link</a>
<p>Enjoy!
</BODY>
</HTML>
<?
} ELSE {
$ip = $_SERVER['REMOTE_ADDR'];
$cname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$fullhost = gethostbyaddr($ip);
$host = preg_replace("/^[^.]+./", "*.", $fullhost);
echo "You are not authorized to view this page.<br>";
echo "Your IP Address <font color='red'><b> $ip </b></font>has been Logged.<br>";
echo "Your Host is: <font color='red'><b> $host </b></font>.<br>";
$subject = "Gateway$filename Access Attempt.";
$message = "Someone has attempted to access Gateway$filename by IP address: $ip - | Host: $host.<br>without entering a Valid Email Address.";
$message = stripslashes($message);
// Send mail
mail($recipient,$subject,$message,$headers);
}
?>"
// k, now, create gateway$filename.php and write $gateway_contents to the file.
//======================================================
// k, finally, let's move on to [filename]dl.php
$DLURL=$_GET["DLURL"];
$dlcontents="
<?
//php sessions code goes here!
session_start();
if (isset($_SESSION['email'])) {
$path="./$DLURL";
header("Content-Type: application/force-download");
header("Content-Transfer-Encoding: binary");
header('Content-Length: '.filesize($path));
header("Content-Disposition: attachment; filename=\"" . basename($path) . "\"");
header('Pragma: no-cache');
readfile($path);
} ELSE {
$ip = $_SERVER['REMOTE_ADDR'];
$cname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$fullhost = gethostbyaddr($ip);
$host = preg_replace("/^[^.]+./", "*.", $fullhost);
echo "You are not authorized to view this page.<br>";
echo "Your IP Address <font color='red'><b> $ip </b></font>has been Logged.<br>";
echo "Your Host is: <font color='red'><b> $host </b></font>.<br>";
}
?>
"
// k, now, create $filenamedl.php and write $dlcontents to the file.
// end of procedures
//======================================================
?>
|