Jump to content

pleek

Members
  • Posts

    135
  • Joined

  • Last visited

Posts posted by pleek

  1. What i have

    Ok so i have a code that uploads images to a dir on my server. The script works great but i want to modify it. The script shows all the pictures in the "images" dir that have been uploaded. Here is the script working on my server

     

    What i want to do

    The current code actually shows all the images that have been uploaded. I would like it to just show the link to the one you just uploaded. I know its possible but i have no clue how to do it. Any ideas?

     

    Heres the script that shows the photos in the "images" dir:

     

    list_images.php

     

    <?
    $handle = @opendir("images");
    
    if(!empty($handle))
    {
    while(false !== ($file = readdir($handle)))
    {
    if(is_file("images/" . $file))
    echo '<img src="images/' . $file . '"><br><br>';
    }
    }
    
    closedir($handle);
    ?>
    

     

    There are two other php files also, upload.php and upload_form.php

  2. so i Have to use those functions? what is wrong with the ones i wrote, they follow the guide that was posted for me to use. And if i use those functions then how do i use a if statement to run the hide() function if the cookie says hidden?

  3. does anybody here actually help people? or just say go search it? ive read all the information that showed up on google and the page the post above me said to read. Here is my code WHY WON'T IT WORK?????!?!?!?!?!?

     

     

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    <HTML>
    <HEAD>
    <TITLE>Untitled</TITLE>
    <META NAME="GENERATOR" CONTENT="MAX's HTML Beauty++ 2004">
    </HEAD>
    
    <BODY>
    
    <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
    function hello() {
    document.write("<p>Here is some simple text</p>")
    }
    
    if (document.cookie == "shoutbox=show") {
    hello()
    document.write("<p>This is the show cookie</p>");
    }
    if (document.cookie == "shoutbox=hidden") {
    document.write("<p>This is the hidden cookie</p>");
    document.getElementById("frame1").height="0";
    }
    
    function hide() {
    document.getElementById("frame1").height="0";
    }
    function set_cookie() {
    document.cookie = "shoutbox=hidden; expires=13/06/2010 00:00:00";
    }
    function remove_cookie() {
    document.cookie = "shoutbox=show; expires=13/06/2010 00:00:00";
    }
    
    
    </SCRIPT>
    <INPUT TYPE="button" NAME="Get_Cookie" VALUE="Get Cookie" onClick="alert(document.cookie)">
    <INPUT TYPE="button" NAME="Set_Cookie" VALUE="Set Cookie" onClick="set_cookie()">
    <INPUT TYPE="button" NAME="Remove_Cookie" VALUE="Remove Cookie" onClick="remove_cookie()">
    <INPUT TYPE="button" Name="Text" VALUE="Text" onClick="text()">
    <INPUT TYPE="button" Name="hide" VALUE="hide" onClick="hide()">
    <!-- SHOUT BOX -->
    <IFRAME ID="frame1" SRC="http://www2.shoutmix.com/?pleek" WIDTH="100%" HEIGHT="275" FRAMEBORDER="0" ALIGN="Center" SCROLLING="no">
    </IFRAME>
    <!-- END SHOUT BOX-->
    
    </BODY>
    </HTML>
    

  4. ok I think i got the cookie part FINALLY!!!! Here is my new code, The cookie works in changing the text at the top to tell me which cookie is set but i can't figure out how to get it to run the show() hide() functions depending on the cookie. I tried just copy and pasting in the dom of the functions into my if/else command but that didn't work, can somebody help me out and tell me how to make it so if the cookie says hidden it will run the hide() function?



    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    <HTML>
    <HEAD>
    <TITLE>Untitled</TITLE>
    <META NAME="GENERATOR" CONTENT="MAX's HTML Beauty++ 2004">
    </HEAD>
    
    <BODY>
    
    <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
    
    if (document.cookie == "shoutbox=show") {
    document.write("<p>This is the show cookie</p>");
    }
    else {
    document.write("<p>This is the hidden cookie</p>");
    }
    
    function set_cookie() {
    document.cookie = "shoutbox=hidden; expires=13/06/2010 00:00:00";
    
    }
    function remove_cookie() {
    document.cookie = "shoutbox=show; expires=13/06/2010 00:00:00";
    }
    
    
    </SCRIPT>
    <INPUT TYPE="button" NAME="Get_Cookie" VALUE="Get Cookie" onClick="alert(document.cookie)">
    <INPUT TYPE="button" NAME="Set_Cookie" VALUE="Set Cookie" onClick="set_cookie()">
    <INPUT TYPE="button" NAME="Remove_Cookie" VALUE="Remove Cookie" onClick="remove_cookie()">
    
    <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
    
    //SHOUT BOX MINUS & EXPAND
    function hide() {
    document.getElementById("frame1").height="0";
    document.getElementById("BAR").src="http://craigh.tlcrepair.net/mkportal/modules/gallery/album/a_4.gif";
    document.getElementById("BAR").onclick=show;
    document.getElementById("BARUP").src="http://craigh.tlcrepair.net/mkportal/modules/gallery/album/a_6.gif";
    }
    
    function show() {
    document.getElementById("frame1").height="250";
    document.getElementById("BAR").src="http://craigh.tlcrepair.net/mkportal/modules/gallery/album/a_3.gif";
    document.getElementById("BAR").onclick=hide;
    document.getElementById("BARUP").src="http://craigh.tlcrepair.net/mkportal/modules/gallery/album/a_5.gif";
    }
    //END SHOUT BOX MINUS & EXPAND
    </script>
    
    <IMG ID="BARUP" SRC="http://craigh.tlcrepair.net/mkportal/modules/gallery/album/a_5.gif" WIDTH="100%" HEIGHT="6">
    
    <!-- SHOUT BOX -->
    <IFRAME ID="frame1" SRC="http://www2.shoutmix.com/?pleek" WIDTH="100%" HEIGHT="275" FRAMEBORDER="0" ALIGN="Center" SCROLLING="no">
    </IFRAME>
    <!-- END SHOUT BOX-->
    
    <IMG ID="BAR" CLASS="pointer" SRC="http://craigh.tlcrepair.net/mkportal/modules/gallery/album/a_3.gif" WIDTH="100%" HEIGHT="15" ONCLICK="hide()">
    </BODY>
    </HTML>
    

  5. like say i have this code

     

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    <HTML>
    <HEAD>
    <TITLE>Untitled</TITLE>
    <META NAME="GENERATOR" CONTENT="MAX's HTML Beauty++ 2004">
    </HEAD>
    
    <BODY>
    <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
    if (document.cookie = "shoutbox=hidden") {
    document.write("<B>WOW it works finally</B>");
    } 
    else {
    document.write("<B>YEAH!!!!</B>");
    }
    document.cookie = "shoutbox=show; expires=15/02/2010 00:00:00";
    </SCRIPT>
    <INPUT type="button" value="Get Cookie String" name="shoutbox"
    onClick='alert(document.cookie)'>
    </BODY>
    </HTML>
    

     

    What am i doing wrong, ive read all the stuff for like the first 3 sites that came up for "javascript cookies" and none of them help me with this part

  6. i have and i don't get it.

     

    document.cookie="nameofCookie=cookieData" from other things ive seen i can just use this, but i don't understand on how to use the if statement to check if the name is hidden or show. Can some one explain how to use the cookie to see if the text should be hidden or not?

  7. ok so i have this code

     

    <html>
    <head>
    <body>
    <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
    
    
    
    if (document.cookie = "Show") {
    document.write("<b>SHOW</b>");
    } 
    else {
    document.write("<b>HIDE</b>");
    }
    
    //SHOUT BOX MINUS & EXPAND
    function hide() {
    document.getElementById("frame1").height="0";
    document.getElementById("BAR").src="http://craigh.tlcrepair.net/mkportal/modules/gallery/album/a_4.gif";
    document.getElementById("BAR").onclick=show;
    document.getElementById("BARUP").src="http://craigh.tlcrepair.net/mkportal/modules/gallery/album/a_6.gif";
    document.cookie = "Hidden";
    }
    
    function show() {
    document.getElementById("frame1").height="250";
    document.getElementById("BAR").src="http://craigh.tlcrepair.net/mkportal/modules/gallery/album/a_3.gif";
    document.getElementById("BAR").onclick=hide;
    document.getElementById("BARUP").src="http://craigh.tlcrepair.net/mkportal/modules/gallery/album/a_5.gif";
    document.cookie = "Show";
    }
    //END SHOUT BOX MINUS & EXPAND
    </script>
    
    <IMG ID="BARUP" SRC="http://craigh.tlcrepair.net/mkportal/modules/gallery/album/a_5.gif" WIDTH="100%" HEIGHT="6">
    
    <!-- SHOUT BOX -->
    <IFRAME ID="frame1" SRC="http://www2.shoutmix.com/?pleek" WIDTH="100%" HEIGHT="275" FRAMEBORDER="0" ALIGN="Center" SCROLLING="no">
    </IFRAME>
    <!-- END SHOUT BOX-->
    
    <IMG ID="BAR" CLASS="pointer" SRC="http://craigh.tlcrepair.net/mkportal/modules/gallery/album/a_3.gif" WIDTH="100%" HEIGHT="15" ONCLICK="hide()">
    
    
    <P>Use the following buttons to experiment with these statements:</P>
    <FORM>
    
    <INPUT TYPE="button" VALUE="display cookie" onClick="alert(document.cookie);">
    </FORM>
    </head>
    
    
    </body>
    </html>
    

     

    Its supposed to change the words at the top from SHOW to HIDDEN acourding to the cookie. Now i change the cookie by colapsing the shoutbox. I then click show cookie and it says its HIDDEN. But when i click refresh it changes it right back to SHOW and the text at the top doesn't change. CAN anyone figure out what im doing wrong???????????????????

  8. I accidently posted this in php help and i didn't know how to move it so i just reposted it.

     


    ok so i have this code.

     

    Here is what it looks like

     

    Here is the code

    <html>
    <head>
    <title>Heading</title>
    </head>
    
    <body>
    <a href="http://www.craigh.tlcrepair.net">
    <img src="http://craigh.tlcrepair.net/mkportal/templates/Forum/images//banner2.jpg" 
    
    width="100%" height="100" border="0">
    <center>
    <object 
    
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"codebase="http://download.macromedia.com
    
    /pub/shockwave/cabs/flash/swflas.cab#version=7,0,19,0" width="780" HEIGHT="100">
      <param name="movie" value="newbanner5.swf">
      <param name="quality" value="high">
      <param name=wmode value="transparent">  
      <embed src="newbanner5.swf" quality="high" wmode="transparent" 
    
    pluginspage="http://www.macromedia.com/go/getflashplayer" 
    
    type="application/x-shockwave-flash" width="780" HEIGHT="100">
    </embed>
    </object>
    </center>
    </a>
    </Body>
    
    </html>

     

     

    Im having two problems with this code.

     

        First being that i can not for the life of me get the swf banner in front of the background image. Ive tried a couple of different ways but nether of them worked. This could just mean i was coding it wrong.

     

        Second. The like for the banner is to the main index of my site. When you mouse over the background image the cursor changes to a pointer but not when you mouse over the swf banner even though they are both part of the same link.

     

    Any help on ether of these problems would be much appreciated.

  9. ok so i have this code.

     

    Here is what it looks like

     

    Here is the code

    <html>
    <head>
    <title>Heading</title>
    </head>
    
    <body>
    <a href="http://www.craigh.tlcrepair.net">
    <img src="http://craigh.tlcrepair.net/mkportal/templates/Forum/images//banner2.jpg" 
    
    width="100%" height="100" border="0">
    <center>
    <object 
    
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"codebase="http://download.macromedia.com
    
    /pub/shockwave/cabs/flash/swflas.cab#version=7,0,19,0" width="780" HEIGHT="100">
      <param name="movie" value="newbanner5.swf">
      <param name="quality" value="high">
      <param name=wmode value="transparent">  
      <embed src="newbanner5.swf" quality="high" wmode="transparent" 
    
    pluginspage="http://www.macromedia.com/go/getflashplayer" 
    
    type="application/x-shockwave-flash" width="780" HEIGHT="100">
    </embed>
    </object>
    </center>
    </a>
    </Body>
    
    </html>
    

     

    Im having two problems with this code.

     

        First being that i can not for the life of me get the swf banner in front of the background image. Ive tried a couple of different ways but nether of them worked. This could just mean i was coding it wrong.

     

        Second. The like for the banner is to the main index of my site. When you mouse over the background image the cursor changes to a pointer but not when you mouse over the swf banner even though they are both part of the same link.

     

    Any help on ether of these problems would be much appreciated.

  10. ok so i have this part on my website that i have writting to collaps the shout box. The script works perfectly but i wan the plus and minus words and pics to replace themselves when u click on them

     

    I got the text and pic to replace once but i can't get it to change to the other text and pic every time u click it

     

    my code is

     

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    <HTML>
    <HEAD>
    <TITLE>Untitled</TITLE>
    <script type="text/javascript">
    
    function hide()
    {
    document.getElementById("PAR").innerHTML =
    	"<a href='javascript: void(0)'><IMG SRC='plus.GIF' WIDTH='10' HEIGHT='10'> Show Shout Box</a>" 
    }
    
    </script>
    
    </HEAD>
    
    <BODY>
    <p id="PAR" onclick="hide()">
      <a href="javascript: void(0))"><IMG SRC="minus.gif" WIDTH="10" HEIGHT="10"> Hide Shout Box</a>
    </p>
    
    
    </a>
    </BODY>
    </HTML>
    

     

    this works fine the first time but i don't know how to make it change everytime u click on it, Can somebody help me out here?

  11. hey everybody ive just got a quick question for u all.

     

    Is there any code out there that will alert me (in any way) that the directory the code is in has been changed? Im tryin to set up a part on my server space for a adult friend of mine to put codes, programs, and other stuff in a directory for me when he gets something he thinks id like to have, and have it notify me when something new is added. By e-mail alert on my main page, or really anything.

     

    If this is impossible let me know but im quite sure that this can be done. Anybody know? maby a guide or a sample code. Any help would be apreciated.

  12. ok so i got this code off a website because my original code (from the book im learning from) was to complex for the little bit i needed it to do.

     

    Heres the code

     

    <script type="text/javascript">
    var z = 10;
    function ShowHide(id) {
    document.getElementById(id).style.display = "block";
    document.getElementById(id).style.zIndex = z++;
    }
    </script>

     

    ok i have two <div>s and i want it so that when u click on a button the div assinged to the button is brought forward. Im not to familier with the getElementbyId part of things so can somebody help me out?

     

    a sample script for one of the buttons would help to.

     

    Thanks in advance....

  13. ok ive looked all over the internet on how to change the zIndex of a iframe from a different iframe

     

    I have it so that a iframe is blocking part of another iframe and i want it so that when ok is pressed the iframe behind it is brought to the front. can anybody help me here???

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.