Eggie
Members-
Content Count
244 -
Joined
-
Last visited
Everything posted by Eggie
-
i put it up and it's ok... now i have another problem... this is my logout script... <?session_start();session_destroy();?>and this is another part in other script(login_success)... if(!session_is_registered(myusername)){header("location:main_login.php");}when i go to my logout script and after that i go to the "login_success.php" script it just prints out just as i didnt go to my logout script.. what could cause the problem? EDIT:btw this is my "login_check.php" script <?phpinclude("style.css");include("config.php");// username and password sent from signup form$myusername=$_POST['myusername'];$mypassword=$_POST['mypassword'];$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";$result=mysql_query($sql);// Mysql_num_row is counting table row$count=mysql_num_rows($result);// If result matched $myusername and $mypassword, table row must be 1 rowif($count==1){// Register $myusername, $mypassword and redirect to file "login_success.php"session_register("myusername");session_register("mypassword");header("location:login_success.php");$_SESSION['views'] = $_POST['myusername'];}else {echo "Wrong Username or Password";}?>
-
i have this error in every page i have with session start...what's the problem?? <title>Race</title><?phpinclude("style.css");include("config.php");session_start();if(!session_is_registered(myusername)){echo 'Your Session has Expired!';exit;}//If you click race...if ($_GET['action']=='race'){$asa=$_POST['bike'];if(!isset($asa)){echo 'You didn\'t select any bike!';?><br>click <a href=race.php> HERE</a> to go back<?phpexit;}else{$rand=mt_rand(1,2); if ($_POST['bike']==1) $trub='Derbi Senda 50';if ($_POST['bike']==2) $trub='Honda NS 50 R';if ($_POST['bike']==3) $trub='Suzuki ZR 50';if ($_POST['bike']==4) $trub='Yamaha DT 50 MX';if ($_POST['bike']==5) $trub='Aprilia RS 50';echo'You raced against:';echo $trub;$name=$_SESSION['views'];$res = mysql_query("select * from members where username = '$name'"); $wins1 = mysql_fetch_array($res);$points=$wins1['points'];$wo=$wins1['wins'];$lo=$wins1['lose'];//If random number is equal to 1 than set win +1if($rand==1){?></br><?php$wo++;$points=$points+100;mysql_query("update members set wins=$wo where username = '$name'"); mysql_query("update members set points=$points where username = '$name'"); echo '<br>You won 100 points!'; ?></br><table border="1"><?phpecho'You have total of: ' .$points. ' points!';?></table></br><?php}//else lose +1else {echo'<br><br>You lost!';?><table border="1"><td><?phpecho'You have total of: ' .$points. ' points!';?></td></table><?php$lo++;mysql_query("update members set lose=$lo where username = '$name'"); ?></br><?php}//How many times you won overallecho 'Wins:';echo $wo;?></br><?phpecho'Losses:';echo $lo;//race form?><form name="form3" method="post" action="race.php"> <input type=submit value="Go back"> </form><?phpexit;}}if ($_GET['action']!='race'){?><html><head><script type="text/javascript"> function showpic(o) { o = parseInt(o); switch (o) { case 1: imgName='pictures/senda.jpg';break; case 2: imgName='pictures/ns.jpg';break; case 3: imgName='pictures/zr.jpg';break; case 4: imgName='pictures/dt.jpg';break; case 5: imgName='pictures/rs.jpg';break; } var DivImage = document.getElementById('DivImg'); var DisplayImg = document.getElementById('IdImg'); DisplayImg.src=imgName; DivImage.style.visibility="visible"; }</script></head><body><form name="form2" method="post" action="race.php?action=race"><table border="1"><td>Who do you wanna race?<br><font size="1">Hint:You get 100 points for racing this class</font></td></table> <select size=5 name="bike" onchange="showpic(this.options[this.selectedIndex].value)"> <option value="1">Derbi Senda 50</option> <option value="2">Honda NS 50 R</option> <option value="3">Suzuki ZR 50</option> <option value="4">Yamaha DT 50 R</option> <option value="5">Aprilia RS 50</option> </select><br> <input type=submit value=Race> <div id="DivImg" style="position:relative;top:-90px;left:150px;z-index:20;width:25px;height:25px;visibility:hidden;text-align:center;"><img id="IdImg"></div></td></tr></form></body></html><?php}?><form method=post action='login_success.php'> <input type=submit value='Go to main!'></form>
-
If you are interested in my work and my progress..or you have some ideas pls say it here... http://forums.xisto.com/no_longer_exists/ that is a link to my game for you to check on my progress....thnx
-
ok...i will try that code when i get home...i'm at my girlfriends house at this moment...i hope it works ;)EDIT: thanx man...very nice...i'm impressed...wow...now i got that...now i go for other thing on my to-do list
-
i like your ideas....i will probably use most of them...i really like that one about sponsors and fitness stuff...but i'll see about garage thingy...i will not most probably get cash prizes and as i'm from Croatia noone would be interested in coming here from all over the world just to see me...
-
did i hear wrong or are you doing something to help me ;)and btw i didn't understand a thing u said except that what i said
-
i want from it to be more like this ajaxbut there should be picture inside
-
well...i just came up with that project...i only have primitive sites with no background(white) and black letters...i have registration page,login,race page...which is about 100 lines...and all it does is put form in front of you and you choose a bike you want to race against...than it takes you to another page which tells you how many times you won/lost overall and if you won the race you selected or not...you have 50/50 chance to win mt_rand(1,2)i am only newbie programmer and i dont know many codes...but i'm learning it...i made this pages in like 2 days... i am using other scripts which i have on my pc to help me with coding... i will give you the link when i finish a bit of the game...like adding more motorcycles to pick and other stuff.... i am thinking about making this... when you register you choose bikes that have 50ccm,after you win certain amount of points you gain ability to choose better bike (150ccm) while winning you get cash with which you can modernize your bike and making it look and perform better... after i do that i am thinking of adding competitions for my first update.... what do you think?? if anyone wants to join my project later on when i finish basic stuff contact me at jurica666@hotmail.com msn or send me PM here....thnx
-
lol...now you are saying...i am not on that game anymore...i changed few...and i chose that i'll create my very own from scratch... it's gonna be first Motorcycle game (RPG) i hope and i hope i succeed with it... i am not on Land of Damned cause i need globals enabled to make it work...ALL other hosts other than that one has GLOBALS disabled....so i cant use it...
-
I need a script that does this: Lets say I have form with options...you surely know what that is... <form name="form2" method="post" action="race.php?action=race"><table border="1"><td>Who do you wanna race?</td></table> <select size=5 name="bike"> <option value="Derbi Senda 50">Derbi Senda 50</option> <option value="Honda NS 50 R">Honda NS 50 R</option> <option value="Suzuki ZR 50">Suzuki ZR 50</option> <option value="Yamaha DT 50 MX">Yamaha DT 50 MX</option> <option value="Aprilia RS 50">Aprilia RS 50</option> </select>-<a href="java script:launchClasses()">?</a> <input type=submit value=Register> </td></tr></form>When i put my mouse over one of them i want a picture of bike on which your mouse is on to pop up... I hope you understand what i mean...i can't rephrase it to be more meaningful...i tried
-
SOLVEDthanx vujsa..as i said i like this forum cause many people are willing to help and they get credits for it so thats great way for doing it...when i complete my game i hope my hosting will be approved at last ;)cya later with more questions to come...
-
lol....lately i have many problems in writing my scripts and i dont know if i should create post only for purpose so ppl can help me or should i create many post like i am doing right now...i am NOT making this to get many credits...i am doing it because i need help and many people here help me! if ($_GET['action']!='race'){<form name="form2" method="get" action="race.php?action=race"><tr><td>Who do you wanna race?</td><td> <select size=5 name="bike"> <option value="Derbi Senda 50">Derbi Senda 50</option> <option value="Honda NS 50 R">Honda NS 50 R</option> <option value="Suzuki ZR 50">Suzuki ZR 50</option> <option value="Yamaha DT 50 MX">Yamaha DT 50 MX</option> <option value="Aprilia RS 50">Aprilia RS 50</option> </select>-<a href="java script:launchClasses()">?</a> <input type=submit value=Register> </td></tr></form>}i have this code...if i put <?php before it and ?> after it i get if i put ?> directly after if clause like this <?php if ($_GET['action']!='race')?>{//codes}the brackets are printed out and it doesnt help... and if i put it after like this: <?php if ($_GET['action']!='race'){?>//codes}i get this i hope my problem is understandable and you can help me....thnx
-
i get that error when i type this in MYSQLselect bike from members where username=Eggiei have column bike,members and username... and i have information in every of those columns... but why does it say that there is no COLUMN because i said i want info from row where column 'username' is 'Eggie' btw-YAY..my 101 post EDIT:sorry...i just solved it i forgot to put apostrophes select bike from members where username='Eggie'
-
i checked if there was ynthing in $myusername string...and there's nothing...so...how do i take a information which is typed in form in my login page and use it in other pages on my website??'SOLVED...close it and mark as solved
-
it doesn't work...it prints out only and btw how do i print out that string and after " is your bike"...i changed it to echo '$char['bike'] is your bike ';and echo "$char['bike'] is your bike";and that didn't work...
-
so...when someone enters username/pass in login.php...wht do i need to do next?? how do i send info to session_start to start the session with only that guys information?? EDIT: whats wrong with this.... <?session_start();if(!session_is_registered(myusername)){header("location:main_login.php");}else{$host="localhost"; // Host name$username="eggie_asa"; // Mysql username$password="asa"; // Mysql password$db_name="eggie_asa"; // Database name$tbl_name="members"; // Table name// Connect to server and select databse.mysql_connect("$host", "$username", "$password")or die("cannot connect");mysql_select_db("$db_name")or die("cannot select DB");if(session_is_registered(myusername)) mysql_query("select * from char where user=="$myusername");echo'$char['bike']';?><html><body>Login Successful</body></html>} how do i print out something that is in table 'char' under column 'bike'... where column user is "myusername" which is inputed in other page...not the one it should be printed out
-
as far as i know: when you put function "if" and after it only one function stands than you dont need brackets... like this: if(1==1)$a=1;and if you have more than one function after "if" than you need brackets like this: if(1==100){$a=12;$s=12;}so in my code up there i wrote one "for"and in it theres another "for" -so no need for brackets... in that "for" stands if ,and in it there's a number which goes to variable... so again no need for brackets... while writing this i saw a mistake... i wrote if($enemy['level']=$level) instead of if($enemy['level']==$level)so that should do it... i'm gonna download "apache" to try it out...i'm gonna edit this post when i do and try it out $string=50;for($level=1;$level<11;$level++)$string=$string-5;if($enemy['level']==$level)$winner=mt_rand($string,100); this is my final code...if it doesn't work i dont know what you should do...
-
how do you write your login scripts guys?
-
I have another question--- i downloaded script of a game and it worked until my server changed to newer version of php after which it didn't work... the most probable reason is that globals are not enabled... now i need someone who can tell me what to put instead of what to make it work... this is my login.php script <?php $title = "Login"; if (!$user || !$pass) { include("head.php"); print "Please fill out all fields."; include("foot.php"); exit;}include("head.php");$password = md5($pass);$password2 = md5($password);$password3 = md5($password2);$password4 = md5($password3);$password5 = md5($password4);$logres = mysql_num_rows(mysql_query("select * from players where user='$user' and pass='$password5'"));$stat = mysql_fetch_array(mysql_query("select * from players where user='$user' and pass='$password5'"));if ($logres <= 0) { print "<br><center>Login failed. If you have not already, please signup. Otherwise, check your spelling and login again.<br><br>"; include("foot.php"); exit;}else{if ($stat['varified'] != 'Yes') { print "<br><center>You cannot loggin until you click the link in your e-mail!<br><br>"; include("foot.php"); exit;} else {$password = md5($pass);$password2 = md5($password);$password3 = md5($password2);$password4 = md5($password3);$pass = md5($password4); session_register("user"); session_register("pass"); if ($stat['logins'] == '0') { print "<br><center>Welcome $user, this is your first time logging in. Click <u><a href=help.php>here</a></u> to learn how to play<br><br>"; mysql_query("update players set logins=logins+1 where id=$stat[id]"); } else { print "<br><center>Welcome $user, click <u><a href=news.php>here</a></u> to play<br><br>"; mysql_query("update players set logins=logins+1 where id=$stat[id]"); } }}include("foot.php"); ?> this is where you enter your username/pass(head.php) <?php include("config.php"); session_start(); include "java.php";mysql_query("update guests set page='News' where id=$gstat[id]");if (session_is_registered("user") || session_is_registered("pass")) {include("config.php");?><body leftmargin=0 rightmargin=0 onload="window.status='<?php print "$site_com"; ?>'"> <?php print "<br><center><a href=news.php>Click Here To Log back in</a><br><br><a href=logout.php>Log Out</a></center>"; exit;}$ip = "$HTTP_SERVER_VARS[REMOTE_ADDR]";$ctime = time();$bannedip = mysql_fetch_array(mysql_query("select * from banned where ip='$ip'"));if ($bannedip['site'] == 'Yes') {die("You have been banned! Ask the admins if you don't know why.");}$remove_these = array("<", ">", "+","=" ,"-", "--");?><html><head><title><?php print "$title - $site_com"; ?></title><link rel=stylesheet href=style.css></head><body leftmargin=0 rightmargin=0 onload="window.status='<?php print "$site_com"; ?>'"><center><img border="0" src="images/header.png"></center><div align="center"> <center> <table border="0" width="780"> <tr> <td width="800" valign="top"> <div align="left"> <table border="0" width="100%"> <tr> <td width="198%" valign="top" colspan="3"> </td> <tr> <td width="20%" valign="top"> <table border="1" width="100%" bordercolor="<?php print "$table_border"; ?>"> <tr> <td width="20%"> <p align="center">-- <b> Login</b> --</p> </td> </tr> <tr> <td width="20%"> <div align="center"> <center> <table border="0" width="20"> <tr><form method=post action=login.php> <td align="center"><b>Name</b></td> </tr> <tr> <td align="center"><input type=text name=user size="12"></td> </tr> <tr> <td align="center"><b>Password</b></td> </tr> <tr> <td align="center"><input type=password name=pass size="12"></td> </tr> <tr> <td align="center"> <p align="center"><input type=submit value=Login></form></p> </td> </tr> </table> </center> </div> </td> </tr> </table> <table border="1" bordercolor="<?php print "$table_border"; ?>"> <tr> <td width="20%"> <p align="center">-- <b> Navigation</b> --</p> </td> </tr> <tr> <td width="20%"> - <a href=index.php>News</a><br> - <a href=register.php>Register</a><br><br> - <a href=recovery.php>Password Recovery</a><br> </td> </tr> </table> </td> <td width="60%" valign="top" align="center"> <table border="1" width="100%" bordercolor="<?php print "$table_border"; ?>"> <tr> <td width="100%"> <p align="center">-- <?php print "<b>$title</b>"; ?> -- </td></tr> <tr><td> and this is code which goes after login.php only part of it <?php include("config.php"); session_start(); include "java.php"; include("inc/helpinc.php"); $formbug[0]= '+'; $formbug[1]= '='; ?><div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div><script language="JavaScript" src="inc/overlib.js"><!-- overLIB (c) Erik Bosrup --></script> <?phpif (!session_is_registered("user") || !session_is_registered("pass")) { print "Sesion has expired."; print "<META http-equiv=refresh content=2;URL=index.php>"; exit;
-
i'll be back in few minutes to explain itEDIT:i'm backthat code i made for you can be put instead of your BIG code...just remember to put "<?php" and "?>" because it ain't gonna work without it....if you want it for 100 levels just put this :$level<101 instead of $level=11 and it will work but i don't see what $winner=mt_rand($string,100) is for from your code so i don't know what you should edit in that...i can see that it goes from 50 to 5, and it goes down by 5, but as there is no lower numbers (except 0 and minuses) than i don't know whats with that....
-
you can use this function... for($level=1;$level<11;$level++)for($string=50;$string>4;$string=$string-5)if($enemy['level']=$level)$winner=mt_rand($string,100);i think that should be correct code...u can use that for all 100 levels,just change the first value in the for loops which are starting values of the strings and second values which are ending values....
-
omg....that.....isss....a LOT of money..!wow...i could buy a hard disc which has more space than 6GB!!!!yeah..and i would repair my motorcycle...give me some
-
if it's text based game than you don't need anything...only registration and enough credits on Xisto ;)i see many people making their own game...and i'm one of them...i would most probably help you with your game if you could help me...but i don't have credit card...and i don't think you would send me money by mail...but i can help you a bit with debugging and stuff...i can work with finished scripts and bugged ones but i don't think i can handle writing my own...as i already said i need help myself!
-
this server is good enough...BTW why do u say that you are creating a game if you aren't doing anything for it?;)i am creating a game myself...and i'm getting help from all people i know for it(currently "pyost")...and if i make changes in it or create some new scripts i look into dozens of other scripts i have and "copy" and modify them (i am currently debugging login script...)
-
that's all good...but I have a hard disk with 6GB capacity and my sister has hard disk with 20GB capacity...isn't that good...i need more space but i can't get any money for it...my country sucks big time...i have a Honda CB450S and it's broken i need 1 /10 of the money i paid for it...and i don't have it...(about 150 Euro's)