Jump to content

jhecht

Members
  • Posts

    608
  • Joined

  • Last visited

Everything posted by jhecht

  1. Possibly, you turned it off in your settings. Also, stay away from VbScript, its only for IE, and does not work in FireFox.
  2. <script type="text/javascript">function changeimage(item,newImage){item.src=newImage;}</script>call it like:<a href="link.page"><img src="beginningpage.jpg" onmouseover="changeimage(this,'secondpage.jpg')" onmouseout="changeimage(this,'beginningpage.jpg')"/></a>
  3. uhm... does the form page work with POST or GET variables? that would be a helpful place to start...
  4. you could just go : //Other javascript here ...changeVar function defined here...changeVar('p','a','none');changeVar('div','b','block');//Other javascript
  5. if ur asking if javascript works in FF, then the answer is yes. Firefox, if anything, is stricter about the ECMAScript standards than just about any browser.
  6. <script language='javascript'>var nruser = 0var users=new Array()var pagenr = 5users["0"]="user1"users["1"]="user2"users["2"]="user3"var xmlhttpfunction loadXMLDoc(){xmlhttp=null// code voor Mozilla, etc.if (window.XMLHttpRequest){xmlhttp=new XMLHttpRequest()}// code voor IEelse if (window.ActiveXObject){xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")}if (xmlhttp!=null){xmlhttp.onreadystatechange=state_Changexmlhttp.open("GET",'http://www.mysite.com/script.php?user='+users[nruser],true)xmlhttp.send(null)}else{alert("Your browser does not support XMLHTTP.")}}function state_Change(){// als xmlhttp is "loaded"if (xmlhttp.readyState==4){// als "OK"if (xmlhttp.status==200){alert('OK')handlereturn()}else{alert("Problem retrieving XML data")}}}function handlereturn(){var input = xmlhttp.responseText; // this is wrong, it doesn't have access to that variable//Use the right variable name, that should help alot.var actie = input.substr(0, 1);var tekst = input.substr(2, (input.length-2));var output = '';var geld = '';if(actie == '*'){if(tekst == '1') output = 'output 1';if(tekst == '2') output = 'output 2';if(tekst == '3') output = 'output 3';if(tekst == '4') output = 'output 4';}else if(actie == '+'){output = 'return +';}else if(actie == '-'){geld = tekst;output = 'return -';}document.aanval_form.currentuser.value = users[nruser++];alert(output);}</script><form name="aanval_form"><input type="button" name="btnstart" value="Action!" onClick = "loadXMLDoc()"><input type="text" name="currentuser" id="currentuser" value='Slachtoffer' disabled="true"><br><br></form></body></HTML>
  7. If i am understanding what you want, then $IP = $_SERVER['REMOTE_ADDR'];$datum=date("l, F d, Y h:i" );$fh = fopen("gegevens.txt","w");if(fwrite($fh,$dateum.$IP."\n")){fclose($fh);header("location : http://www.asite.com/");}
  8. Or you could just replace $no with $_GET['no'];
  9. jhecht

    making Forum

    If you insist on making one yourself, get a base of code going and then post when ur having issues.
  10. jhecht

    add total

    i dont have time to look at the actual code itself, but for the love of god fix this: <input type=radio name="size"onclick="check(this.value)" value="small">small $8<br><input type=radio name="size"onclick="check(this.value)" value="medium">medium $12<br><input type=radio name="size"onclick="check(this.value)" value="large">large $16<br>--- Change to----<input type="radio" name="size" onclick="check(this.value)" value="small">small $8<br/><input type="radio" name="size" onclick="check(this.value)" value="medium">medium $12<br/><input type="radio" name="size" onclick="check(this.value)" value="large">large $16<br/> <br> is not acceptable by any validator, use <br/> instead
  11. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head><title>Test Page</title><script type="text/javascript">function changeVar(elementName,className,styleType){ var element = document.getElementsByTagName(elementName); for (x in element){ if(element[x].getAttribute("class")==className){ element[x].style.display=styleType; } }}</script></head><body><a href="java script:changeVar('p','a','none');">Change</a><br/>the first variable is the element to be looked at, the second is the class name to be checked, and the third is the display if the class name matches the given one. you can use it in the body with an onload call.<br/><a href="java script:changeVar('p','a','block');">Change</a><br/>This function works fine for me..<p class="a">Lorem ipsum dolor sit amet, consectetuer adipiscing elit,sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquamerat volutpat.</p><div class="b">Dummy Text, Dummy Text</div></body></html>
  12. The point is that this person doesnt know how to do whatever scripting that needs to be done and there is a file(say on a friend's server or something) that has already been done...AJAX would be good here... just let me know if you want the AJAX code..And Chocolate570, AJAX can be used with ANY server side language, not just PHP.
  13. ... im guessing alot of people here dont speak english as a first language.Ok what i think you just said was that when a user logs in a column in mysql is set to the current UNIX timestamp, and when the user logs out the same column is set to 0.Please correct me if im wrong.
  14. $mymsg = 'Unon User Name & Password Plz Try Again <br>'; header("Location: ./index.php?msg=".urlencode($mymsg));
  15. <?$episodeid=$_GET['episodeid'];$query = mysql_query("SELECT * from episodes WHERE ID=$episodeid LIMIT 1");while($res = mysql_fetch_assoc($query)){$ID=$res['ID'];$Season=$res['Season'];$Episode=$res['Episode'];$Title=$res['Title'];$Air_Date=$res['Air Date'];$Writer=$res['Writer'];$Director=$res['Director'];$Star=$res['Star'];$Guest_Star=$res['Guest Star'];$Notes=$res['Notes'];$Quotes=$res['Quotes'];$Reviews=$res['Reviews'];$TV_Rating=$res['TV Rating'];$Site_Rating=$res['.net Rating'];?><table width="100%" cellpadding="2" cellspacing="2" class="forumline"> <thead> <caption> <table border="0" cellspacing="0" cellpadding="0" width="100%" class="forumheader"> <tr> <td align="left" valign="bottom" width="19"> <img src="../templates/Getaway/images/hdr_left.gif" width="19" height="22" alt="" /> </td> <td align="left" class="forumheader-mid"> Season <? echo $Season" ?> :: Episode <? echo $Episode" ?> </td> <td align="right" valign="bottom" width="19"> <img src="../templates/Getaway/images/hdr_right.gif" width="19" height="22" alt="" /> </td> </tr> </table> </caption> </thead> <tbody> <tr> <th><? echo $Title; ?></th> </tr> <tr> <td class="row2"> <b>Episode Number</b> - <? echo $ID; ?><br /> <b>Original Air Date</b> - <? echo $Air_Date; ?><br /> <b>Director</b> - <? echo $Director; ?><br /> <b>Writer</b> - <? echo $Writer; ?><br /> <b>Star</b> - <? echo $Star; ?><br /> <b>Guest Star</b> - <? echo $Guest_Star; ?><br /> </td> </tr> <tr> <th>Notes</th> <td class="row2"> <? echo $Notes; ?> </td> </tr> <tr> <th>Quotes</th> <td class="row2"> <? echo $Quotes; ?> </td> </tr> <tr> <th>Reviews</th> <td class="row2"> <? echo $Reviews ?> </td> </tr> </tbody></table><? } ?>
  16. Whats the point in putting the ab value into c, you could just return ab from the beginning... or a quicker version of this is:a = "what rocks?";b = "this rocks!";c = a+b;
  17. <script type="text/javascript"><!--var ps = document.getElementsByTagName("p");for(i=0;i<=ps.length;i++) { if (ps[i].className == 'a') { ps[i].style.display = 'block'; }}var divs = document.getElementsByTagName("div");for(i=0;i<=divs.length;i++) { if (divs[i].className == 'b') { divs[i].style.display = 'none'; }}// --></script>[code]Although if u just did something like [code]VAR elements = etc etc Then it should be fine. As you are defining it now, Javascript says its a constant to be used EVERYWHERE in your javascript file
  18. im not sure about this, but i think that even in IE and so on, you should be able to use the DaysObject.add(NewOption,null); because the function exists in both of them, just firefox has stricter guidlines for them, so even though IE says "eh its ok its only missing an argument" firefox goes "###### no, we need an argument or NO DEAL".
  19. jhecht

    ? and :

    Its a quicker way to do an IF/ELSE statement that is not too complex.
  20. could you explain a litle more please?
  21. ok... basically what is going to happen is that you are going to have a for loop. something likefor( i = 1;i<5;i++){//Code executed here...}What you would have to do would be one of 2 things, since you are apparetly learning Javascript, i'll go with the less complex one.have the javascript print out a table tag before the loop. IEdocument.write("<table>");and then have it echo the closing table tag AFTER the for loop;FOR LOOP HEREdocument.write("</table>";from there you woudl take the variable "i" and multiply it by 10,100, and 1000, thusly storing these 3 values in 3 different variables and then echoing them like:document.write("<tr>\n<td>"+times10Var+"</td>\n<td>\n"+times100Var+"</td><td>\n"+times1000var+"</td>\n</tr>\n");Have fun.
  22. I dont get what you are asking...If those are all the things that you are checking for, then just put include("main.php") in the else statement of your code.
  23. What kind of game is it? is it a game made in PHP or is it just something else?
×
×
  • Create New...