You can pass data through an URL, it should be in the form of key/value pairs, but you shouldn't use it to pass too much data because an URL has a limit. You also should not pass sensitive information.
A key/value pair is something like this:
key=value
If you have more then one pair, you need to separate them using the & char. Here is an example:
myScript.php?color1=blue&color2=red
The string after ? is called the Query String. With PHP you can easily access those key/value pairs using the super-global $_GET. So, in myScript.php you do:
$a = $_GET['color1'];
$b = $_GET['color2'];
Now, if you are going to create a dynamic query string, you should use urlencode() at least, so any special characters will be translated to maintain a proper URL format.
4. Store the data of interest in a session variable or in a cookie, and access that same session variable or cookie in the 2nd file (both must run in same domain)
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
You can pass data through an URL, it should be in the form of key/value pairs, but you shouldn't use it to pass too much data because an URL has a limit. You also should not pass sensitive information.
You should only use GET when it doesn't MODIFY the contents. So for example, you shouldn't use get to delete something (though people often do), you should use get for things such as pagination or viewing a forum post.
POST should be used for deleting, editing, that kind of request.
Other ways you can send data between pages include (though no way am i giving you examples, google it):
Databases, MySQL etc
Sessions (file or database powered)
Memcache (storing data in RAM)
GET query of a URL
Cookies - stored in files on web browsers
Hidden form fields
etc
cURL is not a way of transfering data from one page to another in the context you are putting it in.
And for people to laugh at, my original explanation of cURL for this post was lmao - just had a 7 hour appointment building a website for a client, give me a break
cURL is not a way of transfering data from one page to another - instead its the technology that retrieves or sends data to other pages, it doesn't actually store anything... if that makes sense :/
Kind regards,
Scott
Last edited by VBAssassin; 05-31-2012 at 11:55 AM.
And if you want to get elaborate and silly, you could send data to an external commonly accessible system. For instance, you could email the common data from one page and read the messages from another. Or post it to google docs or some other online storage from one and read from another. Or a forum. Or a chatroom. Etc.
cURL is not a way of transfering data from one page to another - instead its the technology that retrieves or sends data to other pages, it doesn't actually store anything... if that makes sense :/
That depends entirely on how you interpret the question!
And, I find it hilarious an ironic that you say, "cURL is not a way of transfering data from one page to another," and then go on to immediately say, "instead its the technology that retrieves or sends data to other pages." Well, which is it!
That depends entirely on how you interpret the question!
And, I find it hilarious an ironic that you say, "cURL is not a way of transfering data from one page to another," and then go on to immediately say, "instead its the technology that retrieves or sends data to other pages." Well, which is it!
Haha, yeah, i did! technically it does transfer data... the same way TCP/IP does, or even fopen using streams in PHP. But it's not what he's asking in the question and i confused myself trying to explain how it wasn't what he was asking for lmao
Make sense now? Or at least i should be saying, does my excuse for contradicting myself make sense?
Haha, yeah, i did! technically it does transfer data... the same way TCP/IP does, or even fopen using streams in PHP. But it's not what he's asking in the question and i confused myself trying to explain how it wasn't what he was asking for lmao
Make sense now? Or at least i should be saying, does my excuse for contradicting myself make sense?
Kind regards,
Scott
Frankly, I think the question is vague. It doesn't indicate whether one page should be passing data directly to another, or whether the data to be passed is from user initiated page load to user initiated page load.
You can always print the variables, then use a scanner. Fax is pretty reliable too
Ah, touche!
Or, from the first page, send the visitor an invoice (paper invoice via snail mail, of course) on which the line items represent the data structures in JSON. Include instructions to navigate to the 2nd page and enter the line item data.
Bookmarks