Jump to content

jhecht

Members
  • Posts

    608
  • Joined

  • Last visited

Everything posted by jhecht

  1. <?$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>
  2. jhecht

    blog

    ... Say what? Can you explain a little more please?
  3. $getitemquery=mysql_query("SELECT * FROM tradeitems WHERE itemid='".$_GET['itemid']."'"); $getitem=mysql_fetch_array($getitemquery); echo " <div class=\"header\"> <h1>EDIT AN TRADEITEM</h1> "; echo " <form name=additem method=post action=addtradeitem.php?action=edit&itemid=".$_GET['itemid']."> <table border=0> <tr> <td width=150>Item name:</td> <td><input type=\"text\" name=\"itemname\" size=\"60\" value=\"".$getitem['itemname']."\"></td> </tr> That should do it.
  4. Any system should allow you to change the layout... if not then you will probably end up having to pay someone. I'd do it but at the moment i am SWAMPED with work..
  5. jhecht

    SQL update

    you didnt do mysql_select_db();.. so <?include "config.php";$t_stamp = time();$timeout = $t_stamp - $to_secs;$result=array();$msa=mysql_connect($server, $db_user, $db_pass) or die ("Useronline Database CONNECT Error");@mysql_select_db("DATABASE NAME!!!!!!") or die(mysql_error());$check = mysql_query("SELECT * FROM CJ_UsersOnline WHERE ip='$REMOTE_ADDR'",$msa) or die(mysql_error());$result['check'] = mysql_num_rows($check);if ($result['check']>="1") {mysql_query("UPDATE CJ_UsersOnline SET `timestamp` = $t_stamp WHERE `ip` = '$REMOTE_ADDR'") or die("Database UPDATE Error");} else {mysql_query("INSERT INTO CJ_UsersOnline VALUES ($t_stamp,'$REMOTE_ADDR','$PHP_SELF',0)",$msa) or die("Database INSERT Error");//Numeric values dont need quotes around them.}mysql_query("DELETE FROM CJ_UsersOnline WHERE timestamp<$timeout",$msa) or die("Database DELETE Error");$result['file'] = mysql_query("SELECT DISTINCT ip FROM CJ_UsersOnline WHERE file='$PHP_SELF'",$msa) or die("Database SELECT Error");$result['logged'] = mysql_query("SELECT DISTINCT ip FROM CJ_UsersOnline WHERE logged=1",$msa) or die("Database SELECT Error");$result['not_loged'] = mysql_query("SELECT DISTINCT ip FROM CJ_UsersOnline WHERE logged=0",$msa) or die("Database SELECT Error");$total = mysql_num_rows($result['file']);$logged = mysql_num_rows($result['logged']);$ulogged = mysql_num_rows($result['not_loged']);mysql_close();if ($logged == 1){echo "$logged Member Online<br />";}else{echo "$logged Members Online<br />";}if ($ulogged == 1){echo "$ulogged Guest Online<br />";}else{echo "$ulogged Guests Online<br />";}if ($total == 1){echo "$total Person Online<br />";}else{echo "$total People Online<br />";}?>
  6. jhecht

    SQL update

    <?include "config.php";$t_stamp = time();$timeout = $t_stamp - $to_secs;$result=array();$msa=mysql_connect($server, $db_user, $db_pass) or die ("Useronline Database CONNECT Error");$check = mysql_query("SELECT * FROM CJ_UsersOnline WHERE ip='$REMOTE_ADDR'",$msa) or die(mysql_error());$result['check'] = mysql_num_rows($check);if ($result['check']>="1") {mysql_query("UPDATE CJ_UsersOnline SET `timestamp` = $t_stamp WHERE `ip` = '$REMOTE_ADDR'") or die("Database UPDATE Error");} else {mysql_query("INSERT INTO CJ_UsersOnline VALUES ($t_stamp,'$REMOTE_ADDR','$PHP_SELF',0)",$msa) or die("Database INSERT Error");//Numeric values dont need quotes around them.}mysql_query("DELETE FROM CJ_UsersOnline WHERE timestamp<$timeout",$msa) or die("Database DELETE Error");$result['file'] = mysql_query("SELECT DISTINCT ip FROM CJ_UsersOnline WHERE file='$PHP_SELF'",$msa) or die("Database SELECT Error");$result['logged'] = mysql_query("SELECT DISTINCT ip FROM CJ_UsersOnline WHERE logged=1",$msa) or die("Database SELECT Error");$result['not_loged'] = mysql_query("SELECT DISTINCT ip FROM CJ_UsersOnline WHERE logged=0",$msa) or die("Database SELECT Error");$total = mysql_num_rows($result['file']);$logged = mysql_num_rows($result['logged']);$ulogged = mysql_num_rows($result['not_loged']);mysql_close();if ($logged == 1){ echo "$logged Member Online<br />";}else{ echo "$logged Members Online<br />";}if ($ulogged == 1){ echo "$ulogged Guest Online<br />";}else{ echo "$ulogged Guests Online<br />";}if ($total == 1){ echo "$total Person Online<br />";}else{ echo "$total People Online<br />";}?>Try that now
  7. <a href="java script:clicker('left.txt');">Left.txt</a>
  8. jhecht

    Login

    Easiest way i can tell you is to copy the <form> code from phpbb's login page... i could tell you other ways but those are complex, and quite honestly a **** to have to do.
  9. jhecht

    SQL update

    I'm not exactly sure... but i'll try to correct your code in some places; <?include "config.php";$t_stamp = time();$timeout = $t_stamp - $to_secs;$msa=mysql_connect($server, $db_user, $db_pass) or die ("Useronline Database CONNECT Error");$check = mysql_query("SELECT * FROM CJ_UsersOnline WHERE ip='$REMOTE_ADDR'",$msa);$result = mysql_num_rows($check);if ($result>="1") {mysql_query("UPDATE CJ_UsersOnline SET `timestamp` = $t_stamp WHERE `ip` = '$REMOTE_ADDR'") or die("Database UPDATE Error");} else {mysql_query($db, "INSERT INTO CJ_UsersOnline VALUES ('$t_stamp','$REMOTE_ADDR','$PHP_SELF','0')",$msa) or die("Database INSERT Error");}mysql_query("DELETE FROM CJ_UsersOnline WHERE timestamp<$timeout",$msa) or die("Database DELETE Error");$resultt = mysql_query("SELECT DISTINCT ip FROM CJ_UsersOnline WHERE file='$PHP_SELF'",$msa) or die("Database SELECT Error");$resultl = mysql_query("SELECT DISTINCT ip FROM CJ_UsersOnline WHERE logged=1",$msa) or die("Database SELECT Error");$resultul = mysql_query("SELECT DISTINCT ip FROM CJ_UsersOnline WHERE logged=0",$msa) or die("Database SELECT Error");$total = mysql_num_rows($resultt);$logged = mysql_num_rows($resultl);$ulogged = mysql_num_rows($resultul);mysql_close();if ($logged == 1){ echo "$logged Member Online<br />";}else{ echo "$logged Members Online<br />";}if ($ulogged == 1){ echo "$ulogged Guest Online<br />";}else{ echo "$ulogged Guests Online<br />";}if ($total == 1){ echo "$total Person Online<br />";}else{ echo "$total People Online<br />";}?> Dont use mysql_db_query... just use msql_query
  10. Change the code you posted to THAT <div class="threecolbox_1E87CDB"><img src="images/image_01.jpg" width="172" height="172" style="position: relative; top:0px;" alt="topleft"/><br/><div class="nav1"> <br/><div id="conts"><!--#include virtual="left.txt" --></div></div> </div> And add this to whatever javascript file you have: function createRequestObject() { var ro; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ ro = new ActiveXObject("Microsoft.XMLHTTP"); }else{ ro = new XMLHttpRequest(); } return ro;}var change=createRequestObject();function clicker(filename){change.open('get',filename);change.onreadystatechange = handleFile;change.send(null);}function handleFile(){if(change.readyState ==4){ document.getElementById("conts").innerHTML=change.responseText }} And also, dont use TXT files, use HTML or PHP pages.(ie save the files as .html or .php or even .htm if you want.
  11. jhecht

    Help

    you can have it do that after..... as is it'd be pretty hard or at least annoying. just look up headers... id help more now but im in a hurry
  12. read up on ajax... it does what u want from what i can get
  13. jhecht

    form

    im guessing that the line 18 is the line with DB::connect thing... what its saying is that DB is not a class that it is recognizing. if you defined DB in a different page, include it in the top of the file.
  14. jhecht

    Help

    uhm.. the form isnt that hard to do: <form method="post" action="username.php"><input type="text" name="username"/><br/><input type="submit" name="submit" value="GO!"/></form> But what i dont get is if you want it to go to the page of the inputted username, or if you just want it to go to username.php...More explaining please.
  15. Yeah sure i'd help with this... just need to know what kind of functions people want/need. function checkscore($right,$total,$width=300,$height=15){/* width is the width of the div/table that you are going to use, height is the height of the div/table; */$wrong = (int)$total-(int)$right;//Number of wrong answers, just in case you want to output it somewhere.$percentRight = $right/$total;//Number of percents right; obvious;$right_width = $percentRight * $width;//How big the percentage of what is right will be;$table = "<table width=\"$width\" height=\"$height\">\n";$table.= "<tr>\n";$table.= "<td width=\"$right_width\" bgcolor=\"green\"> </td>\n<td bgcolor=\"red\">\n \n</td>\n";$table.="</tr>\n";return $table;} Dont know if it works... didnt test it, but that should be something like what you need.
  16. jhecht

    form

    Tell us whch line is line 18 and this will save me alot of time having to read through your code.
  17. I dont get what you want to do... can you explain it a little more please?
  18. SELECT * FROM `table` ORDER BY `column` LIMIT 8That works well for me...
  19. You can't use file_get_contents() with URLs usually. If you want to get the stuff for a webpage use file() instead of file_get_contents;so it would look like this(ish): <?php$todourls[]="http://jhechtf.sytes.net/";$todourls[]="http://www.w3schools.com/";foreach($todourls as $value){$file = join('',file($value));//$file is the contents of the webpage passed through the function.. do whatever u want now.}?>
  20. There are a few ways to do it, but with what you've got, already just do this:<script language="javascript">function createRequestObject() { var ro; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ ro = new ActiveXObject("Microsoft.XMLHTTP"); }else{ ro = new XMLHttpRequest(); } return ro; }var AJAX = createRequestObject();function inputVal(inputValue){ AJAX.open('GET','page?value='+inputValue ); AJAX.onreadystatechange = handleConts; AJAX.send(null);}function handleConts(){if(AJAX.readyState==4){document.getElementById('yourID').innerHTML="added name tot he database, thank you";}}//Now you just have to call it in whateveer function you are usingname=prompt("what yo name is cuz");inputVal(name);</script>
  21. ok a long description.I am a professional(ish) web designer. I work mainly in the coding portion, PHP,MySQL, Javascript, VBScript, C++ etc etc. I am working for a client, and i am using AJAX for his system. NOw everyone who uses Ajax knows that an AJAX link doesnt show up in the browser so i am trying to make it so that when the user clicks the ajax link a cookie is set and if the user comes back to the page they can hit the "remember my last session" button and all the pages they were viewing last time come up again. I have the cookie working, and after some issues with wondering WHY it wouldnt work, i think i've got it almost done. Now, however, my only issue is that the function i use (i call it callCookie) finds the cookie used to save the pages(pages is the name) and then it seperates the values by the "|" character, which represents the differentiation between one id:pagename pair and another. then it splits that into the id, and the page name. And when i try to call another AJAX function to put all the pages back, it doesnt work for the first cookie ID+pagename pair because the loop goes to the next ID+pagename pair too quickly, so the first ID never gets updated. Basically, very long explaination. How can i make it so that the loop doesnt go to the next id pagename pair until the first one is finished. If you want a working example at what i've got its here at http://jhechtf.sytes.net/cookie.php;Thanks for the help.
×
×
  • Create New...