In order to pass variables from MQL4 to PHP and receive response (decision) in form of SELL or BUY, first you need expert. Originally experts are user created logic, which analyze market movement and trends and either suggest user when to sell or buy, or even do it automatically.