473,626 Members | 3,467 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pb sur un script

Bonjour ,

j'ai un petit pb sur mon script suivant :
<?php

// Ouverture de la session

session_start() ;

// Test si identification effectué et réussi

if (session_is_reg istered("s_regi ster"))
{

echo "<BODY background='../../images/yfond44' text='#ffffff'
link='#ffffff' alink ='#ffffff' vlink='#ffffff' bgproperties='f ixed'>";
echo "<h3><u>Pho tos </u></h3>";

// Test si 1 fichier se trouve dans le repertoire upload

$upload = opendir('./upload/');
$search = array();

// recherche plus particulieremen t les jpgs

while (false!== ($file = readdir($upload )))
{
// Si JPG , on stocke le nom

if (ereg("JPG$",$f ile)||ereg("jpg $",$file)) $search[]=$file;
}
fclose($upload) ;

// Si c le cas , creation des miniatures et rangement des photos dans le
dossier images

if (sizeof($search ))
{

// Index du tableau a zero

$index=0;

// creation de la miniature et deplacement du fichier

do
{
$image_dest = imagecreatetrue color(96,72);
$image_source =
imagecreatefrom jpeg("./upload/".$search[$index]);

$larg_source = imagesx($image_ source);
$haut_source = imagesy($image_ source);

$larg_dest = imagesx($image_ dest);
$haut_dest = imagesy($image_ dest);

@imagecopyresam pled($image_des t,$image_source ,0,0,0,0,
$larg_dest,$hau t_dest,
$larg_source,$h aut_source);

@imagejpeg($ima ge_dest,"./mini/".$search[$index]);

$path_source = "./upload/".$search[$index];
$path_dest = "./images/".$search[$index];

@copy($path_sou rce,$path_dest) ;

@unlink($path_s ource);
}
while ((++$index)<siz eof($search));

}

// Compte le nombre total d'image JPG du repertoire images

$image = opendir("./images/");
$nomjpg = array();
$nbjpg = 0;

// recherche plus particulieremen t les jpgs

while (false!== ($file = readdir($image) ))
{
// Si JPG , on stocke le nom

if (ereg("JPG$",$f ile)||ereg("jpg $",$file))
{
$nomjpg[]=$file;
$nbjpg++;
}
}
fclose($images) ;

// Triage du tableau de nom de fichier

sort($nomjpg,SO RT_REGULAR);

// Enregistre les variables de session

$_SESSION['nom_jpg'] = $nomjpg;
$_SESSION['nb_jpg'] = $nbjpg;

session_registe r('nom_jpg');
session_registe r('nb_jpg');

// Redirection vers la page d'affichage

echo "<SCRIPT language='JavaS cript'>";
echo "window.locatio n='./affiche2.php?co urant=0';";
echo "</SCRIPT>";
}

else
{
header("Locatio n: ../../index.php\n\n") ;
}

?>

Normalement le script sert a verifier si le dossier upload contient une ou
des images , si c le cas , il crée une miniature de celle ci et la range
dans le dossier images.

Il suit ce resonnement :

1 - Verifie si la personne c bien enregistré
2 - Ouvre le dossier upload et verifie s'il y a des fichiers jpg ou
JPG
3 - si c le cas creation de la miniature et rangement dans le
dossier images
4 - Ouvre le dossier images et recupere le nombre et les noms des
fichiers en l'affichage : affiche2.php

Mon problème est le suivant , si le dossier upload ne contient qu'une
dizaine d'images,aucun , par contre si
le dossier en contient plus , je suis obligé de relancer plusieurs fois le
script (vu que ca n'en prend qu'une dizaine à la fois).

Quelqu'un voit il d'ou vient le probleme ?



Jul 17 '05 #1
0 2028

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
12971
by: Mike Daniel | last post by:
I am attempting to use document.write(pageVar) that displays a new html page within a pop-up window and the popup is failing. Also note that pageVar is a complete HTML page containing other java scripts. Being a javascript newbie and after significant testing, I suspect that the document.write fails after finding a </script> within pageVar. Does a trick exist that enables one to slightly alter pageVar whereby enabling...
1
3245
by: bayouprophet | last post by:
Cant get menu script to to put linked page in the same frame. I am new to Java and I am wondering what am I doing wrong? below are my java applet file, frame.html file, and my text file and one of my link file that should load next to the menu on the same page. And Thank You in advance. Here is my menu applet: <html>
1
4808
by: Allen | last post by:
I am trying to add an additional photo/hyperlink to the company web site (I didn't create it) without any luck. The mouseover feature 'highlights' pics by swapping them with another pic using this command in some type of array. I added the mailbox in the lower left corner (see link below)http://www.aamechanical.com/indextemp.htm but I cannot get it to swap. Here is the code for the page: Thanks for your help in advance
3
2956
by: Water Cooler v2 | last post by:
Questions: 1. Can there be more than a single script block in a given HEAD tag? 2. Can there be more than a single script block in a given BODY tag? To test, I tried the following code. None of the script gets executed. Can someone please give me a direction as to what I may be missing? Thanks.
2
2964
by: bilaribilari | last post by:
Hi all, I am using Tidy (C) for parsing html pages. I encountered a page that has some script as follows: <script> .... var abc = "<script>some stuff here</" + "script>"; .... </script>
19
3818
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function myFunc(val1ok, val2ok) ' do something ok myFunc = " return something ok" End Function </script>
3
2481
by: rsteph | last post by:
I have a script that shows the time and date. It's been working on my site for quite a while now. Suddenly it stops showing up, after getting my drop down menu to work. If I put text between the <div id="datetime"></div> tags, the text shows up, but the javascript output being sent to those some divs doesn't seem to want to work. It should be showing up in the middle of the content pane, just below the first table box. (set by .css) Here's...
3
3665
by: Angus | last post by:
I have a web page with a toolbar containing a Save button. The Save button can change contextually to be a Search button in some cases. Hence the button name searchsavechanges. The snippet of html is: <a class="searchsavechanges btn btn3d tbbtn" href="javascript:" style="position:static"> <div id="TBsearchsavechanges">Search</div> </a>
7
3603
by: imtmub | last post by:
I have a page, Head tag Contains many Scripts and style sheet for Menu and Page. This code working fine and displaying menus and page as i wanted. Check this page for reference. http://www.marco.com.cn/web-content/marco_re10.html -------------------------------------------------------------- <head> <!-- InstanceBeginEditable name="doctitle" --> <title>Marco</title> <!-- InstanceEndEditable -->
1
47440
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
0
8202
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8641
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8366
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8510
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5575
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4202
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2628
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1812
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1512
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.