ray Posted March 13, 2008 Report Share Posted March 13, 2008 (edited) Man uz viena domēna www.example.com stāv php faili. Vai ir iespējams un kā es tos varētu izsaukt un lietot no citiem domēniem (www.domain.com, www.mans_domēns.lv, utt.), ja tie stāv uz viena (mana) servera? Piem. www.example.com/index.php function bla($mainigais) { return $mainigais; } www.domain.com/default.php include("index.php"); // te ir tas pirmais fails no cita domēna (www.example.com) echo bla("HELLO!"); Edited March 13, 2008 by ray Link to comment Share on other sites More sharing options...
andrisp Posted March 13, 2008 Report Share Posted March 13, 2008 nu ja tev tas www.example.com/index.php atgriezīs php kodu, tad tam vajadzētu strādāt (ja konfigos nav nogriezts). Link to comment Share on other sites More sharing options...
ray Posted March 13, 2008 Author Report Share Posted March 13, 2008 tad sanāk, ka vnk viss ir jānokonfigo pareizi uz servera? Link to comment Share on other sites More sharing options...
andrisp Posted March 13, 2008 Report Share Posted March 13, 2008 http://lv2.php.net/include/: If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), you can specify the file to be included using a URL (via HTTP or other supported wrapper - see List of Supported Protocols/Wrappers for a list of protocols) instead of a local pathname. If the target server interprets the target file as PHP code, variables may be passed to the included file using a URL request string as used with HTTP GET. This is not strictly speaking the same thing as including the file and having it inherit the parent file's variable scope; the script is actually being run on the remote server and the result is then being included into the local script. Link to comment Share on other sites More sharing options...
marcis Posted March 14, 2008 Report Share Posted March 14, 2008 Ja tev viss stāv uz servera tad jau vari inklūdot pa taisno failu, nevis caur urli. Tb include("/http_server/public_html/domain.com/default.php"); Nav man bijusi vajadzības, bet manuprāt, teorētiskā līmenī tas strādā. Link to comment Share on other sites More sharing options...
ray Posted March 17, 2008 Author Report Share Posted March 17, 2008 (edited) Tb include("/http_server/public_html/domain.com/default.php"); es jau mēģināju, bet man rādīja, ka nav atļauja (permission). man vnk vajag pāris php failus vienādus vairākiem domēniem, kurus negribas katram kopēt pa jaunu pēc katrām izmaiņām. Edited March 17, 2008 by ray Link to comment Share on other sites More sharing options...
andrisp Posted March 17, 2008 Report Share Posted March 17, 2008 ray, nu tad tev varbūt vienkārši ir jānomaina tam failam pieejas tiesības. Kādas ir šobrīd ? Link to comment Share on other sites More sharing options...
Recommended Posts