Jump to content

Search the Community

Showing results for tags 'php'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Found 905 results

  1. rmarsh9374

    Php Ipn Listener For Paypal

    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);}?>
  2. attila2452

    Flickr Sets.

    How do i use flicker sets on my portfolio under portfolio.like this : http://jontangerine.com/about/aside/ how do i do that with my portfolio but able to style it to this: http://attilahajzer....?page=portfolio when i click the picture it opens in a new tab. i know how to link like target="_Blank" and all. just how do i set up the api and style it how i want? i would like to use my Web Design Set as my portfolio.
  3. Howdy_McGee

    Advanced Php Tutorial

    I know the basics of PHP and MYSQL but I can't seem to get down putting it all together in order to make an admin panel / website backend. I was wondering if anyone knew of any specific tutorials that covered creating admin panels / website backends so I could get a feel of what I'm doing right and what I'm doing wrong.
  4. Hi i'm a newbie in this forum i like W3S is the best page ever for learning and be a web developer and i need help... how do i know if a filed is empty on php & mysql block code and make a redirection on the same page or other files for example... if we have a form called and have this code <html><body><form action="insert.php" method="post">Firstname: <input type="text" name="firstname" />Lastname: <input type="text" name="lastname" />Age: <input type="text" name="age" /><input type="submit" /></form></body></html> and then we have this file call it <?php$con = mysql_connect("localhost","peter","abc123");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("my_db", $con);$sql="INSERT INTO Persons (FirstName, LastName, Age)VALUES('$_POST[firstname]','$_POST[lastname]','$_POST[age]')";if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); }echo "1 record added";mysql_close($con)?> and if a have fristname as a UNIQUE field in mysql... how do i know if a field is empty and make a redirection to a pages or file? (that includes same files on your root folder) i hope that you help me thx
  5. justsomeguy

    PHP Tips and Tutorials

    Please send me a PM with any comments, corrections, additions, or requests. Please do not reply to this topic. Replies will be deleted to avoid clutter.Official PHP site: http://www.php.net/PHP Installation Packages: http://www.php.net/downloads.phpPHP Installation Instructions: http://www.php.net/manual/en/install.general.phpPHP Online Manual: http://www.php.net/manual/note: links given to the manual are in English, but the manual can be read in several languagesPlease send me a PM to request specific topics.