Jump to content

jhecht

Members
  • Posts

    608
  • Joined

  • Last visited

Posts posted by jhecht

  1. <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>

  2. <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>

  3. You may or may not have read my previous post about the file_put_contents command in a shoutbox. Well, I gave up on that idea, as i believe the problem may be that I do not have the right PHP version, so i am now using the fopen(), fwrite() and fclose() commands. It is all working pretty good except that the file_get_contents() command needs to refresh about every second or so. Any ideas on how i can do that?
    AJAX...
  4. 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/");}

  5. 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

  6. <!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>

  7. 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.

  8. ... 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.

  9. <?$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><? } ?>

  10. or you could do this:b = 'This rocks!'a= 'What rocks?'c = doThis(a+b )function doThis(ab){c = abreturn c}document.write©
    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;

  11. <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

  12. 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".

  13. 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.

  14. <?$query="SELECT * FROM episodes";$result=mysql_query($query);?><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">					Episodes				</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>ID</th>			<th>Season/Episode</th>			<th>Title</th>		</tr>		<?		$i=0;		  while($res = mysql_fetch_array($result)){				$ID=$res['ID'];				$Season=$res['Season'];;				$Episode=$res['Episode'];				$Title=$res['Title'];		?>		<tr>			<td class="row1"><span class="gensmall"><a href="index.php?page=5&episode=<? echo $ID; ?>"><? echo $ID; ?></a></span></td>			<td class="row1"><span class="gensmall">Season <? echo $Season; ?>, Episode :<? echo $Episode; ?></span></td>			<td class="row1"><span class="gensmall"><? echo "$Title" ?></span></td>		</tr>		<?			 }		?>			</tbody></table>

×
×
  • Create New...