1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[-Urgent-] PHP API Help

Discussion in 'Programming' started by SeoMoneyz, Apr 22, 2017.

Tags:
  1. SeoMoneyz

    SeoMoneyz BANNED BANNED

    Joined:
    Feb 17, 2017
    Messages:
    132
    Likes Received:
    38
    Gender:
    Male
    echo 'Invoice "'.$invoice->getId().'" created, see '.$invoice->getUrl().PHP_EOL;

    i have this line on the end of a php file and as you can see it prints text to the screen. its working good but i got confused trying to use this part $invoice->getUrl() on its own, you see when i run the code it print out a url to the screen. I want to use that url and make the php script redirect to it automatically and all my efforts to do so have failed :(

    i want to do something like this:

    URL = ($invoice->getUrl());
    open(url)

    or just open($invoice->getUrl()); but in php :D
     
  2. pavan

    pavan Elite Member

    Joined:
    Mar 30, 2008
    Messages:
    1,819
    Likes Received:
    456
    just use this
    Code:
    header('Location: {$invoice->getUrl()}');
     
    • Thanks Thanks x 2
  3. SeoMoneyz

    SeoMoneyz BANNED BANNED

    Joined:
    Feb 17, 2017
    Messages:
    132
    Likes Received:
    38
    Gender:
    Male
    $location = $invoice->getUrl();
    header( 'Location: ' . $location );


    found it after searching for hours lel
     
  4. SeoMoneyz

    SeoMoneyz BANNED BANNED

    Joined:
    Feb 17, 2017
    Messages:
    132
    Likes Received:
    38
    Gender:
    Male
    you rule man! thanks alot

    PS: Mod you can close this thread ^_^