#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2007
    Location
    Portugal
    Posts
    23
    Rep Power
    0

    Calling Php script with return function


    Good evening

    I was wondering if someone can help me in a question: can I call a php script - via post or get - and:

    1) either retrieve from the response pure html AND (at the same time) php variables which I can use next - right after the call

    2) or execute a function within the response - if it's in the php form?...

    The remote script gives back html code with several information.
    What I need is to reuse that info within the php or run a function contained within.

    Is any of these solutions possible?

    Kind regards

    JKepler
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,465
    Rep Power
    653
    It is not clear to me what you are really asking. Passing data from an HTML form to a PHP script is fundamentally the purpose of PHP. Are you asking how to process data on the client side?
    Last edited by gw1500se; January 16th, 2018 at 07:50 PM.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. Code Monkey V. 0.9
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2005
    Location
    A Land Down Under
    Posts
    2,425
    Rep Power
    2105
    If it's remote you'll need to send out some sort of data structure like an array. That way you can have values stored for keys like 'html', as well as any other data values that you need to send with it.

    As for the sending part, JSON is about the quickest, easiest and most widely used these days, so look into that as well.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2007
    Location
    Portugal
    Posts
    23
    Rep Power
    0
    Originally Posted by Catacaustic
    If it's remote you'll need to send out some sort of data structure like an array. That way you can have values stored for keys like 'html', as well as any other data values that you need to send with it.

    As for the sending part, JSON is about the quickest, easiest and most widely used these days, so look into that as well.
    Good morning,

    Yes, you are right. Sometimes we think only "2D"... Formating the data wirh a JSON array, with a component HTML and the others with data is the best choice.

    Thanks for the thought

    Kind regards

    JKepler
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2007
    Location
    Portugal
    Posts
    23
    Rep Power
    0
    Hi Catacaustic,

    I manage to get the answer in html and with the vars - this is good. Tha bad thing, is that the returned html is suposed to echo an image (from a php script called within) which does not shows up...

    Any ideas?

    Kind regards

    JKepler
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,465
    Rep Power
    653
    You need to start posting some code so we can see what you are doing. Be sure to read the sticky at the top of this forum that says READ THIS BEFORE POSTING first.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2007
    Location
    Portugal
    Posts
    23
    Rep Power
    0
    Greetings,

    I'm sorry - you are absolutely right. My apologies. Still, the problem was a base64 encoding routine that was missing - so problem solved.
    In the future, I'll try to post the code I have for example and quicker debug (when it's possible of course: in this particular case, the php code has about 12 classes with 100-200 - average - lines of code...)

    Thanks.

    Kind regards

    JKepler
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,465
    Rep Power
    653
    You only need to post the segment of code that is giving you trouble. If there is not enough info there for someone to understand the code they will ask for more.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.

IMN logo majestic logo threadwatch logo seochat tools logo