Jump to content

duncan_cowan

Members
  • Posts

    109
  • Joined

  • Last visited

Posts posted by duncan_cowan

  1. hi i recently started using the script "prototype window" from http://prototype-window.xilinus.com/ the window is working fine but when i try to include the javascript commands, such as minimize or close, in the script it comes up with an error " 'win' is undefined " the place where i run the command is a register form which is accessed from the login form and both are in prototype windows here is the code:

    <html><head><script type="text/javascript" src="http://www.worldwarsix.com/protected/prototype_win/javascript/prototype.js"> </script><script type="text/javascript" src="http://www.worldwarsix.com/protected/prototype_win/javascript/window.js"> </script><link href="http://www.worldwarsix.com/protected/prototype_win/themes/ww6.css" rel="stylesheet" type="text/css"/></head><script>win.setSize(400,500);</script><body bgcolor=#000000>...

    the code is expected to make the window bigger but this doesnt happen.please could someone help?thanks in advance.

  2. hi i have used "prototype window" to have a popup window in my site but i do not know why it is not working:(main popup script in middle)

    <html><head><script type="text/javascript" src="/protected/prototype_win/javascripts/prototype.js"> </script><script type="text/javascript" src="/protected/prototype_win/javascripts/window.js"> </script>  <link href="/protected/prototype_win/stylesheets/themes/default.css" rel="stylesheet" type="text/css"/></head>	<tr>		<td colspan="3" height="85" background="protected/images/WW6_16.gif" <--Main Popup Section-->onclick="window.location.href='var win = new Window({className: 'spread', title: 'Ruby on Rails',top:70, left:100, width:300, height:200,url: 'http://www.rubyonrails.org/', showEffectOptions: {duration:1.5}}); java script:win.show()'" style="cursor: pointer"><--end popup section--><div align="center"><p>Click Here To Enter Protected Area		</div></td>		</body></html>

    it does contain more script obviously but i think these are the only important parts.please could someone help?thanks

  3. hi on my website there is a template with a side bar and a main sectionwhen the main section is longer than the side bar the side bar is pulled down and the background images of the side bar are seperated this is a problemthe website address is www.worldwarsix.comand the problem is after you login username: test password: testthe side bar edge lines are separatedis there anyway to stop this from happing if you can see the problem?thanks duncan.

  4. hi i am using the "while" function to echo the contents of the rows in a mysql table. unfortunatley only one row is being echoed.here is the script:

    $result_armies = mysql_query("SELECT * FROM armiesWHERE username = '".$username."'");while($row = mysql_fetch_array($result_armies))  {  echo "	<table border='0' background='images/logged-in/box.gif' align='center'>		  <tr>			<td colspan='2'>			<img src='images/logged-in/blank-short.gif' width='280'></td>		  </tr>		  <tr>			<td><font size='2' face='font1' color='#FFFFFF'> Name:</font></td>			<td><font size='2' face='font1' color='#FFFFFF'>".$row['army_name']."</font></td>		  </tr>		  <tr>			<td><font size='2' face='font1' color='#FFFFFF'> Rank:</font></td>			<td><font size='2' face='font1' color='#FFFFFF'>".$row['army_rank']."</font></td>		  </tr>		  <tr>			<td><font size='2' face='font1' color='#FFFFFF'> Strength:</font></td>			<td><font size='2' face='font1' color='#FFFFFF'>".$row['strength']."</font></td>		  </tr>		  <tr>			<td colspan='2'><img src='images/logged-in/boxend.gif' alt='' width='280'></td>		  </tr>		</table>  ";  }

    what is wrongthanks

  5. dont worry i have found out what was causing it the included file (logout.php) also included the file with this script in so it was going around in circles. :):)

  6. hi i am getting a strange error in some script.when i run it it comes up with a "500 internal server error" but when i delete "$time = time();" from it it shows the page.here is the script:

    <?php/* check login script, included in db_connect.php. */$time = time();$last_active = $_SESSION['last_active'];session_start();if (!isset($_SESSION['username']) || !isset($_SESSION['password'])) {	$logged_in = 0;	return;} else {	if($last_active<$time) {	   $timeout = 1;	   require "logout.php";	}	// remember, $_SESSION['password'] will be encrypted.	if(!get_magic_quotes_gpc()) {		$_SESSION['username'] = addslashes($_SESSION['username']);	}	// addslashes to session username before using in a query.	$pass = $db_object->query("SELECT password FROM users WHERE username = '".$_SESSION['username']."'");	if(DB::isError($pass) || $pass->numRows() != 1) {		$logged_in = 0;		unset($_SESSION['username']);		unset($_SESSION['password']);		// kill incorrect session variables.	}	$db_pass = $pass->fetchRow();	// now we have encrypted pass from DB in	//$db_pass['password'], stripslashes() just incase:	$db_pass['password'] = stripslashes($db_pass['password']);	$_SESSION['password'] = stripslashes($_SESSION['password']);	//compare:	if($_SESSION['password'] == $db_pass['password']) { 		// valid password for username		$logged_in = 1; // they have correct info					// in session variables.	} else {		$logged_in = 0;		unset($_SESSION['username']);		unset($_SESSION['password']);		// kill incorrect session variables.	}}// clean upunset($db_pass['password']);$_SESSION['username'] = stripslashes($_SESSION['username']);?>

    please could someone helpthanks.

  7. hi i have made a script that is meant to process a login and it used to run with sessions but i wanted to use cookies to carry the loggin info so i set it to set some cookies but it doesnt work...please could someone help?script:

    $username = $_POST['uname'];	$password = $_POST['passwd'];	setcookie("username", "$username");	setcookie("password", "$password");

    thanks in advance... :)

  8. Hi I have made a script to insert a row into a database with the computers ip and a random number, but noting will be added to the database. Please could someone help...script:

    <?php$ip = $_SERVER["REMOTE_ADDR"];$random = rand(600000000, 900000000); // between * and * inclusive$user_number = $ip.$random;if (isset($_COOKIE["user_online"])){echo $_COOKIE["user_online"];$sql_script = 'SELECT COUNT (*) FROM users_online';$users_online = mysql_query($sql_script);} else {setcookie("user_online", "$user_number");echo "Cookie set";mysql_query("INSERT INTO users_online (rand-num) VALUES ('".$user_number."')");$sql_script = mysql_query("SELECT * FROM users_online");$num_rows = mysql_num_rows($sql_script);echo $num_rows;}?>

    Thankyou in advance... :)

  9. HiI have written a script to count users using a cookie stored on the users computer containing a random number and then storing the number in a database. then the script counts the number of rows but when i run it, it displays an error.script:

    <?php$random = rand(60000000000000000000000, 90000000000000000000000); // between 0 and 100 inclusiveif (isset($_COOKIE["user_online"])){$sql_script = 'SELECT * FROM users-online';$count_sql = mysql_query($sql_script);$users_online = mysql_num_rows($count_sql);} else {setcookie("user_online", "$random");mysql_query("INSERT INTO users-online VALUES ('".$random."', '".$_SERVER['REMOTE_ADDR']."')");}?>

    and the error:

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/i04wasp/public_html/protected/users-online.php on line 14
    Please could someone help??thanks in advance.Duncan
  10. hi how do you add to a value in a mysql database with php?i have tried using this code but nothing happens:

    UPDATE users SET gold + '".$total_gold."' WHERE username = '".$user_details[0]."' AND password = '".$user_details[1]."'

    please could someone help?? thanks.

  11. Hi please could someone tell me what is wrong with this code:

    <?phpinclude("db_connect.php");$query = mysql_query("SELECT * FROM armies WHERE username=".$_SESSION['username']."");while($row = mysql_fetch_array($query))  {  }?>

    When i run it it says:"Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/i04wasp/public_html/protected/armyhome.php on line 10"Thankyou...

  12. Well, because the insert statement is messed up.There's a hanging comma, that might be the only problem, but I haven't tried using a select statement in an insert statement. It might be possible, I'm not sure. Instead of just displaying some random text telling you there is an error, it is always much more helpful if you have it give you the error message. You can use the mysql_error() function to return it. or die (mysql_error());Also, it might be easier to have a field in your users table to say whether the user is active, instead of two tables. Just have an active field, start it as 0, and set it to 1 when the user gets activated.
    i have taken your advice and just used 1 table for this the member logon is now working!!!
  13. when i run this script it always says "ERROR IN INSERT!!" what is wrong with it please?::

    <?phprequire("protected/db_connect.php");$result = mysql_query("SELECT * FROM unactivated_users WHERE act_num = '".$_GET['act_num']."'");$row = mysql_fetch_array($result);$_POST['password'] = md5($_POST['password']);if ($row['password']==$_POST['password']) {mysql_query("INSERT  INTO users SELECT username, password, regdate, email, location, show_email, last_login, rank, army_species, game_rank, FROM unactivated_users WHERE act_num = '".$row['act_num']."'")or die("ERROR IN INSERT!!");mysql_query("DELETE FROM unactivated_users WHERE act_num = '".$row['act_num']."'")or die("ERROR IN DELETE");} else {die("ERROR!!");}header('Location: http://www.wasper-rocker.co.uk/activate.php?act=1')?>

×
×
  • Create New...