function win(pat)

From: Date: Thu, 24 Apr 2003 06:55:24 +0000
Subject: function win(pat)
Groups: php.general 
Request: Send a blank email to php-general+get-145120@lists.php.net to get a copy of this message
hi everybody, hope u all are doing fine. in my php script i have a javascirpt function as follows: <script language="JavaScript"> function win(pat) { <?php echo"<form method=get action=\"fcheck1.php\" name=form1> <input type=\"text\" name=\"path\" value=\"$path\">; <input type=\"submit\" name=\"submit\">"; ?> } </script> and in the later part of the script,i am putting images of a directory in a table using a for loop as follows: echo"<table><tr>"; $counter=1; for($i=2;$i<count($filenames);$i++)
    {
       $pos=strpos($filenames[$i],".");
       $leng=strlen($filenames[$i]);
       $s1=substr($filenames[$i],0,$pos);
        $s2=substr($filenames[$i],$pos+1,$leng);
       $path="./bgimages/".$filenames[$i];
       echo"<td><a href='#' onClick='win(\"$path\")'><img src=$path width=75
height=75></a></td>"; $counter=$counter+1; if($counter==10)
    {
      echo"</tr><tr>";
       $counter=1;
} } echo"</tr></table>"; what i want to do with this script is display the images of directory in a table and on click of one image function win(pat) be invoked so that the path name of the image is displayed in text box and a submit button is created. when i run the script, i get the all the images in the table but a message "error on page" is also got and function win(path) does not work on clicking any one of the images. any help will be greatly appreciated. thanks a lot, regards, diksha.

« previous php.general (#145120) next »