Jump to content

jhecht

Members
  • Posts

    608
  • Joined

  • Last visited

Posts posted by jhecht

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

  2. Your right mate, pleanty of software but you can't edit it to match my site. Thanks anyway
    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..
  3. 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 />";}?>

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

  5. Wow thank you.So say I want someone to click a link on the page, how would I call this script and how would it know what file to go to.Say its left.txt and I want someone to click a link so it changes to right.txt. How would that look? Im a noob at this, and so far youve been a great help to me.
    <a href="java script:clicker('left.txt');">Left.txt</a>

    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.

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

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

    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

    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.

    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.

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

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

  10. Yes, actually i used php script to communicate with my MySQL DB. it runs on an apache server. I just dont know how to get the value from the promptbox and store it to the Database. I would like some suggestions also if you guyz have any other way aside from inputting from the promptbox wherein I can add or input a new value and store it directly to the databse?
    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>

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