PHP - Taking Online Payments
Hi all,
first of all sorry if this is in the wrong board, im currently building a site which will charge an annual fee of X amount. I've never build something like this before so Ill be using paypal for ease of use and security, but how would you usually go about constructing the tables etc? Similar TutorialsI'm looking for a solution, i thought this was it. Im making a website that sells training videos. Each video has a producer that gets a certain percentage of the payment. Both paypal addresses are known and the percentages are known. How can I make this happen? Adaptive payments parallel payments pull up a screen that shows who is getting paid. That can't happen it needs to be under the radar. Is this possible with paypal? Thanks! Hi there, I am working on a PHP Ecommerce website. We have multiple Suppliers on the website listing their products. Now when a customer buys multiple products belonging to multiple suppliers, the payment has to go to those different respective suppliers through a single Paypal checkout. I have come to know that there is a way of doing is using Paypal Parallel payments method. Its he http://feefighters.com/blog/paypal-announces-adaptive-payments-parallel-payments-and-chained-payments-functionality-via-api/ Anybody here has a working demo of how it works. Kindly reply. Thank you! All comments feedback are always welcomed! Hey php developers. I'm Brent from Beanstream. We just recently opened up some code bounties to create a PHP SDK that uses our payment gateway API. Each bounty is around 1-5 hours work and their reward is between $150 and $400. The SDK is open source (MIT license) and will be hosted on GitHub. There are already 2 other SDKs written in Java and C# that use the same RESTful payments API, so a lot of the code and functionality can be copied over to the PHP SDK. If you are interested in helping out you can sign up here. You can also check out Beanstream's Payments API to see what the SDK will be implementing: http://developer.beanstream.com Feel free to message me if you have questions. Cheers, Brent Beanstream Internet Commerce This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=348359.0 Not sure if this is in the right forum (if not can a mod move it please).... Im creating a site that is based on a subscription basis. Therefore i need to allow the user to input their card details for me to store to allow payments every month (and also for them to update when needed). How do you recommend storing card details in the database, im guessing its not secure just to store them as plain text? Opinions needed hey guys im really just after a bit of help/information on 2 things (hope its in the right forum).
1. basically I'm wanting to make payments from one account to another online...like paypal does...im wondering what I would need to do to be able to do this if anyone can shine some light please?
2.as seen on google you type in a query in the search bar and it generates sentences/keywords from a database
example:
so if product "chair" was in the database
whilst typing "ch" it would show "chair" for a possible match
I know it would in tale sql & json but im after a good tutorial/script of some sort.
if anyone can help with some information/sites it would be much appreciated.
Thank you
I have just recently began learning PHP. I have a pretty solid foundation in general programming and PHP. As my first major PHP project I am trying to make myself an autobuyer for Fifa 15 using curt2008 Fifa API. He basically has everything there for me to use and I know that I have enough knowkledge to get a basic autobuyer going if I could just figure out how to log in. I have come to realize that the problem is that I have no idea what he is doing when he connects to the Fifa Web App. He has the code there for me, but I don't know what it is actually doing. I was hoping someone can point me to some documentation, a tutorial, or even exercises so that I may learn more about... logining into a web application? I don't even know what to call it.
Looking at connect.php he has a bunch of functions. Login, getSessionID, Phishing, getNucleusID, getShards, and all of them do a bunch a requests and use a bunch of headers. I don't know what this terminology is or how it all works together, but I would like to learn about it. Thats why I wanted to start learning PHP, for stuff like this. I just don't know where to look.
Thank You
After many, many years of struggling, I would like to finally learn how to separate my website's PRESENTATION from its LOGIC. I have been working on a startup business for over a decade now. And one of the reasons it is taking me so long to build my website from scratch is because I am a horribly INEFFICIENT PROGRAMMER!! On one hand, I think I write solid business logic. But considering that each of my scripts averages between 1,000-2,000 lines of code, that is a monster to manage. (My website is over 50,000 lines of code at this point. All home-grown and hand-coded.) While it is hard to manage things while I am actively coding, what kills me even more, is when I get pulled away for months (or recently for 2 years), and then later on when I come back, it is a nightmare to load all of that code into my brain?! I mean if you read any of my scripts starting at line 1 and going through line 1,500 I think it reads pretty well. But who in the hell can keep track of all of that in one reading? It's certainly a struggle for me!! I definitely wantto strive for more of a "component archtecture" approach. (On a side note, I have heard "good" Object-Oriented programmers claim that if a class is more than 100 lines of code then it is too long?!) So anyways.... My #1 priority for v2.0 is to learn and master separating my website's PRESENTATION from its LOGIC using something like MVC. (And after that, my goal is to finally learn and master Object-Oriented Programming, but one thing at a time!!) I want to finally learn how to program like a *professional* coder. (A very successful and RICH professional programmer!!!) ? So, can all of you gurus out there, please help me get started with a solid Model-View-Controller introduction and/or resources and/or advice?? I know the Internet is littered with this topic, but like anything done well, you need to find good learning materials and at least one or two good mentors. After all, if MVC and OOP and whatever were so easy, then everyone would be doing it, and doing it well. (And of course you realize that very few people actually do things like MVC and OOP well!!) So my goal is to become a "jedi", but I will need some good teachers to get there...
Edited February 24, 2019 by SaranacLake Type-o's and added some more stuff... I'm trying to get details of family members to display in a grouped fashion under their family, but for some reason the cell phone (mobile phone) number comes through from the query but not into the variable assignment!? I've used FirePHP to track the variable assignments and I can see that the value pulls into the query variable $per_Cellphone but not through into the array as it outputs a NULL value!? The Email works fine, just not CellPhone? $aCellPhone[$iCount] = $per_Cellphone; $aEmail[$iCount] = $per_Email; Hello, Is there any way to capture a screenshot of a full length view of a website using php on a shared hosting linux server? Hi i have the following code Code: [Select] $orderFetch->order="3"; mysql_query("UPDATE `categories` SET order=order-1 WHERE `order` > $orderFetch->order"); i wish to minus -1 from all the "order" fields in categories that are over a certain value i.e 3. But however this code is not working can anyone tell me where i'm going wrong? thank you I am trying to adapt a database search form from a tutorial I saw, and it's not working. I just get a blank white slate despite having error_reporting(E_ALL); at the top of the page. I was hoping someone might be able to spot anything obvious I might be missing. Here is my code <?php error_reporting(E_ALL); // include MySQL-processing classes require_once 'mysql.php'; try{ // connect to MySQL $db=new MySQL(array ('host'=>'localhost','user'=>'username','password'=>'password', 'database'=>'DBName')); $searchterm=$db->escapeString($_GET['searchterm']); $result=$db->query("SELECT last_name, first_name,employee_id,title,territory,districts FROM Scores WHERE MATCH(last_name,first_name,employee_id,title,territory,districts) AGAINST ('$searchterm')"); if(!$result->countRows()){ echo '<div class="maincontainer"><h2>No results were found. Go back and try a new search.</h2></div>'."n"; } else{ // display search results echo '<div class="maincontainer"><h2>Your search criteria returned '.$result->countRows().' results.</h2>'."n"; while($row=$result->fetchRow()){ echo '<div class="rowcontainer"><p><strong>First Name: </strong>'.$row['first_name'].'<p><p><strong>Last Name: </strong>'.$row['last_name'].'</p><p><strong>Employee ID: </strong>'.$row['employee_id'].'</p> <p><strong>Title: </strong>'.$row['title'].'</p> <p><strong>Territory: </strong>'.$row['territory'].'</p> <p><strong>Districts: </strong>'.$row['districts'].'</p> </div>'."n"; } } echo '</div>'; } catch(Exception $e){ echo $e->getMessage(); exit(); } ?> and here is the included file mysql.php code <?php // define 'MySQL' class class MySQL{ private $conId; private $host; private $user; private $password; private $database; private $result; const OPTIONS=4; public function __construct($options=array()){ if(count($options)!=self::OPTIONS){ throw new Exception('Invalid number of connection parameters'); } foreach($options as $parameter=>$value){ if(!$value){ throw new Exception('Invalid parameter '.$parameter); } $this->{$parameter}=$value; } $this->connectDB(); } // connect to MySQL private function connectDB(){ if(!$this->conId=mysql_connect($this->host,$this->user,$this- >password)){ throw new Exception('Error connecting to the server'); } if(!mysql_select_db($this->database,$this->conId)){ throw new Exception('Error selecting database'); } } // run query public function query($query){ if(!$this->result=mysql_query($query,$this->conId)){ throw new Exception('Error performing query '.$query); } return new Result($this,$this->result); } public function escapeString($value){ return mysql_escape_string($value); } } // define 'Result' class class Result { private $mysql; private $result; public function __construct(&$mysql,$result){ $this->mysql=&$mysql; $this->result=$result; } // fetch row public function fetchRow(){ return mysql_fetch_assoc($this->result); } // count rows public function countRows(){ if(!$rows=mysql_num_rows($this->result)){ return false; } return $rows; } // count affected rows public function countAffectedRows(){ if(!$rows=mysql_affected_rows($this->mysql->conId)){ throw new Exception('Error counting affected rows'); } return $rows; } // get ID form last-inserted row public function getInsertID(){ if(!$id=mysql_insert_id($this->mysql->conId)){ throw new Exception('Error getting ID'); } return $id; } // seek row public function seekRow($row=0){ if(!is_int($row)||$row<0){ throw new Exception('Invalid result set offset'); } if(!mysql_data_seek($this->result,$row)){ throw new Exception('Error seeking data'); } } } ?> I am using this code in my "create_account.php" script... Code: [Select] mail($trimmed['email'], ' Please Activate Your Account', $body, 'From: admin@mywebsite.com <admin@mywebsite.com>'); It is taking anywhere from one to several hours to receive this e-mail in my inbox?! It used to take seconds, and now takes forever. I thought it was a Gmail or SPAM issue, but I just did a test on my AT&T paid account and the same issue so far... It's awfully hard to do development and testing if I have to wait a half-a-day to get these e-mails?! Debbie I am using a standard form to mail script and have a few fields that I need to be required to be filled in. This is working fine until someone enters a space character in a required field, which is being let thorugh. How can I stop this? here the code for required fields - I thought the trim function in the below would have taken care of this??? // This is because I originally had it require but too many people // were used to Matt's Formmail.pl which used required instead. if ($required) $require = $required; // handle the required fields if ($require) { // seperate at the commas $require = ereg_replace( " +", "", $require); $required = split(",",$require); for ($i=0;$i<count($required);$i++) { $string = trim($required[$i]); // check if they exsist if((!(${$string})) || (!(${$string}))) { // if the missing_fields_redirect option is on: redirect them if ($missing_fields_redirect) { header ("Location: $missing_fields_redirect"); exit; } $require; $missing_field_list .= "<b><font color=\"#990000\">Missing: $required[$i]</font></b><br>\n"; } } // send error to our mighty error function if ($missing_field_list) print_error($missing_field_list,"missing"); } Code: [Select] require('../conn/db_connection.php'); //seleksi restoran $pilih_resto="select * from restoran"; $query_pilih_resto=mysql_query($pilih_resto); echo "<h3>Truly Data : </h3>"; while($resto=mysql_fetch_array($query_pilih_resto)){ echo"<font color='red'>".$resto["id_restoran"].".". $resto["nama_restoran"]."</font><br>"; $seleksi_menu_1="select * from jenis_menu"; $query_menu_1=mysql_query($seleksi_menu_1); while($menu_1=mysql_fetch_array($query_menu_1)){ echo "<font color='green'>".$menu_1["id_jenis_menu"]."</font><br>"; $seleksi_data_eat="select * from eat where id_restoran like '".$resto["id_restoran"]."' and id_jenis_menu like '".$menu_1["id_jenis_menu"]."'"; $query_eat=mysql_query($seleksi_data_eat); while($eat=mysql_fetch_array($query_eat)){ echo $eat["nama_eat"]."<br>"; } } echo"<br>"; } echo "------------------------------<br>"; echo "<h3>Random Data : </h3>"; $pilih_resto_2="select * from restoran"; $query_pilih_resto_2=mysql_query($pilih_resto_2); $menu_PNP="PNP"; $menu_PBK="PBK"; $menu_UTM_1="UTM"; while($data_resto=mysql_fetch_array($query_pilih_resto_2)){ echo "<b>".$data_resto["id_restoran"]."-".$data_resto["nama_restoran"]."</b><br>"; $seleksi_data_eat_PNP="select * from eat where id_restoran like '".$data_resto["id_restoran"]."' and id_jenis_menu like '".$menu_PNP."'"; $seleksi_data_eat_PBK="select * from eat where id_restoran like '".$data_resto["id_restoran"]."' and id_jenis_menu like '".$menu_PBK."'"; $seleksi_data_eat_UTM="select * from eat where id_restoran like '".$data_resto["id_restoran"]."' and id_jenis_menu like '".$menu_UTM_1."'"; $query_eat_UTM=mysql_query($seleksi_data_eat_UTM); $jml_data_UTM=mysql_num_rows($query_eat_UTM); echo "Summary of main Menu : $jml_data_UTM<br>"; $query_eat_PNP=mysql_query($seleksi_data_eat_PNP); $query_eat_PBK=mysql_query($seleksi_data_eat_PBK); while($eat_PNP=mysql_fetch_array($query_eat_PNP)){ $data_eat_PNP[]=$eat_PNP["nama_eat"]; } while(list($index_PNP,$data_PNP)=each($data_eat_PNP)){ $data_eat_PNP_list[$index_PNP]=$data_PNP; } while($eat_PBK=mysql_fetch_array($query_eat_PBK)){ $data_eat_PBK[]=$eat_PBK["nama_eat"]; } while(list($index_PBK,$data_PBK)=each($data_eat_PBK)){ $data_eat_PBK_list[$index_PBK]=$data_PBK; } while($eat_UTM=mysql_fetch_array($query_eat_UTM)){ $eat_UTMx[]=$eat_UTM["nama_eat"]; } for($i=0;$i<$jml_data_UTM;$i++){ $random_data_PNP[$i]=array_rand($data_eat_PNP_list,1); $random_data_PBK[$i]=array_rand($data_eat_PBK_list,1); echo "<font color='red'>".$data_eat_PNP_list[$random_data_PNP[$i]]."</font>---<font color='green'>". $eat_UTMx[$i]."</font>---<font color='blue'>".$data_eat_PBK_list[$random_data_PBK[$i]]."</font><br>"; } } Please Help, There is a random error data how to create random data like this? Data => Restoran A: Menu appetizers : - Sup - Sate Usus - Trancam Main Menu - Nasi Goreng - Nasi Goreng Putih - Nasi + Ayam Penyet - Nasi + Bebek Panggang - Ikan Gurame Asam + Nasi - Nasi Soto Menu Dessert - Pudding - Buah Segar - Juice Aplukat Restoran B : Menu appetizers -Sup Ikan Paprika -Sup Jamur Spesial -Sup Urat Sapi Saus Tiram -Sup May Jala - Jala Main Menu - Bubur Ayam Kombinasi - Bubur Ayam/Sapi Clay Pot - Bubur Telor Pitan Clay Pot - Gurame Panggang - Pangsit Udang - Cumi-cumi Goreng Special - Kepiting Lembek Mentega - Sayap Ayam Panggang Dessert -Juice Alpukat -Mix Juice -Sui Kiau Goreng Salad -Ha Kaou Sayuran Out Put : Restoran A : Menu e ---+--- Main Menu --+---- Dessert ---------------------------------------------------- Sup ------- Nasi Goreng ------- Pudding Sup ------- Nasi Goreng Putih ------- Juice Aplukat Sate Usus ------- Nasi + Ayam Penyet ------- Pudding Sup ------- Nasi + Bebek Panggang ------- Buah Segar Trancam ------- Ikan Gurame Asam + Nasi ------- Buah Segar Sate Usus ------- Nasi Soto ------- Pudding Restoran B : Menu Pembuka ---+-- Menu Utama --+--- Menu Penutup ----------------------------------------------------------------------- Sup Ikan Paprika ------- Bubur Ayam Kombinasi ------- Juice Alpukat Sup Urat Sapi Saus Tiram ------- Bubur Ayam/Sapi Clay Pot ------- Sui Kiau Goreng Salad Sup May Jala-Jala ------- Bubur Telor Pitan Clay Pot ------- Juice Alpukat Kepiting Lembek Mentega ------- Gurame Panggang ------- Juice Alpukat Sup Urat Sapi Saus Tiram ------- Pangsit Udang ------- Mix Juice Sup May Jala-Jala ------- Cumi-cumi Goreng Special ------- Ha Kaou Sayuran Sup Jamur Spesial ------- Kepiting Lembek Mentega ------- Sui Kiau Goreng Salad Sup May Jala-Jala ------- Sayap Ayam Panggang ------- Ha Kaou Sayuran Note : appetizers and desserts at random based on count of data main menu Hi, I have a searchbar which looks for a value in my tables, it works great but i want to know how i can make the results of the search clickable; go to a page relevent to that search, let me explain in more depth. User searches for a postcode, script finds and displays the postcode on the next page, user clicks the result postcode to goto the next page. What im stuck with is how to take that result and automatically display it on the clicked "final" page? Search script: Code: [Select] <?php // Get the search variable from URL $var = @$_GET['q'] ; $trimmed = trim($var); //trim whitespace from the stored variable // rows to return $limit=10; // check for an empty string and display a message. if ($trimmed == "") { echo "<p>Please enter a search...</p>"; exit; } // check for a search parameter if (!isset($var)) { echo "<p>We dont seem to have a search parameter!</p>"; exit; } //connect to your database ** EDIT REQUIRED HERE ** mysql_connect("xxxxx","xxxx","xxxx"); //(host, username, password) //specify database ** EDIT REQUIRED HERE ** mysql_select_db("removalspacelogin") or die("Unable to select database"); //select which database we're using // Build SQL Query $query = "(SELECT postcode FROM freelistings WHERE postcode like '%$trimmed%') UNION (SELECT postcode FROM basicpackage WHERE postcode like '%$trimmed%') UNION (SELECT postcode FROM premiumuser WHERE postcode like '%$trimmed%') ORDER BY postcode"; // EDIT HERE and specify your table and field names for the SQL query $numresults=mysql_query($query); $numrows=mysql_num_rows($numresults); $result = mysql_query($query) or die("<b>Query:</b> $query<br><b>Error</b>: " . mysql_error()); // If we have no results, offer a google search as an alternative if ($numrows == 0) { echo "<h4>Results</h4>"; echo "<p>Sorry, your search: "" . $trimmed . "" returned zero results</p>"; echo "<p><a href=\"http://www.google.com/search?q=" . $trimmed . "\" target=\"_blank\" title=\"Look up " . $trimmed . " on Google\">Click here</a> to try the search on google</p>"; } // next determine if s has been passed to script, if not use 0 if (empty($s)) { $s=0; } // get results $query .= " limit $s,$limit"; $result = mysql_query($query) or die("Couldn't execute query"); // display what the person searched for echo "<p>You searched for: "" . $var . ""</p>"; // begin to show results set echo "Results for $q"; $count = 1 + $s ; // now you can display the results returned while ($row= mysql_fetch_array($result)) { $title = $row['postcode']; echo " $title" ; $count++ ; } $currPage = (($s/$limit) + 1); //break before paging echo "<br />"; // next we need to do the links to other results if ($s>=1) { // bypass PREV link if s is 0 $prevs=($s-$limit); print " <a href=\"$PHP_SELF?s=$prevs&q=$var\"><< Prev 10</a>  "; } // calculate number of pages needing links $pages=intval($numrows/$limit); // $pages now contains int of pages needed unless there is a remainder from division if ($numrows%$limit) { // has remainder so add one page $pages++; } // check to see if last page if (!((($s+$limit)/$limit)==$pages) && $pages!=1) { // not last page so give NEXT link $news=$s+$limit; echo " <a href=\"$PHP_SELF?s=$news&q=$var\">Next 10 >></a>"; } $a = $s + ($limit) ; if ($a > $numrows) { $a = $numrows ; } $b = $s + 1 ; echo "<p>Showing results $b to $a of $numrows</p>"; ?> <form method="post" action="localarea.php"> <a href="localarea.php"><?php echo """ .$var. ""</p>";?></a> </form> [\code] The form at the bottom im guessing is where i should take the $var from but how exactly? or if not where should it be pulled from to display on the next page? I want this "next" page because ideally there would be lots of results in postcode, so the user can choose which one is more relevant to them and go to that specific page with all the companies within that postcode. Hope this helps for a better understanding of what im trying to achieve, its just implementing it in? Hi all... I am facing problems in taking screenshot for the currently open page. What I want is by clicking on a link like "Click for taking Screenshot" the screenshot of that page gets generated, which can be saved further. I have tried by using "imagegrabscreen" & "imagegrabwindow" but both of them results as a big black png image, also searched forums but not able to get the perfect match. If any expert there...then plzzzzz do help me out.... Thank You Hi, I am creating a date string using the following: $curDate = date("Y-m-d H:i:s"); However, what I want to do is take one hour off this so that $curDate now becomes the current date and time minus one hour. Thanks for your help. I have a small issue here which I can't quite figure out. I have three containers on one page all below each other. One for buttons, a JS image slideshow and a description box. The image slider seems to take up unnecessary space when the browser is resized activating media queries:
http://gyazo.com/333...d5668e240fae788
CSS desktop view (without media queries):
body { background: #141414 url('../images/background1.png'); background-repeat: repeat-y; background-attachment:fixed; background-position:center; } #container{ height:450px; width:840px; margin:120px auto 2% auto; position:relative; } #container2{ height:60px; width:840px; margin:0 auto 50px auto; position:relative; -moz-box-shadow:0 0 5px 5px black; -webkit-box-shadow:0 0 5px 5px black; box-shadow:0 0 5px 5px black; } #container2 p{ color:white; font-size:15px; padding-left:5px; } #container2 h2{ color:white; font-size: 18px; text-decoration:none; padding-left:5px; padding-top:2px; } #img{ height:450px; width:840px; position:absolute; -moz-box-shadow: 0 0 5px 5px black; -webkit-box-shadow: 0 0 5px 5px black; box-shadow: 0 0 5px 5px black; } #l_holder{ height:450px; width:100px; position:absolute; left:0px; top:0px; cursor:pointer; } #r_holder{ height:450px; width:100px; position:absolute; right:0px; top:0px; cursor:pointer; } .left{ height:50px; width:50px; position:absolute; top:45%; left:0px; } .right{ height:50px; width:50px; position:absolute; top:45%; right:0px; } .clear{ clear:bottom; }CSS with media queries, this is where the container is causing a problem: @media all and (min-width: 3.5in) and (max-width: 10in) { body { background: #141414; } #container{ height:30%; width:100%; margin:5% auto; padding:0 0 0px 0; } #container2{ width:100%; margin: 0; padding: 0; } #container2 p{ padding-left:3px; } #container2 h2{ padding:5px 0 0 3px; } #container2 .body_black_box{ } #img{ height:80%; width:100%; } #l_holder{ height:80%; } #r_holder{ height:80%; } .left{ } .right{ } .clear{ } }Any help is greatly appreciated. Hi all
we have an ajax query which queries a MySQL database for cities around the world for our hotel search. We are running on a Linux web hosted server.
The problem we are having is when you first visit out site and type in Brisbane or Sydney it takes around 15 seconds maybe to return. After that what ever city you query is lightening fast. I have had a few friends try this and when they first visit our site they experience the same then second time around it is fast.
Could this be some sort of caching issue or setting somewhere that I am missing?
I have attached a file so you can see what I mean
Thanks in advance
Attached Files
ajaxqry.jpg 169.31KB
0 downloads |