Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts

    require question

    Could some perhaps explain why this will work
    PHP Code:
    require 'file_defs.php';

    echo 
    "<a href=\"$antes$SYWC$FL[0]$options\">Scores and Standings</a>"
    and this will not?
    PHP Code:
    require 'http://www.mywebsite.com/file_defs.php';

    echo 
    "<a href=\"$antes.$SYWC.$FL[0].$options\">Scores and Standings</a>"
    I would have thought that I need the period between each variable. And when I use the entire url for the require it won't work either.

    Any ideas?

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    PHP Code:
    echo "<a href=\"".$antes.$SYWC.$FL[0].$options."\">Scores and Standings</a>"
    Are you on windows? if you are, I think I remember that includes and require's won't work with a full url, but I ain't too sure

  • #3
    Regular Coder
    Join Date
    Sep 2002
    Location
    British Columbia
    Posts
    235
    Thanks
    0
    Thanked 0 Times in 0 Posts
    When you require or include a file by specifying a URL you cannot get variables back from it. You can only get the variables if you do it like in your first example.

    You don't need periods between the variable names if they are enclosed in double-quotes.

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks guys. Dylan, I really hope theres a way I can my problem solved, and use the full url path of the require (or include). I'm new to php, but have been learning every day.

    I've been trying to get a menu system I have that uses those variables to work with cms, postnuke. For some reason with postnuke, my links will only show up if I include the full path of the url for the require. My site is hosted by someone else, but I checked and there on a linux system as well, yet my link is only working without the period separating things too.

    This make sense? I've posted on postnukes site too, however i'm learning there support is pretty poor.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •