Jump to content

interpim

Members
  • Posts

    303
  • Joined

  • Last visited

    Never

About interpim

  • Birthday 10/26/1977

Contact Methods

  • Website URL
    http://interpim.com

Profile Information

  • Gender
    Male
  • Location
    San Diego

interpim's Achievements

Member

Member (2/5)

0

Reputation

  1. Thanks for the help... that worked, but now I am getting a problem with the image not showing up on-top of the smaller images. I have tried changing the zIndex, but it isn't working <div class=a4> <img id='big4' src='images/wood/DSCN0238.JPG' width='137px' height='103px' onmouseover="this.style.width='912px';this.style.height='684px'; this.style.zIndex='50'" onmouseout="this.style.width='137px';this.style.height='103px'; this.style.zIndex='-1'" > </div>
  2. Hi all... Javascript noob here. I am wondering if anyone can help me out with some code. I am writing this page dynamically, that is the reason I am building it the way I am. Basically I want to have the 100% sized image popup when a user moves his mouse over the smaller image. here is my page so far... i can't get the popup to occur :/ http://interpim.com/pigs_test.php code below. <style type="text/css"> <!-- .a1{ position:absolute; top: 100px; left: 100px; }.a2{ position:absolute; top: 100px; left: 250px; }.a3{ position:absolute; top: 100px; left: 400px; }.a4{ position:absolute; top: 250px; left: 100px; }.a5{ position:absolute; top: 250px; left: 250px; }.a6{ position:absolute; top: 250px; left: 400px; }.a7{ position:absolute; top: 400px; left: 100px; }.a8{ position:absolute; top: 400px; left: 250px; }.a9{ position:absolute; top: 400px; left: 400px; }--></style> <div class=a1> <img src='images/wood/DSCN0235.JPG' width=15% height=15% onmouseover="src='images/wood/DSCN0235.JPG' width='100%' height='100%' " onmouseout="src='images/wood/DSCN0235.JPG' width='15%' height='15%' " > </div> <div class=a2> <img src='images/wood/DSCN0236.JPG' width=15% height=15% onmouseover="src='images/wood/DSCN0236.JPG' width='100%' height='100%' " onmouseout="src='images/wood/DSCN0236.JPG' width='15%' height='15%' " > </div> <div class=a3> <img src='images/wood/DSCN0237.JPG' width=15% height=15% onmouseover="src='images/wood/DSCN0237.JPG' width='100%' height='100%' " onmouseout="src='images/wood/DSCN0237.JPG' width='15%' height='15%' " > </div> <div class=a4> <img src='images/wood/DSCN0238.JPG' width=15% height=15% onmouseover="src='images/wood/DSCN0238.JPG' width='100%' height='100%' " onmouseout="src='images/wood/DSCN0238.JPG' width='15%' height='15%' " > </div> <div class=a5> <img src='images/wood/DSCN0239.JPG' width=15% height=15% onmouseover="src='images/wood/DSCN0239.JPG' width='100%' height='100%' " onmouseout="src='images/wood/DSCN0239.JPG' width='15%' height='15%' " > </div> <div class=a6> <img src='images/wood/DSCN0240.JPG' width=15% height=15% onmouseover="src='images/wood/DSCN0240.JPG' width='100%' height='100%' " onmouseout="src='images/wood/DSCN0240.JPG' width='15%' height='15%' " > </div> <div class=a7> <img src='images/wood/DSCN0241.JPG' width=15% height=15% onmouseover="src='images/wood/DSCN0241.JPG' width='100%' height='100%' " onmouseout="src='images/wood/DSCN0241.JPG' width='15%' height='15%' " > </div> <div class=a8> <img src='images/wood/DSCN0242.JPG' width=15% height=15% onmouseover="src='images/wood/DSCN0242.JPG' width='100%' height='100%' " onmouseout="src='images/wood/DSCN0242.JPG' width='15%' height='15%' " > </div> <div class=a9> <img src='images/wood/DSCN0243.JPG' width=15% height=15% onmouseover="src='images/wood/DSCN0243.JPG' width='100%' height='100%' " onmouseout="src='images/wood/DSCN0243.JPG' width='15%' height='15%' " > </div>
  3. OK, i have sat through, baby stepping my way through learning Ajax. Well, I thought i had a fairly decent working start on something after about 10 hours of playing around and coding/recoding things. Then, i checked it in Internet Explorer, and well, it doesn't work So can anyone tell me why it isn't working? here is the site http://interpim.com/vn_emblem and here is my code <head> <SCRIPT Language="JavaScript"> var z = 11; var x = 1; var y = 1; var sh = 1; var col = 1; function getHTTPObject() { var xmlhttp; if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp = false; } } return xmlhttp; } var http = getHTTPObject(); function ajaxbackFunction(){ z=z-1 ; if(z <= 0){ z = 278; } document.form.pic_num.value=z; http.open('GET', 'ajax.php?pic='+z, true); http.send(z); http.onreadystatechange=function(){ if(http.readyState==4){ document.getElementById('somediv').innerHTML = http.responseText; // this will put the returned code from ajax.php into a div with id "somediv" } } } function loadImage(){ document.getElementById('somediv').innerHTML = "<img src='order/012.gif'>"; document.getElementById('shape').innerHTML = "<img src='order/shape1.gif'>"; document.getElementById('base').innerHTML = "<img src='images/base1.gif'>"; document.getElementById('shape').innerHTML = "<img src='order/sh1col1.gif'>"; } function ajaxFunction(){ z=z+1 ; if(z >= 279){ z = 1; } document.form.pic_num.value=z; http.open('GET', 'ajax.php?pic='+z, true); http.send(z); http.onreadystatechange=function(){ if(http.readyState==4){ document.getElementById('somediv').innerHTML = http.responseText; // this will put the returned code from ajax.php into a div with id "somediv" } } } function shape_fwd(){ x = x + 1; if(x >= 6){ x = 1; } document.shape_form.shape_num.value=x; http.open('GET', 'shape.php?pic='+x, true); http.send(x); http.onreadystatechange=function(){ if(http.readyState==4){ document.getElementById('shape').innerHTML = http.responseText; } } } function shape_back(){ x=x-1 ; if(x <= 0){ x = 5; } document.shape_form.shape_num.value=x; http.open('GET', 'shape.php?pic='+x, true); http.send(x); http.onreadystatechange=function(){ if(http.readyState==4){ document.getElementById('shape').innerHTML = http.responseText; } } } function base_fwd(){ y = y + 1; if(y >= 4){ y = 1; } document.base_form.base_num.value=y; http.open('GET', 'base.php?pic='+y, true); http.send(y); http.onreadystatechange=function(){ if(http.readyState==4){ document.getElementById('base').innerHTML = http.responseText; } } } function base_back(){ y=y-1 ; if(y <= 0){ y = 3; } document.base_form.base_num.value=y; http.open('GET', 'base.php?pic='+y, true); http.send(y); http.onreadystatechange=function(){ if(http.readyState==4){ document.getElementById('base').innerHTML = http.responseText; } } } function pat_color_fwd(){ col = col + 1; if(col >= 4){ col = 1; } document.pat_color_form.pat_color_num.value=col; http.open('GET', 'pattern.php?pic='+sh +'&col='+col, true); http.send(sh,col); http.onreadystatechange=function(){ if(http.readyState==4){ document.getElementById('pattern').innerHTML = http.responseText; } } } function pat_color_back(){ col=col-1 ; if(col <= 0){ col = 3; } document.pat_color_form.pat_color_num.value=col; http.open('GET', 'pattern.php?pic='+sh +'&col='+col, true); http.send(sh,col); http.onreadystatechange=function(){ if(http.readyState==4){ document.getElementById('pattern').innerHTML = http.responseText; } } } </script> <style type="text/css" title="currentStyle" media="screen"> @import "style.css"; </style> </head> <BODY onLoad="javascript: loadImage()"> <div id='somediv'> </div> <div id='bg'> <img src='bg.gif'> </div> <div id='base_click'> <form name='base_form'> <input type="button" name="base_down" value="<<" onclick="base_back()"> <input type="text" name="base_num" size='5'> <input type="button" name="base_up" value=">>" onclick="base_fwd()"> </form> </div> <div id='shape_click'> <form name='shape_form'> <input type="button" name="shape_down" value="<<" onclick="shape_back()"> <input type="text" name="shape_num" size='5'> <input type="button" name="shape_up" value=">>" onclick="shape_fwd()"> </form> </div> <div id='pattern_click'> <form name='pattern_form'> <input type="button" name="pattern_down" value="<<" onclick="pattern_back()"> <input type="text" name="pattern_num" size='5'> <input type="button" name="pattern_up" value=">>" onclick="pattern_fwd()"> </form> </div> <div id='pat_color_click'> <form name='pat_color_form'> <input type="button" name="pat_color_down" value="<<" onclick="pat_color_back()"> <input type="text" name="pat_color_num" size='5'> <input type="button" name="pat_color_up" value=">>" onclick="pat_color_fwd()"> </form> </div> <div id='emblem_click' <form name='form'> <input type="button" name="backbutton" value="<<" onclick="ajaxbackFunction()"> <input type="text" name="pic_num" size='5'> <input type="button" name="thisbutton" value=">>" onclick="ajaxFunction()"> </form> </div> <div id='overlay'> <img src='images/overlay.png'> </div> <div id='base'> </div> <div id='pattern'> </div> <div id='shape'> </div>
  4. OK... so i realized i needed to change my div to an id and not a name and i can get info back now. but, i want to increment a number... how do i pass what is currently showing in the div back to the php file to increment?
  5. If you can't tell from the code below, i am a beginner at Ajax... can someone please explain to me what I am doing wrong. I've followed a couple of tuts but can't get anything back. I would be happy with getting anything back from the backend php file LOL. I can adjust the code to give me what I need, but basically all i need is to click a button or link to increment a number and return a url based on that number. this is my html page <SCRIPT Language="JavaScript"> function getHTTPObject() { var xmlhttp; if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp = false; } } return xmlhttp; } var http = getHTTPObject(); function ajaxFunction(somevar){ http.open('GET', 'ajax.php?pic='+pic, true); http.send(null); http.onreadystatechange=function(){ if(http.readyState==4){ document.getElementById('somediv').innerHTML = http.responseText; // this will put the returned code from ajax.php into a div with id "somediv" } } } </script> <div name='somediv'> </div> <p> <p><a href="javascript: ajaxFunction('somediv','pic')">Click to Test</a></p> </p> Here is ajax.php <?php $pic = $_GET['pic']; if($pic == ''){ $pic = 1; } $pic = $pic + 1; echo "<img src=" . $pic . ">"; ?>
  6. doh... didn't realize php changed the . in name.x and name.y to underscores... got it working now thanks a bunch.
  7. Any idea why this isn't working in Internet Explorer? This works fine in Firefox. What do I need to do to get it to work? page is http://interpim.com/emblems <form method='post' action='' bgcolor=#333333> <input type='image' value='1' alt='Order' src='order.gif' name='order' > <input type='image' value='1' alt='Destruction' src='des.gif' name='destro' > </form> $realm_order = $_POST['order']; $realm_destro = $_POST['destro']; if($realm_destro == 1){ //various bits of code } if($realm_order == 1){ //different bits of code }
  8. I've tried the Ajax Tutorials on W3 Schools... the problem i think i am running into is, I don't understand how to pass data back and forth from client to server. I can build a function in php to do what i need. How do I pass data from the javascript clientside to the php script? do i need a seperate php file for each function? or can I build several functions in php on 1 file, and call them by name with the javascript?
  9. OK... im having trouble interpreting the tutorials I have read. Could someone point me to a tutorial, or show me and example of a page with a single image element which that image can be changed based on what is in a folder... for example... i have an image css box. the image in that box can be changed by either of 2 buttons, one is a forward and the other is a back. All I want to do is cycle through the images in that directory. Any help is appreciated. I know PHP, and am weak on Javascript.
  10. Hi all, I have never used AJax before, but I am fairly decent at programming PHP and i know very little javascript. I am a quick learner though, and I believe I have a use for AJAX in a project I have currently. What I want to build is an image previewer. I have the images, but I want to stack them (all images have transparency) and have the user able to click a button to change one of the images that are stacked at a time. This is for building a banner previewer for a game, which allows you to change the colors and then select your emblem and shape. So I need to be able to combine all possible combinations and I would like to do it without a new page request for every image changed. If anyone could point me in the direction of a good tutorial for somethign like this, or have any recommendations please help me out. Thanks
  11. This doesn't complete... just continually tries to load :/ function char_parse($name,$server,$class){ $URL="http://realmwar.warhammeronline.com/realmwar/UserLoginAuthentication.war"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"$URL"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookiefilename"); curl_setopt($ch, CURLOPT_COOKIEJAR, "cookiefilename"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "user=$beta_username&password=$beta_password"); $pageResults = curl_exec($ch); curl_setopt($ch, CURLOPT_URL, "http://realmwar.warhammeronline.com/realmwar/CharacterSearch.war?characterKeyword=$name&server=$server&career=$class"); $blah = curl_exec($ch); $blah = explode("TableBoxRow2",$blah); $info = explode("</a>",$blah[1]); $info = explode('"',$info[0]); $info = $info[1]; $char_url = "http://realmwar.warhammeronline.com/realmwar/" . $info; curl_setopt($ch, CURLOPT_URL, $char_url); $char_page = curl_exec($ch); $char_page = explode("charprofile",$char_page); $char_page = explode("<!--infobox-->",$char_page[1]); $char_page = $char_page[0]; $char_page = explode("</div>",$char_page); $name = $char_page[1]; $career = $char_page[2]; $rank = $char_page[4]; $renown = $char_page[10]; Return compact('name', 'career', 'rank', 'renown') ; }
  12. thank you Ken, let me run through this for a bit and see how it works out.
  13. <form method='post' action='build_userpage.php'> SERVER: <input type='text' name='server'> Main Character: <input type='text' name='main'>Class: <input type='text' name='main_class'> Alt: <input type='text' name='alt1'>Class: <input type='text' name='alt1_class'> Alt: <input type='text' name='alt2'>Class: <input type='text' name='alt2_class'> Alt: <input type='text' name='alt3'>Class: <input type='text' name='alt3_class'> Alt: <input type='text' name='alt4'>Class: <input type='text' name='alt4_class'> etc..... <input type='submit' value='create'></form>
  14. So, here is the problem I need to find a solution for... I have a form, which entry into is repetitive, although not all parts of the form will be required to be filled in. basically i have the following values. alt1, class1 alt2, class2 alt3, class3 alt4, class4 etc... so I want to cycle through these, and assign these to variables when the page is processed, if they contain data. How can I build a variable name using for each of these without physically typing a block of code for each numbered name since the type of data will be the same. So far I have this $j = 1; while($j < 10){ $var = "alt" . $j; #This is where I cannot figure out how to get the value in $var to actually be the variable... $j++; } Am I on the right track? and if so, what am I missing here?
  15. OK... i don't think I can actually issue command line info. I use bluehost and the Cpanel version they have is 11.23.4-RELEASE if anyone knows how to issue command line info from this please let me know.
×
×
  • 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.