Jump to content


  • Posts

  • Joined

  • Last visited

rmarsh9374's Achievements


Newbie (1/7)



  1. I am new to this. I am working on a project for my small company.The project is printable contracts. So far I have used PHP and Mysql to collect the data and then put in into a html page for out put (print). I am trying to us CSS to format the pages for print and have a few snags. For the most part it looks good. Except some of the browers are ignoring my page breaks. Any Idea why? Is there a better way? <div style="page-break-after:always"></div> Is there a way to set margins? I've only begun to learn CSS, PHP and Mysql, so if there is a bettter way to do what i want please tell me. ThanksRyan
  2. Thanks for the input, somthing must have happened with the cut/past. Theextra stuff in the code is not there in my "origional".Should look like this:$boss_email = 'boss@mycompany.com';//show me the errors Didn't think about the error message, i'm just use to it being there from my other pages, I'll work it in thanks. What else have I missed? Thanks so much for the help so far
  3. I am new to PHP and really enjoying learning it. I am stuck on a key part of my project for my small company. I am trying to learn how the IPN Listener for Paypal works. They provided an example in PHP. So I figured i'd modify it to send me an email when a person does a "normal" purchase. After I got that working I'd take that and work it into the project. I got a responce from the IPN Listnener when I had a typo in the url to send info back to Paypal for varification, but once I fixed that I have got nothing. I am sure I am making a lot of Noobie mistakes in it, please help me learn. I've been looking at it so long I am lost as how to fix it. Ryan (The project will in the end take the verified message from Paypal and pull information from the db and put in a file and email it to the client.) below is my code: <?php$dvd_purchase = TRUE;//variables to compaire against IPN information$dvd_cost = 149.00;$test_custom = 25;$boss_email = 'boss@mycompany.com';//Showme the errorsini_set ('display_error', 1);error_reporting (E_ALL | E_STRICT);// read the post from paypal systemand add 'cmd'$req = 'cmd=_notify-validate';foreach ($_POST as $key => $value) { $value = urlencode (stripslashes ($value)); $req .= "&$key=$value";}//postback to Paypal system to validate$header = '';$header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";$header .= "Content-Type: application/x-www-form-urlencoded\r\n";$header .= "Content-Length: " . strlen($req) . "r\n\r\n";//$fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);$fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30);//assign posted variables to local variablesif (isset($_POST['item_name'])){$item_name = $_POST['item_name'];}if (isset($_POST['item_number'])){$item_number = $_POST['item_number'];}if (isset($_POST['payment_status'])){$payment_status = $_POST['payment_status'];}if (isset($_POST['mc_gross'])){$payment_amount = $_POST['mc_gross'];}if (isset($_POST['txn_id'])){$txn_id = $_POST['txn_id'];}if (isset($_POST['receiver_email'])){$receiver_email = $_POST['receiver_email'];}if (isset($_POST['payer_email'])){$payer_email = $_POST['payer_email'];}if (isset($_POST['custom'])){$custom = $_POST['custom'];}if (!$fp) { // HTTP ERROR $to= myemail@mycompany.com; $subject= "DVD Order Could Not Connect to PayPal!"; $message= "PayPal connection failed ". "\r\n" . $from = "IPN"; $headers = "From: $from" . "\r\n"; mail($to,$subject,$message,$headers);} else { fputs ($fp, $header . $req); while (!feof($fp)) { $res = fgets ($fp, 1024); if (strcmp ($res, "VERIFIED") ==0) { if ($payment_amount != $dvd_cost){ $dvd_purchase = FALSE; } if ($custom != $test_custom){ $dvd_purchase = FALSE; } if ($receiver_email != $boss_email){ $dvd_purchase = FALSE; } if ($dvd_purchase = TRUE){ //Email me it is ok. $to= myemail@mycompany.com; $subject= "DVD Order Good to Go!"; $message= "DVD ORDER: "."$payer_email". "\r\n" . "Iten Name: " ."$item_name". "\r\n" . "Iten Number: " ."$item_number". "\r\n" . "Payment status: " ."$payment_status". "\r\n" . "Payment Amount: " ."$payment_amount". "\r\n" . "Transaction ID: " ."$txn_id". "\r\n" . "receiver_email: " ."$receiver_email". "\r\n" . "payer_email: " . "$payer_email" . "\r\n"; $from = "$payer_email"; $headers = "From: $from" . "\r\n"; mail($to,$subject,$message,$headers); } if ($dvd_purchase = FALSE){ $to= myemail@mycompany.com; $message = "Somthing is off:"."$payment_amount". "\r\n". "$custom"."\r\n". "$receiver_email"."\r\n"; $from = "IPN"; $headers = "From: $from" . "\r\n"; mail($to,$subject,$message,$headers); } } else if (strcmp ($res, "INVALID") ==0) { //log for manual investigation $to= "myemail@mycompany.com"; $subject= "DVD Order IPN Verification Failed!"; $message= "DVD ORDER: "."$payer_email". "\r\n" . "Iten Name: " ."$item_name". "\r\n" . "Iten Number: " ."$item_number". "\r\n" . "Payment status: " ."$payment_status". "\r\n" . "Payment Amount: " ."$payment_amount". "\r\n" . "Transaction ID: " ."$txn_id". "\r\n" . "receiver_email: " ."$receiver_email". "\r\n" . "payer_email: " . "$payer_email" . "\r\n"; $from = "$payer_email"; $headers = "From: $from" . "\r\n"; mail($to,$subject,$message,$headers); } } fclose ($fp);}?>
  • Create New...