SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2001
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Quickie for someone

    Hi I have been shown how to call an image from a variable can someone please show me how to call an html file using the same variable

    so in other words say the $memid = 1234 then this below inserts the image 1234.jpg so how do I get another line to call 1234.html

    $row["memid"]);
    print "<img src=\"/gfx/".(string)$row["memid"].".jpg\">";

  2. #2
    SitePoint Enthusiast drisley's Avatar
    Join Date
    Jun 2001
    Location
    Florida
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can do the same basic thing, but just use an include() function to include 1234.html.
    David Risley
    Web Developer, Web Publisher, Blogger, Tech Dude
    PC Mechanic | WebbyOnline

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2001
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't understand I am new to this can you elaborate please

  4. #4
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To print out the contents of 1234.html, assuming $row[memid] is 1234, do this:

    include($row['memid'].'.html');

  5. #5
    SitePoint Enthusiast
    Join Date
    May 2001
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks that had the desired effect except it prints the page instead of a link which in turn opens the page.

  6. #6
    Victory shall be mine tubedogg's Avatar
    Join Date
    Mar 2001
    Location
    Medina, OH
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's what you asked for. But in any case, you would do
    print("/path/to/".$row[memid].".html");
    Kevin

  7. #7
    SitePoint Enthusiast
    Join Date
    May 2001
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys I have worked it out.

    printf("<td>Click Account Number For More Infoa href=\"%s.html\" target=blank>%s</a>\n",
    $row["memid"], $row["memid"]);

    It works for now anyway lol

    I have been trying to post a thankyou all day ....


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
  •