Results 1 to 3 of 3

Thread: Set a var to returned value from php...

  1. #1
    Join Date
    Feb 2009
    Posts
    1,447
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Set a var to returned value from php...

    How would I set a var in a script with something that is returned from a php file?
    This is for authorization by the way.
    How would I send the value to scar too?

  2. #2
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Make the PHP page output what you want to send to SCAR, and make SCAR read the out put page.

    Example:

    PHP
    PHP Code:
    if (isset($_POST['FromScar'])) {
      die(
    "True");
    } else {
      die(
    "False");

    SCAR
    SCAR Code:
    procedure PostPHP;
    var Page: Integer;
        Return: string;
    begin
      Page := InitializeHTTPClient(False, False);
      AddPostVariable(ProggieFile, 'FromScar', 'test');
      Return := PostHTTPPageEx(ProggieFile, 'http://yourdomain.com/file.php');
    end;



    ~NS

  3. #3
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Nadeem View Post
    Make the PHP page output what you want to send to SCAR, and make SCAR read the out put page.

    Example:

    PHP
    PHP Code:
    if (isset($_POST['FromScar'])) {
      die(
    "True");
    } else {
      die(
    "False");

    SCAR
    SCAR Code:
    procedure PostPHP;
    var Page: Integer;
        Return: string;
    begin
      Page := InitializeHTTPClient(False, False);
      AddPostVariable(ProggieFile, 'FromScar', 'test');
      Return := PostHTTPPageEx(ProggieFile, 'http://yourdomain.com/file.php');
    end;



    ~NS
    You do not need an else after the Die(True) -.-. It will terminate the script anyways. So you could just have this:
    PHP Code:
    if (isset($_POST['FromScar'])) 
      die(
    "True");
      die(
    "False"); 
    Of course, you can output whatever you would like with the dies.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •