skip to Main Content

I want to include the header of our white label partner in our site with a snippet in php, but it doenst work properly.

… does include the header – but ignores everything after the ?
this is the url to include (i changed the url before the "/":)

<?php
include (url-of-whitelablepartner/header-basic?includeVendorChunks=true);?>

Does anyone know what i am doing wrong?
The include function should be ok, but i think i am making a mistake, trying to include the query string also.

2

Answers


  1. This is good way how to get hacked. include gets the referenced file and executes it as PHP script.

    But to your question, you seem to miss quotes around the URL.

    If you are trying to include merely some HTML from remote URL then readfile("https://YOUR_URL/header-basic?includeVendorChunks=true"); is the way to go.

    Login or Signup to reply.
  2. If you’re actually trying to include code and it expects a get parameter, just define the variable:

    $_GET['includeVendorChunks'] = 'true';
    include('http://url-of-whitelablepartner/header-basic');
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search