Jump to content

son

Members
  • Content Count

    1,024
  • Joined

  • Last visited

Everything posted by son

  1. Now, something really weird happened. IT worked for 2 hours and then stopped again... Do you have any recommendation in where to look? I find it really confusing and cannot make it out what the source is...Son
  2. Just in process of setting up a database on live server I came across the note that 'a complete PhpMyAdmin directory has to be uploaded in order to guarantee access to the MySQL database'. What would I need to do? In previous installations with different hosting companies there was PHPMyAdmin already available. What would I need to upload?Son
  3. It does not happen any more. Strange... (if anyone had a similar problem and know why that might have happened, please let me know...).Son
  4. Use the window.onload now, cheers:-) With the removal of the onload from the body tag do not worry, it is just me not having a clue about proper JavaScript;-)Thanks a lot for your help,Son
  5. When I hover over my nav bar, which is dynamically created with php (from MySQL db) the link is shown in left bottom side of IE 7. Looks like a bit like page tries to load the reference, but it really only shows and stays as long you do not hover over any other link. Why could that be? Checked with other websites, but it does only happen on my website...Son
  6. Windows firewall is turned off, did that before installation of McAfee. I did turn it on and off, which did first make it work, but then after a day even when I turned it off it did not work. Kind of do not understand how that makes any sense|-)Son
  7. After having a nightmare to figure out if my firewall, my web files host or Dreamweaver is the cause that I cannot connect to my domain I almost gave up. It all did not make sense. I could connect to any other domain via Dreamweaver, only not to my own one. On the other side I could connect with same data to my domain with a different ftp client. Now it just started working again, with me not having changed anything yet (have used different ftp client over last few days). The only thing that updates all the time is McAfee (including firewall), could that be the reason? There must be some explanation...Son
  8. Thought I had to remove it (thought it was strange...). Have now "<body onload="preloader()">", but IE complains that there are errors on page (without giving me any more details this time).Son
  9. Justsomeguy,Sorry, did not want to be rude, but completely forgot to get back to post after I managed to figure out how to do it. Thanks for your input.Son
  10. Send you info how to access page via PM...Son
  11. son

    Closing bracket issue

    Synook, I obviously looked into the wrong place. Did not think about the fact that IE cannot see the server-side scripting|-) Found it now, was the Javascript bit to change images. There was indeed a missing closing bracket.Cheers,Son
  12. Changed the i bit (also have no onload attribute any more). Still for some product photos takes a while when clicked upon, although the page has finished loading. Is there anything else I am missing? The complete code is:<script language="JavaScript">function preloader() { // set image list images = new Array(); images[0]="main/1-268.jpg" images[1]="main/2-268.jpg" images[2]="main/3-268.jpg" images[3]="enlarged/1-268.jpg" images[4]="enlarged/2-268.jpg" images[5]="enlarged/3-268.jpg" //Create a holder for the loaded images imageObjects = new Array(); for(var i=0,i=images.length; i<=l; i++) { //Load the image var imageObj = new Image(); imageObj.src=images[i]; //Place the loaded image in the holder imageObjects[i] = imageObj; }} </script><script type="text/javascript">if (document.images) {image0_src = '1-268.jpg';image1_src = '2-268.jpg';image2_src = '3-268.jpg';} else {image0 = '';image1 = '';image2 = '';document.rollimg = '';} var pic = "1-268.jpg";function change_image(val){document.rollimg.src = 'main/' + val; pic = val;}function goWin() {var windowprops ="width=690px,height=740px,top=50px,left=50px,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no";TheWin = window.open('','image',windowprops);TheWin.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">');TheWin.document.write('<head><title>Enlarged Photo<\/title><\/head><body style="overflow:hidden;margin:20px;background-color:#FFF;">');TheWin.document.write('<p><img src="enlarged/' + pic + '" width="650" height="650" alt="Enlarged product photo" title="Enlarged product photo"><\/p>');TheWin.document.write('<div align="center"><a href=\"java script:void(0)\" onclick=\"window.close()\" style="color:#cacb7f;">Close Window</a><\/div><\/body><\/html>');TheWin.document.close();TheWin.focus();}</SCRIPT> </head><body> SonReason for edit: There was a closing bracket missing, but did not solve the preload problem...( imageObjects[i] = imageObj; }[b]}[/b] )
  13. son

    Closing bracket issue

    I do not get why the browser (IE 7) complains that a closing bracket is missing from my file. I checked and I have seven opening and seven closing brackets. The relevant include file is: <?php require_once ('htu/mysql_connect.php'); // connect to database// check if id is passed into querystringif (isset($_GET['id'])) { // if yes assign to $nsproduct $nsproduct = (int) $_GET['id']; // make sure the id is available $query = "SELECT ns_id FROM general_items WHERE ns_id='$nsproduct'"; $result = mysqli_query ($dbc, $query) or die ('sorry'); if (mysqli_num_rows($result) == 0) { header ("Location: ranges.php"); } } else {header ("Location: ranges.php");}// check if range is passed into querystringif (isset($_GET['range'])) { // if yes assign to $range $range = (int) $_GET['range']; // if not a valid value assign range 1 if ($range > 6 || $range < 1) $range = 1; } else { $range = 0; }// check if room is passed into querystringif (isset($_GET['room'])) { // if yes assign to $range $room = (int) $_GET['room']; // if not a valid value assign range 1 if ($room > 5 || $room < 1) $room = 1;}else { $room = 0;}?> The relevant line is '// check if room is passed into querystring' (what makes it even more weird). Does anyone know what is going wrong? As site is mainly for IE 7 (not my choice) it is important the error won't show...Son
  14. Thanks for clarification. With regard to the above. But the page has finished downloading and the download starts for relevant picuture once I hovered over it. Is this also normal?Son
  15. So, I use nowfunction preloader() { // set image list images = new Array(); images[0]="main/1-322.jpg" images[1]="main/2-322.jpg" images[2]="main/3-322.jpg" images[3]="enlarged/1-322.jpg" images[4]="enlarged/2-322.jpg" images[5]="enlarged/3-322.jpg" //Create a holder for the loaded images imageObjects = new Array(); for(var i=0,l=images.length; i<=l; i++) { //Load the image var imageObj = new Image(); imageObj.src=images[i]; //Place the loaded image in the holder imageObjects[i] = imageObj; } without any of the other bits I used before. It seems to be quicker, but sometimes it still takes a while to load... What did you mean by 'not to use pseudo-protocol'? I thought this was necessary so the function is called?Son
  16. On of my pages it is possible to hover over thumbnails to change the main displayed image. Also, there is a button and once pressed a pop up with even larger image comes up. It is all working fine, but takes a bit long. I wondered what I am doing wrong with my preloader, which is called via '<body onLoad="java script:preloader()">'? The main images are stored in folder 'main' and the enlarged ones in folder called 'enlarged'. They always have same name as thumbs. <script language="JavaScript">function preloader() { // counter var i = 0; // create object imageObj = new Image(); // set image list images = new Array(); images[0]="main/1-268.jpg" images[1]="main/2-268.jpg" images[2]="main/3-268.jpg" images[3]="enlarged/1-268.jpg" images[4]="enlarged/2-268.jpg" images[5]="enlarged/3-268.jpg" // start preloading for(i=0; i<=5; i++) { imageObj.src=images[i]; }} </script><script type="text/javascript">if (document.images) {image0_src = '1-268.jpg';image1_src = '2-268.jpg';image2_src = '3-268.jpg';} else {image0 = '';image1 = '';image2 = '';document.rollimg = '';} var pic = "1-268.jpg";function change_image(val){document.rollimg.src = 'main/' + val; pic = val;}function goWin() {var windowprops ="width=690px,height=740px,top=50px,left=50px,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no";TheWin = window.open('','image',windowprops);TheWin.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">');TheWin.document.write('<head><title>Enlarged Photo<\/title><\/head><body style="overflow:hidden;margin:20px;background-color:#FFF;">');TheWin.document.write('<p><img src="enlarged/' + pic + '" width="650" height="650" alt="Enlarged product photo" title="Enlarged product photo"><\/p>');TheWin.document.write('<div align="center"><a href=\"java script:void(0)\" onclick=\"window.close()\" style="color:#cacb7f;">Close Window</a><\/div><\/body><\/html>');TheWin.document.close();TheWin.focus();}</SCRIPT> Thanks,Son
  17. I understand (won't Ajax for that), but how do you have to display relevant items just below the option (dep or occ) which is selected? Do I need to have some sort of if clause underneath each option?Son
  18. In my case dep and occ are two separate things. If someone clicked upon 'occ 1' I would need to display sublist with relevant items inside occ 1 list item:<ul><li>dep 1</li><li>dep 2</li></ul><ul><li>occ 1<ul><li>item 1 of occ 1</li><li>item 2 of occ 1</li></ul></li><li>occ 2</li></ul> If then someone clicked onto dep 1 this section would not show, but the relevant items for dep 1 inside the dep 1 li item. How can I build the logic to know which dep or occ has been selected? Could I have a query with a variable holding the passed parameter in querystring (would have the same name for list of dep and occ to keep it simple) and then put some code under list items to say "if varible is this, then display, if not do not display"? Does this sound ok?SonSon
  19. Working on product catalogue site I would like to have nav bar with products sorted by department or by occasion. The sublists with relevant products should only show the selected department or occasion items, nothing else. Also, if user does not click upon any department or occasion no item should show (only main items consisting of names of departments/occasions).Should I have 5 different files for each department and 4 further ones for each occasion? I have no problem in querying the database to display items of selected main list item. Or is there a way to achieve my objective with one file only? What is the industry standard to do just that?A product can only be in one department, but can be listed in several occasion groups. I have a foreign - primary key relationship to associate department with item in item table. In item table I have colums for each occasion. If there is 1 in it, it should display in occasion group, if it has 0 it should not go into occasion group.Son
  20. Sorry, am lost. I use the line:if (!isset($_POST['comments']) OR empty($_POST['comments'])) {and it is working fine now...Son
  21. What do you mean by the obove? Line break in code removed and validation for textarea working now. Thanks for that!Son
  22. I created an error array and use it to either display the form field name or the relevant error message. The validation is pretty basic right now as: if (!isset($_POST['comments']) OR empty($_POST['comments'])) { $errors['comments'] = 'This is a required field'; } I have it working for all input fields, but the test for the textarea 'comments' does not work as you can submit without filling anything into textarea (and no error message displayed). Is there a different way of testing for textarea as opposed to input fields? How can I make sure there is input in textarea field upon submission?Son
  23. Not sure if JavaScript or PHP section is right one, my problem is a mixture of both. Hope someone can help...I get the sizes of all my images via the PHP getimagesize function. I also have thumbs with span around to change main image as: <span onmouseover="document.getElementById('rollimg').src=image1.src;">How do I amend:list($width, $height, $type, $attr) = getimagesize("{$mainPath}/{$main1}");which is just before <?php echo '<img src="' . $mainPath . '/'. $row['img1'] . '" ' . $attr . ' alt="Feature Photo" name="rollimg" id="rollimg" />'; ?> to get the relevant $attr for: image0.src = '<?php echo "{$mainPath}/{$main1}";?>'; image1.src = '<?php echo "{$mainPath}/{$main2}";?>'; image2.src = '<?php echo "{$mainPath}/{$main3}";?>'; image3.src = '<?php echo "{$mainPath}/{$main4}";?>'; image4.src = '<?php echo "{$mainPath}/{$main5}";?>'; image5.src = '<?php echo "{$mainPath}/{$main6}";?>'; image6.src = '<?php echo "{$mainPath}/{$main7}";?>'; image7.src = '<?php echo "{$mainPath}/{$main8}";?>'; I really would appreciate a hint in right direction. SonReason for edit: Spelling mistake, which lead to wrong question
×
×
  • Create New...