Reputation: 3424
I can only post using preset fields. So what I did was pass in two parameters, and then split them using explode function like
$usr=explode('_$%^_',$_POST['filename']);
and access values like $usr[0]
, $usr[1]
;
My question is that are there any drawbacks to this method I am using.
I am using an ZOHO Remote API, and it has fixed fields that I can pass. I am trying to return the username. So I included that in the file name and split it once the file gets saved. Dirty solution but it worked.
Upvotes: 0
Views: 147
Reputation: 93
A better option than explode
may be to serialize
or json_encode
the data before posting and then unserialize
/json_decode
it after post. The end result is not much different but it will provide you with a couple distinct advantages:
$usr
by position.I make the assumption that since you are able to concatenate fields before post, you will be able to use the same method to encode your fields. If you are using JavaScript for this, JSON will be the more natural choice.
Upvotes: 1