473,385 Members | 1,267 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Read the parameters thrown by an url

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
Jul 26 '07 #1
13 2494
nathj
938 Expert 512MB
i 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
This is really easy in php

url: www.domain.com/index.php?id=1

Expand|Select|Wrap|Line Numbers
  1. // on index.php
  2.  
  3. $lnID = $_GET['id'];
  4.  
  5. echo $lnID;
  6.  
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
Jul 26 '07 #2
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 url
Jul 26 '07 #3
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.
Jul 26 '07 #4
ak1dnar
1,584 Expert 1GB
removed unwanted contents from thread title;
i waant to read parameters thrown by an url

Is this related to paypal payment gateway. or is it just a exmple you thrown.
Please we need some more info...
Jul 26 '07 #5
nathj
938 Expert 512MB
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 url
As ajaxrand we need a bit more info.

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
nathj
Jul 26 '07 #6
nathj
938 Expert 512MB
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.
A bot baffled but could the data be in a $_SESSION variable? alternatively try $_REQUEST a dirty way that may work.

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.

nathj
Jul 26 '07 #7
pbmods
5,821 Expert 4TB
Heya, mrityunjay11.

What do you want your code to do? Give an example.
What is your code doing that you don't want it to do? Give an example.
What is your code *not* doing that it is supposed to? Give an example.
Jul 26 '07 #8
pbmods
5,821 Expert 4TB
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.
Jul 26 '07 #9
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 database
Jul 27 '07 #10
nathj
938 Expert 512MB
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 database
what does the paypal documentation say on this? I know that they have some, but I can't remember the link - have a look on PayPal and se what they suggest.
nathj
Jul 27 '07 #11
ak1dnar
1,584 Expert 1GB
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)
After paying on paypal side there is a button to redirect back to the Merchant web site. This is PDT. you can specify a return url for this with return method as GET or POST (element name is rm). I think you are familiar with these.

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
Jul 27 '07 #12
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)
After paying on paypal side there is a button to redirect back to the Merchant web site. This is PDT. you can specify a return url for this with return method as GET or POST (element name is rm). I think you are familiar with these.

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 button
Jul 27 '07 #13
ak1dnar
1,584 Expert 1GB
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 button
This is the standard way of sending the notify url to paypal server.

Expand|Select|Wrap|Line Numbers
  1. <input type="hidden" name="notify_url" value="http://domain.com/ipn_script_name.php">
  2.  
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!

-ajaxrand
Jul 27 '07 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Simon Harvey | last post by:
Hi everyone, I'm having a very frustrating problem executing a stored procedure. I'll put the code at the bottom. When I build the SP and add all the parameters everything goes as expected....
2
by: Grant Stanley | last post by:
I'm writing a database client program in C#, and it accesses a MS SQL V7 database. In one part of my program I am using a SqlCommand class to run a SQL Statement, the command text uses parameters,...
7
by: Brad Quinn | last post by:
Is there a way to get the values of the paramaters to a method programatically? I know that I can use reflection to find out the parameter names and types, etc., but I want to know the values...
28
by: C# Learner | last post by:
Note ---- Please use a fixed-width font to view this, such as Courier New. Problem
12
by: Andy Sutorius | last post by:
Hi, I am getting the error "Invalid attempt to read when no data is present" when I run the following code. I have checked the sql and it is returning data. What am I missing? string...
18
by: John Friedland | last post by:
My problem: I need to call (from C code) an arbitrary C library function, but I don't know until runtime what the function name is, how many parameters are required, and what the parameters are. I...
7
by: =?Utf-8?B?SmVmZkRvdE5ldA==?= | last post by:
I have an asp.net application using a multi-page wizard control that grabs user selected files from a database and allows the user to configure parameters using controls on the wizard pages. The...
21
by: Peter Larsen [] | last post by:
Hi, I have a problem using System.Runtime.InteropServices.ComTypes.IStream. Sample using the Read() method: if (IStreamObject != null) { IntPtr readBytes = IntPtr.Zero;...
1
by: Marc Bartsch | last post by:
Hi, My C# app throws the following exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. From...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.