Semoss13 Posted October 14, 2005 Report Share Posted October 14, 2005 Man ir shaads koda fragments, kas domaats izveelnai: <div id="divFold0" class="clFold"><a href="?id=1" onclick="foldmenu(0); return false" class="clFoldLinks" onfocus="if(this.blur)this.blur()"><img src="foldoutmenu2_arrow.gif" name="imgFold0" width=12 height=12 alt="" border=0> [choice 0]</a><br> <div id="divFoldSub0_0" class="clFoldSub"><a href="?id=11" onclick="subfoldmenu(0,0); return false" class="clSubLinks" onfocus="if(this.blur)this.blur()"><img src="foldoutmenu2_arrow.gif" name="imgFold0Sub0" alt="" border=0> [choice 0_0]</a><br> <div id="divFoldSub0_0_0" class="clFoldSub2"> <a href="?id=111" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 0_0_0</a><br> <a href="?id=112" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 0_0_1</a><br> </div> </div> Jautaajums: <a href = "?id=1" ... a>. Linkaa veel, kaa redzams tiek izsauktas funkcijas un nodoti citi parametri. Kaa es varu, izmantojot PHP ieguut sho id veertiibu. if ( $_GET['?id']) {} - shaadi man nestraadaa! Ir kaadi padomi? Link to comment Share on other sites More sharing options...
Lynx Posted October 14, 2005 Report Share Posted October 14, 2005 echo $_GET['id']; Link to comment Share on other sites More sharing options...
Semoss13 Posted October 14, 2005 Author Report Share Posted October 14, 2005 echo $_GET['id']; 24662[/snapback] Arii nestraadaa, meegjinaaju jau! Link to comment Share on other sites More sharing options...
Delfins Posted October 14, 2005 Report Share Posted October 14, 2005 if ( $_GET['?id']) novāc jautājuma zīmi Link to comment Share on other sites More sharing options...
Lynx Posted October 14, 2005 Report Share Posted October 14, 2005 Tagad, Semoss13, ja tev nestrādā pasaki kurā vietā tu meiģini dabūt to id? Ar $_GET['id'] tu izvilksi to vērtību, kas tagad atrodas browseram adreses laukā aiz vārda id. Attiecīgi uzspiežam uz tava linka <a href="?id=1"> un tad iekš lapas, kurai tu esi paredzējis to id sūtīt rakstam kodu <?PHP echo $_GET['id']; ?> Lai noskaidrotu vērtību. Link to comment Share on other sites More sharing options...
Semoss13 Posted October 14, 2005 Author Report Share Posted October 14, 2005 Nu varat apskatiit pashi, ka nestraadaa. Esmu ielicis ?id=1 pirmajai izveelnei! Skatiit pielikumu~ Link to comment Share on other sites More sharing options...
Semoss13 Posted October 14, 2005 Author Report Share Posted October 14, 2005 Nu varat apskatiit pashi, ka nestraadaa. Esmu ielicis ?id=1 pirmajai izveelnei! Skatiit pielikumu~ 24670[/snapback] Kaa var noraadiit atsauci uz paste.php.lv ievietoto kodu??? Link to comment Share on other sites More sharing options...
Lynx Posted October 14, 2005 Report Share Posted October 14, 2005 Rakstot postu, augšā virs ievades lauka ir taustiņš "http://" nospied to un iekopē iekšā url no paste.php.lv Link to comment Share on other sites More sharing options...
Semoss13 Posted October 14, 2005 Author Report Share Posted October 14, 2005 Laikam esmu stulbs, pogu redzu, bet kaa, lai zinu, kaads tas url, nav ne jausmas. Te buus kods, kur nestraadaa if ($_GET['id']) {} <html> <head> <title>DHTMLCentral.com - Free Dynamic HTML Scripts - FoldoutMenu2 Demo</title> <meta name="Author" content="Thomas Brattli (webmaster@dhtmlcentral.com)"> <META NAME="Generator" CONTENT="Designer:Thomas Brattli (www.bratta.com)"> <meta name="KeyWords" content="DHTML, HTML, Dynamic HTML, Javascript, Cascading Style Sheets, Cross-browser, Cross browser, Javascripts, DOM, Scripts, Free Scripts,foldoutmenu2,menu,hierarchical,expandable,collapsable,outlines,"> <meta name="Description" content="Dynamic HTML Central - The ultimate place to find DHTML scripts, demos, tutorials and help."> <style type="text/css"> #divFoldCont {position:absolute; left:80px; top:100px; width:170px; visibility:hidden;} .clFold {position:absolute; width:170px;} .clFoldSub {position:absolute; left:15px; width:170px; visibility:hidden;} .clFoldSub2 {position:absolute; left:15px; width:170px; visibility:hidden;} .clFoldLinks {font-family:Arial, Verdana, Helvetica, Helv; font-size:14px; font-weight:bold; text-decoration:none; color:black;} .clSubLinks {font-family:Arial, Verdana, Helvetica, Helv; font-size:14px; font-weight:bold; text-decoration:none; color:black;} .clSubLinks2 {font-family:Arial, Verdana, Helvetica, Helv; font-size:12px; text-decoration:none; color:black;} </style> <script language="JavaScript" type="text/javascript"> function lib_bwcheck(){ //Browsercheck (needed) this.ver=navigator.appVersion this.agent=navigator.userAgent this.dom=document.getElementById?1:0 this.opera5=this.agent.indexOf("Opera 5")>-1 this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0; this.ie4=(document.all && !this.dom && !this.opera5)?1:0; this.ie=this.ie4||this.ie5||this.ie6 this.mac=this.agent.indexOf("Mac")>-1 this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; this.ns4=(document.layers && !this.dom)?1:0; this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5) return this } var bw=new lib_bwcheck() if(document.layers){ scrX= innerWidth; scrY= innerHeight; onresize= function(){if(scrX!= innerWidth || scrY!= innerHeight){history.go(0)} } } if(navigator.userAgent.indexOf('Opera')>-1 && document.getElementById){ scrX= innerWidth; scrY= innerHeight; document.onmousemove= function(){ if(scrX<innerWidth-10 || scrY<innerHeight-10 || scrX>innerWidth+10 || scrY>innerHeight+10){ scrX = innerWidth; scrY = innerHeight; foldInit(); } }; } foldImg=1 foldinImg=new Image(); foldinImg.src="foldoutmenu2_arrow.gif" foldoutImg=new Image(); foldoutImg.src="foldoutmenu2_arrow_open.gif" //Here are the images for the sub links. foldsubinImg=new Image(); foldsubinImg.src="foldoutmenu2_arrow.gif" foldsuboutImg=new Image(); foldsuboutImg.src="foldoutmenu2_arrow_open.gif" mainmenus=4 submenus=new Array(3,3,2,3) pxbetweenmain = 10 pxbetweensub = 5 mainstayfolded = false substayfolded = false function makeMenu(obj,nest){ nest=(!nest) ? "":'document.'+nest+'.'; this.css= bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+"document.layers." +obj):0; this.elm= bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0; this.ref= bw.dom || bw.ie4? document:bw.ns4?eval(nest+"document.layers." +obj+".document"):0; this.x= bw.ns4?this.css.left:bw.opera5?this.css.pixelLeft:this.elm.offsetLeft; this.y= bw.ns4?this.css.top:bw.opera5?this.css.pixelTop:this.elm.offsetTop; this.height= bw.ns4?this.ref.height:bw.opera5?this.css.pixelHeight:this.elm.offsetHeight; this.hideIt= b_hideIt; this.showIt= b_showIt; this.moveIt= b_moveIt; this.status= 0; return this; } var px = bw.ns4||window.opera?"":"px"; function b_showIt(){this.css.visibility="visible"; this.status=1} function b_hideIt(){this.css.visibility="hidden"; this.status=0} function b_moveIt(x,y){this.x=x; this.y=y; this.css.top=this.y+px;} function foldInit(){ bw.opera5 = (navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?true:false if (bw.opera5) bw.ns6 = 0 oFold = new Array(); y = 0; for (var i=0; i<mainmenus; i++){ oFold = new makeMenu('divFold'+i,'divFoldCont'); oFold.moveIt(0,y); oFold.size = oFold.height; y += oFold.height+pxbetweenmain; if (bw.ns4) oFold.css.clip.bottom = 500; oFold.sub = new Array(); oFold.subs = top_subs; suby = oFold.height+pxbetweensub; for (var j=0; j<submenus; j++){ oFold.sub[j] = new makeMenu('divFoldSub'+i+'_'+j,'divFoldCont.document.divFold'+i); oFold.sub[j].sub = new makeMenu('divFoldSub'+i+'_'+j+'_0','divFoldCont.document.divFold'+i+'.document.divFoldSub'+i+'_'+j); oFold.sub[j].hideIt(); oFold.sub[j].sub.hideIt(); oFold.sub[j].moveIt(10,suby); suby += oFold.sub[j].height+pxbetweensub; } } oFoldCont = new makeMenu('divFoldCont'); if (bw.ns4) oFoldCont.css.clip.bottom = 800; oFoldCont.showIt(); //Showing the menu when the menu have been "created" } function top_subs(show, num){ for (var j=0; j<this.sub.length; j++){ if (show){ this.sub[j].showIt() if (foldImg) this.ref["imgFold"+num].src = foldoutImg.src if (substayfolded){if(this.sub[j].sub.status) this.sub[j].sub.showIt() }else{ if (foldImg) this.sub[j].ref["imgFold"+num+"Sub"+j].src = foldsubinImg.src this.sub[j].sub.hideIt() } }else{ this.sub[j].hideIt() if (foldImg) this.ref["imgFold"+num].src = foldinImg.src if (!substayfolded) this.sub[j].sub.hideIt() else if (substayfolded) this.sub[j].sub.css.visibility="hidden" } } } function checkheight(org){ if(mainstayfolded) istart=org; else istart=0 for(i=istart;i<oFold.length;i++){ oFold.size=oFold.height for(j=0;j<oFold.sub.length;j++){ oFold.sub[j].size=oFold.sub[j].height+pxbetweensub if(oFold.sub[j].status){ oFold.size+=oFold.sub[j].size if(oFold.sub[j].sub.status){ oFold.size+=oFold.sub[j].sub.height+pxbetweensub oFold.sub[j].size+=oFold.sub[j].sub.height+pxbetweensub } } if(j!=0) oFold.sub[j].moveIt(10,oFold.sub[j-1].y+oFold.sub[j-1].size) } if(i!=0) oFold.moveIt(0,oFold[i-1].y+oFold[i-1].size+pxbetweenmain) } } function subfoldmenu(main,sub){ if (!substayfolded){ for (var i=0; i<oFold[main].sub.length; i++){ if (i!=sub){ oFold[main].sub.sub.hideIt(); if (foldImg) oFold[main].sub.ref["imgFold"+main+"Sub"+i].src = foldsubinImg.src } } } if (!oFold[main].sub.sub.status){ oFold[main].sub.sub.showIt() if(foldImg) oFold[main].sub.ref["imgFold"+main+"Sub"+sub].src = foldsuboutImg.src } else{ oFold[main].sub.sub.hideIt() if(foldImg) oFold[main].sub.ref["imgFold"+main+"Sub"+sub].src = foldsubinImg.src } checkheight(main) } function foldmenu(num){ if (!mainstayfolded){ for(var i=0; i<oFold.length; i++){ if(i!=num) oFold.subs(0,i) } } if (!oFold[num].sub[0].status) oFold[num].subs(1,num) else oFold[num].subs(0,num) checkheight(num) } if(bw.bw) onload = foldInit; </script> </head> <body marginleft="0" marginheight="0"> <div style="position:absolute; left:0; top:0"><a href="#" onclick="self.close(); return false"><img src="/images/logo.gif" width="165" height="54" alt="" border="0" alt="Click to close window"></a></div> <br><br><br> <div id="divFoldCont"> <div id="divFold0" class="clFold"><a href="?id=1" onclick="foldmenu(0); return false" class="clFoldLinks" onfocus="if(this.blur)this.blur()"><img src="foldoutmenu2_arrow.gif" name="imgFold0" width=12 height=12 alt="" border=0> [choice 0]</a><br> <div id="divFoldSub0_0" class="clFoldSub"><a href="#" onclick="subfoldmenu(0,0); return false" class="clSubLinks" onfocus="if(this.blur)this.blur()"><img src="foldoutmenu2_arrow.gif" name="imgFold0Sub0" alt="" border=0> [choice 0_0]</a><br> <div id="divFoldSub0_0_0" class="clFoldSub2"> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 0_0_0</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 0_0_1</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 0_0_2</a><br> </div> </div> <div id="divFoldSub0_1" class="clFoldSub"><a href="#" onclick="subfoldmenu(0,1); return false" class="clSubLinks" onfocus="if(this.blur)this.blur()"><img src="foldoutmenu2_arrow.gif" name="imgFold0Sub1" alt="" border=0> [choice 0_1]</a><br> <div id="divFoldSub0_1_0" class="clFoldSub2"> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 0_1_0</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 0_1_1</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 0_1_2</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 0_1_3</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 0_1_4</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 0_1_5</a><br> </div> </div> <div id="divFoldSub0_2" class="clFoldSub"><a href="#" onclick="subfoldmenu(0,2); return false" class="clSubLinks" onfocus="if(this.blur)this.blur()"><img src="foldoutmenu2_arrow.gif" name="imgFold0Sub2" alt="" border=0> [choice 0_2]</a><br> <div id="divFoldSub0_2_0" class="clFoldSub2"> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 0_2_0</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 0_2_1</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 0_2_2</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 0_2_3</a><br> </div> </div> <div id="divFold1" class="clFold"><a href="#" onclick="foldmenu(1); return false" class="clFoldLinks" onfocus="if(this.blur)this.blur()"><img src="foldoutmenu2_arrow.gif" name="imgFold1" width=12 height=12 alt="" border=0> [choice 1]</a><br> <div id="divFoldSub1_0" class="clFoldSub"><a href="#" onclick="subfoldmenu(1,0); return false" class="clSubLinks" onfocus="if(this.blur)this.blur()"><img src="foldoutmenu2_arrow.gif" name="imgFold1Sub0" alt="" border=0> [choice 1_0]</a><br> <div id="divFoldSub1_0_0" class="clFoldSub2"> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 1_0_0</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 1_0_1</a><br> </div> </div> <div id="divFoldSub1_1" class="clFoldSub"><a href="#" onclick="subfoldmenu(1,1); return false" class="clSubLinks" onfocus="if(this.blur)this.blur()"><img src="foldoutmenu2_arrow.gif" name="imgFold1Sub1" alt="" border=0> [choice 1_1]</a><br> <div id="divFoldSub1_1_0" class="clFoldSub2"> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 1_1_0</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 1_1_1</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 1_1_2</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 1_1_3</a><br> </div> </div> <div id="divFoldSub1_2" class="clFoldSub"><a href="#" onclick="subfoldmenu(1,2); return false" class="clSubLinks" onfocus="if(this.blur)this.blur()"><img src="foldoutmenu2_arrow.gif" name="imgFold1Sub2" alt="" border=0> [choice 1_2]</a><br> <div id="divFoldSub1_2_0" class="clFoldSub2"> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 1_2_0</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 1_2_1</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 1_2_2</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 1_2_3</a><br> </div> </div> </div> <!-- Top 3 --> <div id="divFold2" class="clFold"><a href="#" onclick="foldmenu(2); return false" class="clFoldLinks" onfocus="if(this.blur)this.blur()"><img src="foldoutmenu2_arrow.gif" name="imgFold2" width=12 height=12 alt="" border=0> [choice 2]</a><br> <div id="divFoldSub2_0" class="clFoldSub"><a href="#" onclick="subfoldmenu(2,0); return false" class="clSubLinks" onfocus="if(this.blur)this.blur()"><img src="foldoutmenu2_arrow.gif" name="imgFold2Sub0" alt="" border=0> [choice 2_0]</a><br> <div id="divFoldSub2_0_0" class="clFoldSub2"> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 2_0_0</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 2_0_1</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 2_0_2</a><br> </div> </div> <div id="divFoldSub2_1" class="clFoldSub"><a href="#" onclick="subfoldmenu(2,1); return false" class="clSubLinks" onfocus="if(this.blur)this.blur()"><img src="foldoutmenu2_arrow.gif" name="imgFold2Sub1" alt="" border=0> [choice 2_1]</a><br> <div id="divFoldSub2_1_0" class="clFoldSub2"> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 2_1_0</a><br> </div> </div> </div> <div id="divFold3" class="clFold"><a href="#" onclick="foldmenu(3); return false" class="clFoldLinks" onfocus="if(this.blur)this.blur()"><img src="foldoutmenu2_arrow.gif" name="imgFold3" width=12 height=12 alt="" border=0> [choice 3]</a><br> <div id="divFoldSub3_0" class="clFoldSub"><a href="java script://this link doesn't have a onclick, and can be used just like a regular link" class="clSubLinks" onfocus="if(this.blur)this.blur()"><img src="foldoutmenu2_arrow.gif" name="imgFold3Sub0" alt="" border=0> [empty]</a> <div id="divFoldSub3_0_0" class="clFoldSub2"></div> </div> <div id="divFoldSub3_1" class="clFoldSub"><a href="#" onclick="subfoldmenu(3,1); return false" class="clSubLinks" onfocus="if(this.blur)this.blur()"><img src="foldoutmenu2_arrow.gif" name="imgFold3Sub1" alt="" border=0> [choice 3_1]</a><br> <div id="divFoldSub3_1_0" class="clFoldSub2"> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 3_1_0</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 3_1_1</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 3_1_2</a><br> </div> </div> <div id="divFoldSub3_2" class="clFoldSub"><a href="#" onclick="subfoldmenu(3,2); return false" class="clSubLinks" onfocus="if(this.blur)this.blur()"><img src="foldoutmenu2_arrow.gif" name="imgFold3Sub2" alt="" border=0> [choice 3_2]</a><br> <div id="divFoldSub3_2_0" class="clFoldSub2"> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 3_2_0</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 3_2_1</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 3_2_2</a><br> <a href="#" class="clSubLinks2" onfocus="if(this.blur)this.blur()">Sub 3_2_3</a><br> </div> </div> </div> <?php if ($_GET['id']) { echo $_GET['id']; } ?> </body> </html> Link to comment Share on other sites More sharing options...
Delfins Posted October 14, 2005 Report Share Posted October 14, 2005 gy :huh: Link to comment Share on other sites More sharing options...
keissfootball Posted October 14, 2005 Report Share Posted October 14, 2005 ieliec taču php paste, un nokopee adresi kurraaa tas staav Link to comment Share on other sites More sharing options...
Semoss13 Posted October 14, 2005 Author Report Share Posted October 14, 2005 Nu, varbuut kaads var paliidzeet? Kapeec nekas nenotiek, sanjemot id veertibu? ID no php Link to comment Share on other sites More sharing options...
bubu Posted October 14, 2005 Report Share Posted October 14, 2005 pirmkārt: if (isset($_GET['id'])) { ... otrkārt: <a href="?id=1" onclick="foldmenu(0); return false" Kā tu iedomājies, ka links nostrādās, ja tev tur ir return false? Link to comment Share on other sites More sharing options...
Semoss13 Posted October 15, 2005 Author Report Share Posted October 15, 2005 pirmkārt: if (isset($_GET['id'])) { ...otrkārt: <a href="?id=1" onclick="foldmenu(0); return false" Kā tu iedomājies, ka links nostrādās, ja tev tur ir return false? 24702[/snapback] Liels paldies! Link to comment Share on other sites More sharing options...
Recommended Posts