Jump to content

dayo

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dayo's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Seems like CGI is the way to go. Ah well, I better start learning that.
  2. Hello all I am newbie learning PHP stuff and can anyone please tell me if this scenario is possible on a payment system I am working on. 1) User Selects items from website 2) Information is passed to 3rd party site to process payment including url to a php file on website 3) 3rd party site sends information back to php file 4) Database is updated So far, steps 1 & 2 are sucessful and the payment is processed, but getting the data back from the 3party site and updating the DB is proving difficult. The code below is what is in the php file the 3rd party site is posting variables back to. //Insert Transaction Details into table $tab_list = "mb_date_ordered, mb_pay_to_email, mb_pay_from_email, mb_merchant_id, mb_transaction_id, mb_mbtransaction_id, mb_mbamount, mb_mbcurrency, mb_status, mb_md5sig, mb_zcmd5, mb_amount, mb_currency" $tab_vals = "'date("Y-m-d H:i:s")','$_REQUEST[pay_to_email]', '$_REQUEST[pay_from_email]', '$_REQUEST[merchant_id]', '$_REQUEST[transaction_id]', '$_REQUEST[mb_transaction_id]', '$_REQUEST[mb_amount]', '$_REQUEST[mb_currency]', '$mbStatusText', '$_REQUEST[md5sig]', '$mbZCMD5', '$_REQUEST[amount]', '$_REQUEST[currency]'" $zc_con = mysql_connect("host","u_name","p_word"); mysql_select_db("db_name", $zc_con); $zc_query="INSERT INTO MYTABLE ($tab_list) VALUES ($tab_vals)"); mysql_close($zc_con) The question is whether a site posting info to a php file can trigger this code and if it can, whether I have screwed up in the structure. Thanks for your time
  3. Managed to find a way to solve the main issue I faced.  Still have some work to do but want to thank contributors for their help.
  4. [quote author=thorpe link=topic=111365.msg451277#msg451277 date=1160730730] You best read the manual on the subject of [url=http://au.php.net/manual/en/language.variables.scope.php]scope[/url] then, this really is one of the most fundemental lessons that [b]must[/b] to be learnt. [/quote] I bet it is.  I already read the page you referenced even before signing up here yesterday.  As you are far more knowledgeable on the subject than I am, can you please indicate if i am on the right track with the interpretation I gave?? Thanks a lot.
  5. Thanks a lot.  In my example therefore I will have.... [code] <?php include 'a.inc'; include 'b.inc'; ?> a.inc will have the following <?php "A form for User Input" include 'A1.inc'; include 'A2.inc'; ?> A1.inc will have the following <?php function 1 { $x = "Value from user input form" return $x; } ?> A2.inc will have the following <?php function 2($x) { $y = $x + 1 return $y } include 'A2_1.inc'; ?> A2_1.inc will have the following <table> <tr> <td>"The value of $y"</td> </tr> </table> [/code] Am I getting it?  Sorry if I seem a bit thick but because of the complexity of the code, I want to get it right at this level before diving in. Thanks for the help
  6. [quote author=btherl link=topic=111365.msg451247#msg451247 date=1160720432] If you want your variables to be shared between all your files and functions, you can put "global $y" at the top of each function that uses $y.  And global $x at the top of each that uses $x. Another way is to pass the variable in as function arguments and get them back as return values.  Once your code gets larger you will probably want to do that. [/quote] Thanks.  Sorry but a follow on query.  Does it matter that $x & $y are actually arrays?  The code is indeed large...I have just simplified the structure.  Any clues on how I pass the variables across please? If I will be brazen, can you (or anyone else) illustrate with my example how this can be done? Thanks for the hints
  7. Some help please.  I am trying to modify some files that have the following simplified structure <?php include 'a.inc'; include 'b.inc'; ?> a.inc has the following struture <?php "A form for User Input" include 'A1.inc'; include 'A2.inc'; ?> A1.inc has the following struture <?php function 1 { $x = "Value from user input form" } ?> A2.inc has the following struture <?php function 2 { $y = $x + 1 } include 'A2_1.inc'; ?> A2_1.inc has the following struture <table> <tr> <td>"The value of $y"</td> </tr> </table> The files are a bit more complicated than this (Gallery2 photo display software) but this is the basic structure.  I am struggling to get "The value of $y".  Any tips anyone??? Thanks for your help
  8. [quote author=kenrbnsn link=topic=87296.msg351524#msg351524 date=1141445981] How are your users getting from index.php to product.php? A form? A link? You can always uses sessions. In index.php [code]<?php session_start(); $some_variable = "Testing 123"; $_SESSION['some_variable'] = $some_variable; ?>[/code] In product.php: [code]<?php session_start(); $some_varible=$_SESSION['some_variable']; ?>[/code] Ken [/quote] New here but desperately going through old files.  I probably should post here as i had put this somewhere else but this is relevant to my quest so I hope I am forgiven. I am tying to modify some files that have the following simplified structure [code] <?php include 'a.inc'; include 'b.inc'; ?> a.inc has the following struture <?php "A form for user input" include 'A1.inc'; include 'A2.inc'; ?> A1.inc has the following struture <?php function 1 { $x = "Value from user input form" } ?> A2.inc has the following struture <?php function 2 { $y = $x + 1 } include 'A2_1.inc'; ?> A2_1.inc has the following struture <table> <tr> <td>"The value of $y"</td> </tr> </table> [/code] The files are a bit more complicated than this (Gallery2 photo display software) but this is the basic structure.  I am struggling to get "The value of $y". 
  9. [quote author=digitalgod link=topic=111315.msg451040#msg451040 date=1160676492] I already thought about that and it works but as you know most users will hit back on their browsers first. [/quote] Why not try adding a discrete message telling them not to use the back button on the browser? I have been on site with such messages.
  10. Some help please, I have a similar issue (first post).  I am trying to modify some files that have the following simplified structure [code] <?php include 'a.inc'; include 'b.inc'; ?> a.inc has the following struture <?php "A form for user input" include 'A1.inc'; include 'A2.inc'; ?> A1.inc has the following struture <?php function 1 { $x = "Value from user input form" } ?> A2.inc has the following struture <?php function 2 { $y = $x + 1 } include 'A2_1.inc'; ?> A2_1.inc has the following struture <table> <tr> <td>"The value of $y"</td> </tr> </table> [/code] The files are a bit more complicated than this (Gallery2 photo display software) but this is the basic structure.  I am struggling to get "The value of $y".  Any tips anyone... or clues on where I could go for suggestions???
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.