Jump to content

justAnoob

Members
  • Posts

    561
  • Joined

  • Last visited

    Never

Everything posted by justAnoob

  1. Here is the all the code. I just left out the CSS <?php error_reporting(E_ALL); ini_set('display_errors',1); session_start(); include_once 'header.php'; include "connection.php"; $sql = mysql_query("SELECT imgpath, imgpath2, imgpath3, imgpath4, imgpath5, thumb_1, thumb_2, thumb_3, thumb_4, thumb_5,FROM member_pictures WHERE thumb_1 = " . $_SESSION['picposted'] . ""); $result=mysql_query($sql); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script> <script language="JavaScript"> <!-- //thumbnail script image0 =new Image(); image1 =new Image(); image2 =new Image(); image3 =new Image(); image4 =new Image(); // This defines the source of the display image image0.src ="<?php echo $row['imgpath']; ?>" image1.src ="<?php echo $row['imgpath2']; ?>" image2.src ="<?php echo $row['imgpath3']; ?>" image3.src ="<?php echo $row['imgpath4']; ?>" image4.src ="<?php echo $row['imgpath5']; ?>" // This defines the source of the preview image document.images['pimage0'].src=image0.src; document.images['pimage1'].src=image1.src; document.images['pimage2'].src=image2.src; document.images['pimage3'].src=image3.src; document.images['pimage4'].src=image4.src; // This defines what to do when an image is clicked on function image_click(clicks) { if(clicks==0){document.images['large'].src=image0.src;} if(clicks==1){document.images['large'].src=image1.src;} if(clicks==2){document.images['large'].src=image2.src;} if(clicks==3){document.images['large'].src=image3.src;} if(clicks==4){document.images['large'].src=image4.src;} } // --></script> </head> <body> <table width="954" border="0" align="center"> <tr> <td height="702"> <div id="PictureBox"> <div id="divvy"> <span class="bigger"> Your picture has been posted - </span> <span class="different">Picture Preview<span class="goto_around"> (goto </span></span><span class="style1"><span class="style3"><a href="http://www.mysite.com/example.php" class="goto">Active Pictures</a></span></span><span class="different"><span class="goto_around"> to add pictures)</span></span><br /> <div id="postnew"> <table width="705" bordercolor="#000000" bgcolor="#9AA4AD" id="table"> <tr> <td> <table width="400" border="1" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="4"><div align="center"><img src="<?php echo "$row['imgpath']"; ?>" align="middle" border="0" width="380 height="225" name="large"></div></td> </tr> <tr> <td colspan="4"> <div align="center"> Mouse over thumbnails to view larger image. </div> </td> </tr> <tr> <td bordercolor="#FFFFFF"> <div align="center"> <a onmouseover="javascript:image_click(0)"><img src="<?php echo "$row['thumb_1']"; ?>" width="90" height="80" name="pimage0" border=0></a> </div> </td> <td bordercolor="#FFFFFF"> <div align="center"> <a onmouseover="javascript:image_click(1)"><img src="<?php echo "$row['thumb_2']"; ?>" width="90" height="80" name="pimage1" border=0></a> </div> </td> <td bordercolor="#FFFFFF"> <div align="center"> <a onmouseover="javascript:image_click(2)"><img src="<?php echo "$row['thumb_3']"; ?>" width="90" height="80" name="pimage2" border=0></a> </div> </td> <td bordercolor="#FFFFFF"> <div align="center"> <a onmouseover="javascript:image_click(3)"><img src="<?php echo "$row['thumb_4']"; ?>" width="90" height="80" name="pimage3" border=0></a> </div> </td> <td bordercolor="#FFFFFF"> <div align="center"> <a onmouseover="javascript:image_click(4)"><img src="<?php echo "$row['thumb_5']"; ?>" width="90" height="80" name="pimage4" border=0></a> </div> </td> </tr> </table> </td> </tr> </table> </div> </div> </div> </td> </tr> </table> </body> </html>
  2. Just posting up the important sutff I have one div which shows a full size image. And smaller divs which show the thumbnail. on mouseover of the thumbs, the full size is displayed in the bigger div . $row['imgpath'] should always show in the bigger div until mouseover of the other thumbs. <?php $sql = mysql_query("SELECT imgpath, imgpath2, imgpath3, imgpath4, imgpath5, thumb_1, thumb_2, thumb_3, thumb_4, thumb_5 FROM member_pictures WHERE thumb_1 = " . $_SESSION['picposted'] . ""); $result=mysql_query($sql); ?> script language="JavaScript"> <!-- //thumbnail script image0 =new Image(); image1 =new Image(); image2 =new Image(); image3 =new Image(); image4 =new Image(); // This defines the source of the display image image0.src ="<?php echo $row['imgpath']; ?>" image1.src ="<?php echo $row['imgpath2']; ?>" image2.src ="<?php echo $row['imgpath3']; ?>" image3.src ="<?php echo $row['imgpath4']; ?>" image4.src ="<?php echo $row['imgpath5']; ?>" // This defines the source of the preview image document.images['pimage0'].src=image0.src; document.images['pimage1'].src=image1.src; document.images['pimage2'].src=image2.src; document.images['pimage3'].src=image3.src; document.images['pimage4'].src=image4.src; // This defines what to do when an image is clicked on function image_click(clicks) { if(clicks==0){document.images['large'].src=image0.src;} if(clicks==1){document.images['large'].src=image1.src;} if(clicks==2){document.images['large'].src=image2.src;} if(clicks==3){document.images['large'].src=image3.src;} if(clicks==4){document.images['large'].src=image4.src;} } // --></script> <div align="center"><img src="<?php echo "$row['imgpath']"; ?>" align="middle" border="0" width="380 height="225" name="large"></div> <div align="center"> <a onmouseover="javascript:image_click(0)"><img src="<?php echo "$row['thumb_1']"; ?>" width="90" height="80" name="pimage0" border=0></a> </div> </td> <td bordercolor="#FFFFFF"> <div align="center"> <a onmouseover="javascript:image_click(1)"><img src="<?php echo "$row['thumb_2']"; ?>" width="90" height="80" name="pimage1" border=0></a> </div> .....................and so on
  3. I posted this is the js section and I was told it was for the PHP section Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING <script language="JavaScript"> image0.src ="<?php echo $row['imgpath']; ?>" </script
  4. Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING image0.src ="<?php echo "$row['imgpath2']" ?>"
  5. That figures, after searching forever, I post this question. Then I just find an example online.
  6. ebay has a way for the user to view images on their items....Like so, ______________ | | | | | full size | | | | | ---------------------- thumb 1 thumb 2 thumb 3 When you mouse over the thumbs, the appear in the full size box. I have been looking for examples online but I'm not sure what this is called. Anyone know?
  7. Here is a part of it. My homepage has the exact same js validation script, and my homepage displays fine on Safari and Chrome, but when I go to another page on my site(with the same js) it displays my code. <script type="text/javascript"/> function validate(form1) { var valid = true; if (!form1.item_name.value) { document.getElementById('item_name_error').innerHTML = '*'; valid = false; } else { document.getElementById('item_name_error').innerHTML = ''; } return valid; } </script>
  8. Safari and Chrome. IE and FF everything is fine. Just in Safari and Chrome I can physically see my js which throws off my whole page. Any ideas?
  9. that works out pretty good. i'm really starting to like js. I just need to put some more time is to learning. The only thing i changed was if (!valid) to if(valid) That way, if my form passes the validation, then it will display to div. Thanks a bunch.
  10. Still a little confused. Sorry This is what I got so far. What I'm trying to do is if my validation passess when the submit button is clicked, then show the hidden div. If validation is not passed, then keep the div hiding. <script type="text/javascript"/> var submit = document.forms["form1"].elements["submit"]; submit.onclick = function() { if (valid = false) { var messID = document.getElementById(message_box); messID.style.display = 'block'; } else { var messID = document.getElementById(message_box); messID.style.display = 'none'; } } </script> Here is my div inside the form <form action="postnewitem_test0167.php" method="post" enctype="multipart/form-data" name="form1" id="form1" onSubmit="return validate(this);"> <table id="message_box" width="600" border="0" bgcolor="#9AA4AD" style="display:none"> <tr> <td> Uploading... Please be patient while your item is posting.</p> </td> </tr> </table> </form> the return validate is my validation which is this. <script type="text/javascript"/> function validate(form1) { var valid = true; if (!form1.item_name.value) { document.getElementById('item_name_error').innerHTML = '*'; valid = false; } else { document.getElementById('item_name_error').innerHTML = ''; } if (!form1.description.value) { document.getElementById('description_error').innerHTML = '*'; valid = false; } else { document.getElementById('description_error').innerHTML = ''; } if (!form1.in_return.value) { document.getElementById('in_return_error').innerHTML = '*'; valid = false; } else { document.getElementById('in_return_error').innerHTML = ''; } if (form1.listmenu.value == '1') { document.getElementById('listmenu_error').innerHTML = '*'; valid = false; } else { document.getElementById('listmenu_error').innerHTML = ''; } if (!form1.image.value) { document.getElementById('image_error').innerHTML = '*'; valid = false; } else { document.getElementById('image_error').innerHTML = ''; } return valid; } </script> I'm still attempting to learn javascript
  11. I'm a little lost. Are you saying that would go into the input tag like a onclick would. I'm still learning here.
  12. i have an onclick that calls a js function. Am I able to have something like onclick="if (condition) {do something} if so. my condition would be my other js function that validates a form. here is my validation function.(special thanks to the members of phpfreaks for my validation function) function validate(form1) { var valid = true; if (!form1.item_name.value) { document.getElementById('item_name_error').innerHTML = '*'; valid = false; } else { document.getElementById('item_name_error').innerHTML = ''; } if (!form1.description.value) { document.getElementById('description_error').innerHTML = '*'; valid = false; } else { document.getElementById('description_error').innerHTML = ''; } if (!form1.in_return.value) { document.getElementById('in_return_error').innerHTML = '*'; valid = false; } else { document.getElementById('in_return_error').innerHTML = ''; } if (form1.listmenu.value == '1') { document.getElementById('listmenu_error').innerHTML = '*'; valid = false; } else { document.getElementById('listmenu_error').innerHTML = ''; } if (!form1.image.value) { document.getElementById('image_error').innerHTML = '*'; valid = false; } else { document.getElementById('image_error').innerHTML = ''; } return valid; } Basicaly , what I'm looking for is for my onclick to check that the validation is good, and the run the onclick
  13. at the beginning of my script I tried something like this. echo "<script type='text/javacript'> function upload(message_box) { var messID = document.getElementById(message_box); messID.style.display = 'block'; } upload(message_box); </script>"; But nothing happens.
  14. I need to call the function inside of the upload script file, and the javascript needs to be ran before the php script so the message is displayed for the user while they are waiting. So is there something I could do inside of the PHP upload script to display the wait message?
  15. That is the way that I originally had the page setup. But I also have some validation that is done before the upload. Right now, with the setup you suggested, when the user hits the submit button and has something wrong filled out, the please wait div still pops up.
  16. converting to a .gif just gives me about 25 different pics from my animation(.ani) I guess it is time to change my plans for my page.. Thanks for all the help though.
  17. lol, that is what i'm searching for now, a converter to change to a gif.
  18. maybe, but .ani is animated where .cur is not. But I will take a look around. Thanks.
  19. yeh, just fixed it. And it will not let me use a .ani only a .cur There has got to be a way to use the .ani
  20. Am I getting close to have this line correct? document.body.style.cursor=url("http://www.mysite.com/images/cursors/k_spin_cursor.ani"); Or is this correct and can I only use .cur files for cursors. The .ani is an animated cursor I made.
  21. i'm not looking to close the browser or the main page the user is on. Here it is again. the user goes to an upload page, they hit submit to upload, a popup window displays letting them know that something is happening, when the script is done uploading they are taken to a new page and the popup window is to be closed. it is just the popup window that I want to open before the script and then close after the script. I have searched everywhere on google and cannot find a way to do this. And ok, i'll continue this is js section
  22. Am I able to call a javascript function before the script is ran, and then after the script is done, run another js function? ex: <?php js function before running script script stuff here js function after script is finished ?> If this gets to off topic, I have this posted in the js section also. I just wanted to give gergy008 a response. Sorry for the double post. Let me know if I have to close this one down.
  23. Ok, I changed a few things around and now I can't get anything to work. What I am looking to do is this. window open function window close function <?php window open upload script here window close ?>
  24. The user is taken to another page after the upload. But my popup window is still opened on top of the confirmation page. Here is the window.open function <script type="text/javascript" language="javascript"> function Uploading(pageURL, title,w,h) { var left = (screen.width/2)-(w/2); var top = (screen.height/2)-(h/2); var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left); } </script> and this is what i use onClick="Uploading('progress.php','Uploading',400,400);"
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.