i wnat to connect to an url and read data or catch parameters thrown by the url in my php code i am new to php plz explain in detail thanig in anicipaiont
Read the parameters thrown by an url
Collapse
X
-
Read the parameters thrown by an url
Tags: None -
Originally posted by mrityunjay11i wnat to connect to an url and read data or catch parameters thrown by the url i am new to php plz explain in detail thanig in anicipaiont
url: www.domain.com/index.php?id=1
[CODE=php]
// on index.php
$lnID = $_GET['id'];
echo $lnID;
[/CODE]
Result: 1 is printed on screen
You can add multiple items to the query string by separaing them with &.
For more information read this tutorial.
Cheers
nathj -
a website suppose www.paypal.com is sending data. There is no action or method in the uerl.It is sending data i dont know how.Just i know that it is sending certain data. I want to catch the data thrown by the url.How do i know the information sent by that urlComment
-
integration of web pages and catching parametrs
I want to integrate to an url and catch data thrown by it. In the url ther is no action or method it is just throwing data . i dont know how but it is throwing data and i want to capture it in my php code.Comment
-
Originally posted by mrityunjay11a website suppose www.paypal.com is sending data. There is no action or method in the uerl.It is sending data i dont know how.Just i know that it is sending certain data. I want to catch the data thrown by the url.How do i know the information sent by that url
Generally, however, there are two ways info can be sent; POST and GET. If it is GET then it will appear in the URL if it is POST it will not.
These are retreived use $_GET['name'] or $_POST['name']. There is a third way to retreive data $_REQUEST['name']. This however, is not recommended as it means in the code you have no idea where the data is coming from.
If you know what the data is called (the key assigned to it in the array) then you can try both $_POST and $GET and see which one works.
This is all a bit vague as we need more info on what you are doing, where the data is coming from. Do you have some code and some scenario details for us?
Cheers
nathjComment
-
Originally posted by mrityunjay11I want to integrate to an url and catch data thrown by it. In the url ther is no action or method it is just throwing data . i dont know how but it is throwing data and i want to capture it in my php code.
The best thing t odo would be to find out how the data is coming across,how is this being sent, who is sending it. this would give you a better understanding of what is going on, making development and maintenance a lot easier.
nathjComment
-
Merged duplicate threads.
mrityunjay11, you posted so many duplicate threads that I had to merge them all together, and now your thread is so cluttered, you are probably going to get FEWER responses than if you had just posted ONE thread and been patient.Comment
-
its related to paypal gateway. merchent is getting certain data from paypal about buyerafter buyer buys someting from the button of merchent.i want to catch thos informatuion about buyer and upadte in the merchent databaseComment
-
Originally posted by mrityunjay11its related to paypal gateway. merchent is getting certain data from paypal about buyerafter buyer buys someting from the button of merchent.i want to catch thos informatuion about buyer and upadte in the merchent database
nathjComment
-
So I think you have completed the shopping cart well.
Now buyer is ready to redirect back to merchant web site.
On this level onwards, You can use.- PDT (Payment Data Transfer)
- IPN (Instant Payment Notification)
say your return url http://yourdomain.com/thanks.php
Based on the return method you specified can display the Transaction Info on that page. please read here. to find out more info and code samples.
at this page level you can do the database updating for buyer. something like payments status can update with PAID .
but Dont do that. Because some buyers will close the page after COMPLETING the payments to your paypal account. So payment status is paid but no way to update it. because he did not click the return to merchant web site button. so PDT'll fail to do the updation.
So please use the IPN for this type of things. IPN is basically totally hidden process to the buyer. On success full transaction paypal IPN server sends a request to the notify_url that you specified in your cart form. So its a server to server communication. for more read here.
So let your IPN script to update your database. not to the PDT script.
paypal by it name itself a PAL. read the mannuals.what you need its already there at Paypal level.
Post back any time with any paypal issue :)
Thanks!
-ajaxrandComment
-
Originally posted by ajaxrandSo I think you have completed the shopping cart well.
Now buyer is ready to redirect back to merchant web site.
On this level onwards, You can use.- PDT (Payment Data Transfer)
- IPN (Instant Payment Notification)
say your return url http://yourdomain.com/thanks.php
Based on the return method you specified can display the Transaction Info on that page. please read here. to find out more info and code samples.
at this page level you can do the database updating for buyer. something like payments status can update with PAID .
but Dont do that. Because some buyers will close the page after COMPLETING the payments to your paypal account. So payment status is paid but no way to update it. because he did not click the return to merchant web site button. so PDT'll fail to do the updation.
So please use the IPN for this type of things. IPN is basically totally hidden process to the buyer. On success full transaction paypal IPN server sends a request to the notify_url that you specified in your cart form. So its a server to server communication. for more read here.
So let your IPN script to update your database. not to the PDT script.
paypal by it name itself a PAL. read the mannuals.what you need its already there at Paypal level.
Post back any time with any paypal issue :)
Thanks!
-ajaxrand
one last help needed
i am not able to locate notify_url. is it in thehtml code for the button or form we fill to buy buttonComment
-
Originally posted by mrityunjay11one last help needed
i am not able to locate notify_url. is it in thehtml code for the button or form we fill to buy button
[code=html]
<input type="hidden" name="notify_ur l" value="http://domain.com/ipn_script_name.php">
[/code]
you have to Add it to the Form. Have you read Standard Variable Reference
mrityunjay11,
Your questions are not that much clear to me.As far as you can elaborate your question I can pay some attention in to your problem.
Thanks!
-ajaxrandComment
Comment