Code Help

Status
Not open for further replies.

Clit

Posting Freak
Feb 25, 2012
1,065
103
Obviously this is the dropdown menu for news image for posting a news article from my housekeeping...

Code:
<div class='clearfix'>
                    <label for='article_image'>Image</label>
                    <div class='input'>
                        <!--<input type='text' name='article_image' id='article_image' style='width: 400px'>&nbsp;&nbsp;<i>top news</i>
-->";
//Looks into the directory and returns the files, no subdirectories
    echo "<select name='article_image' onchange='imgchange(this.value)'>";
//The path to the style directory
    $dirpath = "http://puffet.org/r63/c_images/Top_Story_Images";
    $dh = opendir($dirpath);
      while (false !== ($file = readdir($dh))) {
//Don't list subdirectories
          if (!is_dir("$dirpath/$file")) {
//Truncate the file extension and capitalize the first letter
          echo "<option value='$file'>$file</option>";
  }
}
    closedir($dh);
//Close Select
echo "</select><br /><br />
<img src='asd' id='newsimage'/>
                    </div>
                </div>

Without the code the page loads instantly, with the code it just loads and loads and keeps going until I hit stop. Basically the page won't load at all. I usuaully good with figuring this shit out, but, I just cannot get my finger wrapped around this one.
 

Seano2o6

New Member
Aug 18, 2011
12
11
Try dis.

PHP:
<div class='clearfix'>
                    <label for='article_image'>Image</label>
                    <div class='input'>
                        <!--<input type='text' name='article_image' id='article_image' style='width: 400px'>&nbsp;&nbsp;<i>top news</i>
 
    echo "<select name='article_image' onchange='imgchange(this.value)'>";
 
    $dirpath = "http://puffet.org/r63/c_images/Top_Story_Images";
   
$dh = opendir($dirpath);
 
          if (!is_dir("$dirpath/$file")) {
 
          echo "<option value='$file'>$file</option>";
  }
 
    closedir($dh);
 
echo "</select><br /><br />
<img src='asd' id='newsimage'/>
                    </div>
                </div>"
 

Clit

Posting Freak
Feb 25, 2012
1,065
103
Nope , just loads blank content. 
Fuck that, got rid of the code altogether, I'll add a link to the directory, and they can copy the image link and paste it to the box.

PHP:
<div class='clearfix'>
                    <label for='article_title'>Title</label>
                    <div class='input'>
                        <input type='text' name='article_title' id='article_title' style='width: 400px'>
                    </div>
                </div>";

k6pQFwUe.png
 

Heaplink

Developer & Designer
Nov 9, 2011
510
173
It's because you are trying to download ALL images synchronous from this URL
Code:
http://puffet.org/r63/c_images/Top_Story_Images
. Use AJAX to get the content asynchronous.

EDIT:
And I realized that the domain it's hosted on is not responding either, so if it's your domain you need to fix that first, if not get from another source.
 

Clit

Posting Freak
Feb 25, 2012
1,065
103
It's because you are trying to download ALL images synchronous from this URL
Code:
http://puffet.org/r63/c_images/Top_Story_Images
. Use AJAX to get the content asynchronous.

EDIT:
And I realized that the domain it's hosted on is not responding either, so if it's your domain you need to fix that first, if not get from another source.
puffet.org does respond.. :confused:
 
Status
Not open for further replies.

Users who are viewing this thread

Top