
![]() |
vsloathe
Is it possible to pass an object handle via POST? I've read somewhere that you can use serialize() and unserialize(), but that doesn't seem to be working with the cURL object handle that I want passed in when I POST a script to itself.
perkiset
I'm confused V - POST is a plain text format. The only thing that you could do is serialize an object and then pass it in a multi-part format... but a handle is a pointer to a live object in memory, so passing a handle would be meaningless...
perhaps if we knew more about what about you are trying to accomplish... vsloathe
I'm trying to accomplish being lazy.
Actually, I could probably do it better with AJAX, but here's a basic outline:1. grab a username/pass from my database of accounts 2. login 3. go to the page to upload a file (which you must be logged in to do) 4. grab the captcha image and dynamic elements (hashes) 5. await for a user (or in my case, another program I wrote) to give the captcha answer 6. POST the captcha answer + file to upload, etc. Now, the way I do step 5 is just with a simple form, so right now there's no way for me to pass the web browser object I'm using on to the next step. vsloathe
I guess basically I want to be able to take input from the user without losing my session stuff. I just don't want to have to store all the session specific stuff and reload it.
DangerMouse
Wow - just looked this up being a
PHPnoob - very cool! Passing objects between domains (that share the same library) sounds very useful![]() My reading of the manual suggests that passing an object as you suggest would be just like posting a file to a site, if not cross domain maybe a cache or session could be used? Sorry I can't be more help, don't really know what im talking about just found the post interesting. DM nop_90
this not for
php, but it universal.find a serialization library. so you could use json. serialize and unserialize the object. json probably best since u can control security better, and also you could theoretically pass objects back and forth between languages even. not sure how serialize/unserialize in PHPworks, but in most language u have to problem it has to match language versions.Also in some cases it actually freezes the bytecode. This opens up all sorts of fun things to do ![]() perkiset
JSON is excellent if you need to go cross-language, but if you're
PHPtoPHPthen serialize() is better because it handlesPHPtypes better. In either case, Nop is correct and this is rather a standard model for moving complex objects between systems. |

Thread Categories

![]() |
![]() |
Best of The Cache Home |
![]() |
![]() |
Search The Cache |
- Ajax
- Apache & mod_rewrite
- BlackHat SEO & Web Stuff
- C/++/#, Pascal etc.
- Database Stuff
- General & Non-Technical Discussion
- General programming, learning to code
- Javascript Discussions & Code
- Linux Related
- Mac, iPhone & OS-X Stuff
- Miscellaneous
- MS Windows Related
- PERL & Python Related
- PHP: Questions & Discussion
- PHP: Techniques, Classes & Examples
- Regular Expressions
- Uncategorized Threads