Jump to content

katia

Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by katia

  1. katia

    Images in js

    For now, my pc is my server, so should I use: "http://localhost/Img/1.jpg" as my path?
  2. katia

    Images in js

    If the picture is on your server, how does it have to be the picture path? Because if the src is like this: "../Img/1.jpg" , pic.width and pic.heigth will return undefined.
  3. My array contained some elements like: ..Img\album4\321dd.jpg and when I copied it to the javascript array it was all messed up because the "\" . I did put the javascript code in the place where I create the php array, I added some functions for changing the image src value and it works.Thank you guys, I really appreciate your help.
  4. I keep it there because I need the result of the function when I press the "next" button. The button code is above the code where I create the array.I will work on it more tomorrow.Thank you guys for your help
  5. It seems that it doesArray ( [0] => ..\Img\album4\37e4.jpg [1] => ..\Img\album4\630e.jpg [2] => ..\Img\album4\delbanchet1.jpg [3] => ..\Img\album4\delbanchet2.JPG [4] => ..\Img\album4\DSC03627.jpg [5] => ..\Img\album4\S3010390.JPG )
  6. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><title>Slide show</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><script type="text/javascript"> <!--function parseArray(sirpics){sir = new Array();<?phpfor ($i = 0; $i < count($sirpics); $i++)echo "sir[{$i}] = \"{$sirpics[$i]}\";\n";?>alert(sir[0]);}--></script><body><form name="form1" method="post" action="slideshow.php"> <table width="980" height="1045" border="1" cellpadding="0" cellspacing="0"> <tr> <td width="81" height="128"> </td> <td width="800"><table width="797" height="74" border="1" cellpadding="0" cellspacing="0"> <tr> <td width="259"> </td> <td width="277"><input type="button" name="Button" value="Start"></td> <td width="253"> </td> </tr> <tr> <td><input type="button" name="Submit3" value="back" onClick=""></td> <td><input type="button" name="Submit2" value="Stop"></td> <td><div align="justify"> <? $nrpoza=$nrpoza; $numepoza=$numepoza; $album=$album; $opendir = opendir($album); $dim=0; $sirpics=array(); while($fname=readdir($opendir)) { $poza=$album."\\".$fname; $a=split("\\\\\\\\",$album); $nr=count($a)-1; $pozanou="..\\Img\\".$a[$nr]."\\".$fname; if (is_file($poza)) { $sirpics[$dim]=$pozanou; $dim++; } } echo " <input type=\"button\" name=\"Submit4\" value=\"next\" onClick=\"parseArray($sirpics)\"> "; ?> </div></td> </tr> </table></td> <td width="91"> </td> </tr> <tr> <td height="330"> </td> <? $nrpoza=$nrpoza-1; $poza=$sirpic[$nrpoza]; $proba=str_replace("\\\\","\\",$poza); $t_ht=600; $t_wd=seteazaDimensiuni($proba); echo "<td><img name=\"locpoza\" id=\"locpoza\" src=$sirpic[$nrpoza] height=$t_ht width=$t_wd alt=\"\"></td>"; closedir($opendir); ?> <td> </td> </tr> <tr> <td rowspan="2"> </td> <td><? echo $nrpoza." din ".$dim; ?> </td> <td rowspan="2"> </td> </tr> <tr> <td><a href="#">back to albume</a></td> </tr> </table> </form></body></html><?function seteazaDimensiuni($imagine){$imageinfo = getimagesize("$imagine");$t_ht=600;$o_wd=$imageinfo[0];$o_ht=$imageinfo[1];$t_wd=round($o_wd*$t_ht/$o_ht);return $t_wd; } ?>
  7. After changing this line, I did't get error messages anymore , but when I try to check the result , the alert (ar[0]) returns undefined
  8. But if I change it to:<? echo " <input type=\"button\" name=\"Submit4\" value=\"next\" onClick=\"parseArray( $picarray )\"> "; ?> and in the Java script I have just an alert function parseArray(picarray){alert(picarray[0]);} or function parseArray(picarray)ar=new Array();<?phpfor ($i = 0; $i < count($picarray); $i++)echo "$ar[$i] = $picarray[$i]";?>alert(ar[0]);} I only get errors
  9. I do that and I get an error. Why? <? echo " <input type=\"button\" name=\"Submit4\" value=\"next\" onClick=\"parseArray($picnr $picarray )\"> "; ?> and the java script function parseArray(picnr,picarray){ picnr++;document.getElementById('picture').src=picarray[picnr];}
  10. I'm just trying to read the next value (wich is a picture url )from an array and to dispplay it in an image tag , without having to read the whole picture folder over and over again
  11. So, I got the array "info' , and "nr" that represents a position in the array . When I submit the form I will increment nr .But when the page reloades nr 's value is the right value but array's value is Array.......
  12. katia

    Submit variables

    That worked for me. Thanks
  13. well, i don't want to use ajax too. If I will submit the form, and reload the page, how can I sumbit the array?
  14. Ok . Can i call a javascript function in a php function?
  15. I want to change just the image, without refreshing the whole page.I keep my src values of the pictures in an array and when I press a button I want to change the src value of my img tag with another value from the array.
  16. How can I change the src value when I press a button? Is there any way I can do that in a function?
  17. katia

    Submit variables

    I display some images after reading them from a folder, in a while.I sumbmit my form when clicking on an image file. In the new form, I need the file name and the file number in the new from. In my form they are displayed ok ,but since I write these information in a "while" when I submit the file picturenumber will have the last value of $dim, picture name the last value of $fname.Is there any way that I can store these variables so I submit the right values ? $opendir = opendir($album);$dim=0;while($fname=readdir($opendir)){ if (is_file($name)) { $dim++;echo "<td width=\"140\" align=middle >";echo "<input type=image src=$fname name=$fname title=\"$fname\" height=80 alt=\"$fname\" width=120 border=0 value=submit()>";echo "<input type=\"hidden\" name=\"picturenumber\" value=$dim>";echo "<input type=\"hiiden\" name=\"picturename\" value=$fname>";echo "</td>"; }//if} //while closedir($opendir);
  18. I am using this JScript code to write info in a text file. filename is a string that contains the path to my file (by getting the current directory and then concatenating with the path where the file is)function writetofile(filename,info){var ForAppending=8;var fso = new ActiveXObject("Scripting.FileSystemObject");var ts = fso.OpenTextFile(filename, ForAppending, false); ts.WriteLine(info);ts.Close();}This code works when I test my web page ON my computer. The question is will it work on line?
  19. When I submit a form I need to load different web pages, acording to some text values the users writes in 2 text boxes : form.textbox1.value and form.textbox2.value . Is there any way I can do that?//this is the piece of my code where i have to do that<form name="formlog" onsubmit="return test(formlog)" action="THECONCATENATEDSTRING ">
  20. After a lot of searching, I've finalyuy found an example: http://drewsdesigns.50webs.com/js.login.htmSo, it is possible. As I said, is for didactical use and I have to use only client-side
  21. I did that. The only answer I got was: "use a server-side langauage" and I really have to do it client side
  22. I have to make photo sharing a web page. I can only use client-side JavaScript and HTML (for didactical reasons), all the information about users and the photos are in folders and files and not in a database.Since I'me very new to this I want to know how to create a login page? Does every user have their own web page with their information? Or can I create the pages dynamicaly , at the moment they log in ,depending on the information I have about the users?
×
×
  • Create New...