A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: I got a Chalenge for you.. I think

  1. #1

    The Slinkiest FatPig there is!

    Join Date
    Aug 2000
    Posts
    316
    ok well i am doing a site for an art gallary. And of course there is alot of images that need to be up there.

    I want the images to come up in menuless windows. But this is going to take way too much time if each one i have to make an HTML page for and put in all the java ect

    So my question is.. is there a way that i can make one htm page and have the image needed loaded. The one way i can think of making it happen is using asp and a database

    but i dont know asp at all and i am not all that good at access. Is there a better way or is it easy to do with asp even not being an asp guy?



    Thanks
    Rod

  2. #2
    Senior Member
    Join Date
    Apr 2001
    Posts
    139
    Originally posted by StinkyFatPig
    So my question is.. is there a way that i can make one htm page and have the image needed loaded. The one way i can think of making it happen is using asp and a database
    Are you happy to use PHP instead?

    If so, create your normal HTML file with one of the relevant images in it. Now open the HTML file in a text editor and find the <img> tag which contains the image. Now simply do this.

    Where the tag says <img src="theimagefile.jpg" ... >

    replace theimagefile.jpg (leave the ""s) with the following

    Code:
    <?php echo $imagefilename;?>
    so that you have <img src="<?php echo $imagefilename;?>">

    Save this file as a .php file.

    Now you can simply load the page but pass a variable to it in the path name. So let's say you wanted to load image5.jpg into the box. You just need to reference the page like this:

    mypage.php?imagefilename=image5.jpg

    Does this help? Let me know if anything needs clarifying!

  3. #3

    The Slinkiest FatPig there is!

    Join Date
    Aug 2000
    Posts
    316
    ok sounds pretty simple

    I am not at my work system right now so i cant try it but

    do i need anything special to run php files?

    I dont know if my server suports it
    and I usialy test things out on my own server made with simple server. Thanks alot for the help
    and i will post more about my progress when i get back to my system


  4. #4
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    Hi,

    other than backend stuff, your html page could also contain a little javascript to pick up the location.search.
    You would call the page
    http://www.server.com/showpic.html?imaage17.gif
    and there would be something like that in the page (untested, please check substr() parameters!)
    <script>
    var img = location.search.substr(1);
    document.write('<img src="images/'+img+'">');
    </script>

    Musicman

  5. #5

    The Slinkiest FatPig there is!

    Join Date
    Aug 2000
    Posts
    316
    hey musicman

    the javascript stuff sounds more intresting to me cause i know alittle more about it

    but what part do i need to modifi for it?

    please place * were i need to modifie stuff

    I am going to give it a shot right now so you will probably be hearing from me again

  6. #6

    The Slinkiest FatPig there is!

    Join Date
    Aug 2000
    Posts
    316
    ok now that I look at it i am alittle unclear


    ok you said call the page that the images are going to come up in called "http://www.server.com/showpic.html?imaage17.gif"
    so do i want to call the page "showpic.html"
    what do i do with the "?image17.gif"

    or is that the link? "showpic.html?image17.gif"

    and were do i put the
    <script>
    var img = location.search.substr(1);
    document.write('<img src="images/'+img+'">');
    </script>
    in the popup page or in the original page that the links are going to be on?

  7. #7
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    Hi

    the one I suggested before would load a html with an image in it. You might perhaps even prefer just window (no html decoration like image title)
    Your main page would have a function like
    <script>
    function showimage(img)
    { var newwin = windoe.open("", "image", "width=400,height=300,location=0,toolbar=0,... ")
    window.document.write('<img src="images/'+img+'" border=0>');
    window.document.close();
    }
    </script>

    and you would call that as <a href="javascript:showimage('image17.gif')">

    Musicman

  8. #8

    The Slinkiest FatPig there is!

    Join Date
    Aug 2000
    Posts
    316
    Thanks alot

    you have you made it alot clearer this time

    but ther eis an error somewere

    can you help me find it?

  9. #9

    The Slinkiest FatPig there is!

    Join Date
    Aug 2000
    Posts
    316
    one other thing

    were do i specife the html page it loads it in

    or does it need one?

    thanks


    oh and this is what i have just for refrance



    <html>
    <head>
    <title>The Yew Tree 3D Portfolio</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script>
    function showimage(img)
    { var newwin = windoe.open("", "image", "width=400,height=300,location=0,toolbar=0,... ")
    window.document.write('<img src="images/'+img+'" border=0>');
    window.document.close();
    }
    </script>

    </head>



    <body bgcolor="#000000" text="#FFFFFF" leftmargin="0" topmargin="0">
    <table width="799" border="1" height="151">
    <tr>
    <td height="160" width="215"><a href="javascript:showimage('YEWG06%20Small.jpg')"> <img src="YEWG06%20Small.jpg"></a></td>
    <td height="160" width="183"><img src="YEWG08%20Small.jpg" width="200" height="300"></td>
    <td height="160" width="198"><img src="YEWG09%20Small.jpg" width="200" height="363"></td>
    <td height="160" width="185"><img src="YEWG11%20Small.jpg" width="200" height="218"></td>

  10. #10
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    Hi,

    it looks like I managed to misspell "window"...

    Musicman

  11. #11
    Senior Member
    Join Date
    Mar 2001
    Posts
    237
    why don't you just have a dummy html file called something like "popup.html"

    in that window have an image tag like this:

    <img name="imgname" src="blank.jpg">

    where blank is just a blank image.

    then in the onload of that popup page, check a variable called currentImage or something.. then call a function that will switch out blank.jpg with whatever the value of currentImage is.

    then in the document you're calling from (the main window, not the pop up window) just open popup.html into a new window and set its currentImage variable to the location of the image.

    this is all untested and just speculation. i have no idea if it will work.. but this is what i thought of when i read your original question. try it if the other solution doesn't work for you.

    ~jimmy.

  12. #12

    The Slinkiest FatPig there is!

    Join Date
    Aug 2000
    Posts
    316
    ohh i hate those mistakes

    there always hard to find

    ok well it kinda works now

    its loading the popup

    but the main page is trying to load the image i want to load in the popup

    i will play around with it a bit and see what i can doo

    thanks alot, This is going to make my job much more simple



    Rod

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center