Announcement

Collapse
No announcement yet.

Very simple PHP syntax questions...

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

  • Very simple PHP syntax questions...

    Hi, just curious what's the correct syntax to use to get this to work (name of the file to read in is passed in the ?filename url link):
    PHP Code:
    <?php readfile("http://www.domain.com/vendor/lc/" + print htmlspecialchars($QUERY_STRING) + ".txt");
    Thanks!!!

  • #2
    Now I've tried this, but the specialcharacters line/variable is resulting in parse error.. hmm.. any ideas?

    PHP Code:
    <?php 
    $lclnkpt1 
    "http://www.domain.com/vendor/lc/code_"
    $lclnkpt2 htmlspecialchars($QUERY_STRING);
    $lclnkpt3 ".txt"
    $lclnk$lclnkpt1 $lclnkp2 lclnkp3
    readfile
    ($lclnk); ?>

    Comment


    • #3
      Gah...

      FIIIIiiinally figured it out:

      PHP Code:
      <?php
      $pt1 
      "http://www.domain.com/vendor/lc/code_";
      $pt2 htmlspecialchars($QUERY_STRING);
      $pt3 ".txt";
      $lclnk $pt1 $pt2$pt3;
      ?>
      <?php readfile
      ($lclnk); ?>
      You programmers are twisted and evil in all this specific syntax stuff LOL... Glad i'm not one hahaha... (no offense.).

      Comment


      • #4
        I think something like this

        PHP Code:
        readfile("http://www.domain.com/vendor/lc/" htmlspecialchars($QUERY_STRING) . ".txt"); 
        Should work, though
        Syntax errors in my post ? Well, I'm a french-speaking Swiss user..

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...
        X