Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

explode problem - weird PHP issue

Status
Not open for further replies.

rrsub

MIS
Joined
Oct 23, 2002
Messages
536
Location
US
For weeks, my script that has an explode() statement worked well. All of a sudden, it stopped exploding.

No changes were made to the code, settings on the server, etc...

I rebooted the server and it still didn't work. All of a sudden, it started to work again.

The data comes from a POST form which is a directory listing so it's really not dependent on anything else.

What happened here?
 
Windows 2000, module, 4.2.3 with mssql

What doesn't make sense is that it stopped working where no changes were made.

########## snip ############

if (isset($_POST['listing'])){

$list = $_POST['listing'];
$image = explode("h.jpg", $list);

$i=0;
while (strlen($image[$i])>>4){
$image['h'][$i]= $image[$i]."h.jpg";
$image['t'][$i]= $image[$i]."t.jpg";
$image['w'][$i]= $image[$i]."w.jpg";
$i++;
}
$image_ct = $i;
$image_ct_list = $i-1;

$title = "Category, Photographer, and Image Verification";
include ("form_hdr.php"); //-Header List

print $image_ct.&quot; images to add.<br>\n&quot;;

print &quot;<br><br>\n&quot;;
print &quot;<table border='1' align=center>&quot;;

for ($i = 0; $i <= $image_ct_list; $i++){
print &quot;<tr>\n&quot;;
print &quot;<td>&quot;.($i+1).&quot;</td>\n&quot;;
print &quot;<td>&quot;.$image['h'][$i].&quot;</td>\n&quot;;
print &quot;<td>&quot;.$image['t'][$i].&quot;</td>\n&quot;;
print &quot;<td>&quot;.$image['w'][$i].&quot;</td>\n&quot;;
print &quot;</tr>\n&quot;;
}
print &quot;</table>\n&quot;;
 
I was afraid to because this is a production server and this tool is vital. If it happens again, I will. That's the only thing I can think of too.

Thanks. You've been a great help many times.
 
There are users that make Hi-res images and they batch those to make thumbnails and watermarked images.

The images are identical in name except for the h.jpg, t.jpg, w.jpg.

Someone uploads the images and someone enters where these images go in the database. Why there are 3 entries for the same image is beyond me and that's the way the programmers want to keep it. The site is in ASP and the directory structure is a mess.

This was my solution to help with the mass entry of images and has already taken what used to take 3 minutes for 10 images (manually) now takes 5 seconds for hundreds.

Anyway, the user takes a directory listing of the hi-res images and pastes it into the form. The script explodes the input and inserts it into the databae.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top