Announcement

Collapse
No announcement yet.

relative path in SC

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • relative path in SC

    I want to add a print of a grid to an email. I use emogrifier for this.

    I need to set the path to this file. When i use the following code everything works perfect.
    $html=file_get_contents("https://123.myscriptcase.com/scriptcase9/app/W/grid_tblwissel_mail_eigen_nieuw/grid_tblwissel_mail_eigen_nieuw.php);

    But when i use a relative path it does not work anymore. I get an error this file does not exist.
    $html = file_get_contents("../grid_tblwissel_mail_eigen_nieuw/grid_tblwissel_mail_eigen_nieuw.php);

    The weird thing is that the relative path DOES work with the css.
    $css = file_get_contents("../_lib/css/Sc9_Rhino/Sc9_Rhino_grid.css");


    Since the path of the production server is different i want to use the relative path. Below is the full path of the production server
    $html = file_get_contents("https://rf2019.be/grid_tblwissel_mail_eigen_nieuw/grid_tblwissel_mail_eigen_nieuw.php");


    Any suggestions how to put this in one line of code? Or am i doing something wrong with the relative path?
    https://123.myscriptcase.com/scriptcase9/app/W and https://rf2019.be

  • #2
    This is something I always struggle with. What could be helpful is to use the log function to see what the working directory is. If you can access your application from the url, you can always create the full url to execute based upon the standard php functions.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      ../ => starts at root path
      ./ => starts at cuurent path

      Comment

      Working...
      X