Results 1 to 5 of 5

Thread: include

  1. #1
    Join Date
    Jan 2008
    Posts
    441
    Thanks
    67
    Thanked 4 Times in 4 Posts

    Default include

    how can i make something like this happen?:
    Code:
    href="<?php include("file.php");?>"

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    What does file.php contain if it is an address it will link to whatever page is in that flie.php page. For example

    If file.php contained

    PHP Code:
    echo "http://www.google.com";
    // because echo gives an out put. 
    than that would work.

    If file.php contained

    PHP Code:
    $location "http://www.google.com"

    In your other page you'd have to echo it and I'd pull it in before the href.

    PHP Code:
    include("file.php");
    href="<?php echo $location;?>"
    Corrections to my coding/thoughts welcome.

  3. #3
    Join Date
    Jan 2008
    Posts
    441
    Thanks
    67
    Thanked 4 Times in 4 Posts

    Default

    thank you for responding. file.php would contain html markup and i suppose that would make it an ajax call

  4. #4
    Join Date
    Jan 2008
    Posts
    441
    Thanks
    67
    Thanked 4 Times in 4 Posts

    Default

    i suppose JS would handle that better, but wanted to see if an include would be possible as well

  5. #5
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Well php can't be disable on the client side, parameters can be set that determine which html is used before the page is loaded, and if using a db you can query it.
    Corrections to my coding/thoughts welcome.

Bookmarks

Posting Permissions

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