mikemastah
Members-
Posts
79 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Events
Everything posted by mikemastah
-
Re: Actually use xml with ajax ok thanks for the help, Issue is solved.
-
Re: Actually use xml with ajax But how would I use JSON for what I need? To be completely honest I have no clue what an eval is...
-
Re: Actually use xml with ajax JSON looks pretty hard :) so how would I do the parser thing? the problem is that I do not have access to PHP, MySQL, etc. only javascript. I could rewrite the xml file to would that be easier?
-
Re: Fluid and Fixed problem I think what you're looking for is this. (right??) <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>CSS</title> <style type=text/css> <!-- body { height: 100%; } .wrapper { min-width: 800px; border: 1px solid black; } .header { height: 100px; margin-right: 200px; border: 1px solid black; } .navigation { margin-right: 200px; border: 1px solid black; } .main-content { margin-right: 200px; min-height: 280px; border: 1px solid black; } .sidebar { width: 200px; float: right; height: 400px border: 1px solid black; } --> </style> </head> <body> <div class="wrapper"> <div class="sidebar">sidebar!</div> <div class="header">HEADER</div> <div class="navigation">nav1 nav2</div> <div class="main-content">test</div> </div> </body> </html> just try it out.
-
I was wondering how would I do something like this with ajax. I have a variable (user input) 'uuc' and i want the value 'phe' returned this is my xml file:
-
Re: while loop wow ok cool thanks
-
Re: while loop What I want to do is call an variable which is 'created' before this piece of code and the variable has the same name as $shopitems['name'] So when "$shopitems['name'] === grenades" I need to call $grenades.. can this be done easily or do I need a switch?
-
Re: while loop It actually is a quantity, I have an input field with id $shopitems['id'] which says how many you want. ${$shopitems['name']} and $_POST[$shopitems['id']] will work then? as I'm not that certain about the first one.
-
Re: Funney Error :-D pacific detail he's right though.
-
Hi I have a table in my MySQL DB 'shopitems' with the columns id / name / attack / defence / costs / shop which contains something like grd / grenades / 800 / 0 / 950 / attack snp / sniper / 1150 / 0 / 2000 / attack etc. etc. now in my shop i want to run the following code: if ($_POST['grd']) { if (($_POST['grd'])*950 > $cash) { die (header("Location: /shop/money")); } else { $newgrenades = ($grenades + $_POST['grd']); mysql_query("UPDATE items SET grenades = '$newgrenades' WHERE username = '$nick'"); $newatt = $attack + ($_POST['grd']*800); $newdef = $defence + ($_POST['grd']*0); $newcash = $cash - ($_POST['grd']*950); mysql_query("UPDATE users SET cashmoney = '$newcash', attack = '$newatt', defence = '$newdef' WHERE username = '$nick'"); } } but then I would have to make that for every single item. so I thought why not use a while loop. so here is my question. Is it possible to use something like this? (haven't tested it yet because my PHP installation is currently screwed up) $q=mysql_query("SELECT * FROM shopitems"); while($shopitems=mysql_fetch_array($q)) { if ($_POST[$shopitems['id']]) { if (($_POST[$shopitems['id']]*$shopitems['costs']) > $cash) { die (header("Location: /shop/money")); } else { $new = (${$shopitems['name']} + $_POST[$shopitems['id']]); mysql_query("UPDATE items SET $shopitems['name'] = '$new' WHERE username = '$nick'"); $newatt = $attack + ($_POST[$shopitems['id']]*$shopitems['attack']); $newdef = $defence + ($_POST[$shopitems['id']]*$shopitems['defence']); $newcash = $cash - ($_POST[$shopitems['id']]*$shopitems['costs']); mysql_query("UPDATE users SET cashmoney = '$newcash', attack = '$newatt', defence = '$newdef' WHERE username = '$nick'"); } } }
-
Re: PHP.net search bookmark huh, how? oh Wine/Cedega?
-
Re: (no clear way to describe) please read hehehehe... oops :D thanks a lot Floydian. Issue solved
-
Re: (no clear way to describe) please read somehow, this doesn't work at all..... I used the exact js and css you gave me but still no luck.
-
Re: (no clear way to describe) please read whoa hard, I don't really understand. '.lefthead.totoggle + div.lefttext' is in css right? could you post exactly what I have to do? I'm not that good with javascript.
-
Re: css columns Thanks Floydian, I knew it had something to do with 'clear: both;' :) Issue resolved
-
Re: (no clear way to describe) please read I used that before but I have multiple blocks of "lefthead" and "lefttext". I need each "lefthead" to toggle the belonging "lefttext"... that's what makes it so hard for me. I know i could make something like. <script type="text/javascript"> <!-- function hideText(toggleDiv) { var style = document.getElementById(toggleDiv).style; style.display = (style.display == 'none') ? "block" : "none"; return false; } //--> </script> <div onclick="hideText('totoggle1')" class="lefthead"><div class="leftheadbox">[img=/images/text.png] Test</div></div> <div id="totoggle1" class="lefttext" style="display: none;"> Blablabla testing new feature. blablabla </div> But it would take me ages to give all the "lefttext" div's on my site an id (including the php-loop generated ones).
-
I have the following problem: I have '<div> C' in that div i have both '<div> A' and '<div> B' what I want is that whenever A or B expands C also expands (not like in the image where B overlaps D) I tried .C { position: relative; width: 846px; height: 100%; } .B { position: absolute; right: 0; width: 250px; margin-left: 596px } .A { width: 590px; left: 0; } but it didn't work and gave me the result in the image. I also tried floats but it gave me the same result. I have no idea what else to try please help.
-
I'm probably doing something wrong here :-D What I want to do is when I click the 'class="lefthead"' div the first 'class="lefttext"' after that changes from 'display: block;' to 'display: none;' and the other way around. <script type="text/javascript"> <!-- function hideText(aNode) { var totoggle=aNode.nextSibling; var style = document.getElementById(totoggle).style; style.display = (style.display == 'none') ? "block" : "none"; return false; } //--> </script> <div onclick="hideText(this)" class="lefthead"><div class="leftheadbox">[img=/images/text.png] Test</div></div> <div id="totoggle" class="lefttext" style="display: none;"> Blablabla testing new feature. blablabla </div> Please help I have absolutely no clue.
-
Re: Need help with Ajax oh.... made a little typo, It's working now... I should really get some sleep now and then. Thanks for your Ajax script Floydian, works like a charm
-
Hey folks of CE, I need help once again :( I'm making an application for school where i have to use Ajax in. on a page i have a textbox where you can type a (three letter) code in. i have an external php script which returns the value of the code using GET (data.php?code=HDD) It will return a value (69) nothing more, just 69, which should be stored in the div 'target'. I tried using Floydian's (slightly modified) Basic Ajax is easy script but it didn't work. How should I do this
-
Re: Tab menu problem thanks a lot POG, works like a charm. fixed it now.
-
Re: Apache is hard! You could use the <base> element. <base href="http://www.yoursite.com" /> and when you the following path: "images/image1.png" it goes to http://www.yoursite.com/images/image1.png +about the rewrite stuff these are examples I use:
-
Re: Funny things To Google what does this do? inurl:"ViewerFrame?Mode=
-
Re: Member-list @SomeRandomBastard: very clear tutorioal thanks :) @AlabamaHit I don't use mccodes, I just studied their code to see how they did it. The thing is mccodes v1 is really bad arranged(or something else I don't know the word for it, opposite of well-arranged;).
-
Re: New logo cool, thanks.