Jump to content
xisto Community

Eggie

Members
  • Content Count

    244
  • Joined

  • Last visited

Posts posted by Eggie


  1. session_start();		require 'dconn.php';$connection = mysql_connect($db_server, $db_user,$db_pass) or die(mysql_error());	mysql_select_db($db_name, $connection) or die(mysql_error());	$uname = $_POST['uname'];	$password = $_POST['password'];	//set up the query	$query = "SELECT * FROM $user_table WHERE username='$uname' AND password='$password'";				//run the query and get the number of affected rows	$result = mysql_query($query, $connection) or die('error making query');	$affected_rows = mysql_num_rows($result);	//if there's exactly one result, the user is validated. Otherwise, he's invalid	if($affected_rows == 1) {					$_SESSION['letmein'] = true;				$result = mysql_query("SELECT userid, verified, username AS uuname FROM $user_table where username='$uname'",$connection);				if ($myrow = mysql_fetch_array($result)) {					$_SESSION["id"]=$myrow['userid'];				   if ($myrow["verified"] == 'n') {					   die("You have not yet verified your account.");				   }											$_SESSION["username"]=$myrow['uuname'];			  header("Location: start.php?option=main"); 						  exit();					} else {						echo "Sorry, no records were found!";						}						}  else {		echo mysql_error();		header ("Location: index.php?invalid=invalid+username/password");	}?>

    so you think only this will settle everything??
    thanks...Eggie

  2. Maybe this can help,or is there something wrong with this??

    require.inc.php

    global $username;require 'dconn.php';session_start();$username = @$_SESSION["username"];$connection = mysql_connect($db_server, $db_user, $db_pass) or die(mysql_error());mysql_select_db($db_name, $connection) or die(mysql_error());.....variables.....function footer() { ?> <CENTER> <table><tr>  <td class="font" align=center><a href="start.php?option=contact">-contact us-</a>  <a href="privacy.htm" target="_NEW">-privacy policy-</a>  <a href="spam.htm" target="_NEW">-spam policy-</a><br></td></tr> </table> </CENTER> <?}?>


  3. Can someone look this script over??
    ever time i put something in any of inputs,it sends me back to /index.php?invalid=invalid+username/password which can be found in validate.php

    HERE is link to the site so you can try entering anything


    I created user manually
    username:Administrator
    password:Xisto
    so you can try logging in too

    this is index.php


    require 'require.inc.php';   // Unset all of the session variables. @session_unset(); // Finally, destroy the session. @session_destroy(); /* if ($_GET('signup')) { error("SIGNUP");	echo "Error Checking<br>";	while(list($name, $value) = each($signup)) { [tab][/tab]  echo "$name - $value<br>";	} } */  [tab][/tab]if (@$signup) {		[tab][/tab]if (@$signup[repassword] != @$signup[password]) {	[tab][/tab][tab][/tab]$err_msg = "Your passwords do not match."; error($err_msg);	[tab][/tab]}		[tab][/tab]if(!eregi("^[_\.0-9a-z-]+$",@$signup[username])) {	[tab][/tab][tab][/tab]$err_msg = "Invalid Username! Usernames can consist of letters and numbers only."; error($err_msg);   [tab][/tab] }	[tab][/tab]if(!eregi("^[_\.0-9a-z-]+$",@$signup[password])) {	[tab][/tab]   $err_msg = "Invalid Password!  Passwords can consist of letters and numbers only.";	[tab][/tab]} [tab][/tab]  if(!@$signup[password] || !@$signup[username] || !@$signup[email] || !@$signup[username]) { [tab][/tab][tab][/tab][tab][/tab]$err_msg = "Oops! You forgot some important fields!"; }  [tab][/tab]  if (mysql_num_rows(mysql_query("Select username from $user_table where username = '$signup[username]'")) > 0) { [tab][/tab][tab][/tab]  $err_msg = "Oops! Someone already has that username."; [tab][/tab]   }  [tab][/tab]  if (!@$err_msg) {	srand((double)microtime()*1000000);	$acode = rand(100000, 199999);  [tab][/tab]$usercheck = @mysql_query("INSERT INTO $user_table (username, realname, email, password, verified, activationcode, type, points, joindate) values('$signup[username]','$signup[rname]', [tab][/tab][tab][/tab]  '$signup[email]','$signup[password]', 'n', $acode, 'free', $signPoints, ".time().")"); [tab][/tab][tab][/tab]   [tab][/tab][tab][/tab][tab][/tab]// done, you are entered correctly, Now Enter the points and URL info [tab][/tab][tab][/tab][tab][/tab] [tab][/tab]    [tab][/tab]   [tab][/tab][tab][/tab]$sql = "Select userid from $user_table where username='$signup[username]'";  [tab][/tab][tab][/tab]$result = mysql_query( $sql ); [tab][/tab][tab][/tab][tab][/tab]if ( $result != false ) [tab][/tab][tab][/tab][tab][/tab][tab][/tab]{ [tab][/tab][tab][/tab][tab][/tab]while ( $data = mysql_fetch_assoc( $result ) ) [tab][/tab][tab][/tab][tab][/tab]{ [tab][/tab][tab][/tab][tab][/tab][tab][/tab]$point_set = $data['id']; [tab][/tab][tab][/tab] [tab][/tab][tab][/tab][tab][/tab][tab][/tab]} [tab][/tab][tab][/tab][tab][/tab]} else { [tab][/tab][tab][/tab][tab][/tab][tab][/tab]echo mysql_error(); [tab][/tab][tab][/tab][tab][/tab]}[tab][/tab]  [tab][/tab]    [tab][/tab][tab][/tab]    [tab][/tab][tab][/tab][tab][/tab]   [tab][/tab]if (!@$usercheck) { [tab][/tab][tab][/tab][tab][/tab] $err_msg = "Database error:<br>There was an error entering your account.<br>It is possible that username already exists, please try another one.<br>"; [tab][/tab][tab][/tab][tab][/tab] }   else { [tab][/tab][tab][/tab][tab][/tab] [tab][/tab]include ("reg.php");  [tab][/tab][tab][/tab][tab][/tab] [tab][/tab]exit; [tab][/tab][tab][/tab][tab][/tab] [tab][/tab]} [tab][/tab][tab][/tab] } [tab][/tab][tab][/tab] if (!@$err_msg) { [tab][/tab][tab][/tab][tab][/tab]// done, you are entered correctly  [tab][/tab][tab][/tab] } } else {   } ?> <html>  <head><title>	<? echo $title; ?> - Surf Exchange Engine   </title> <META NAME="keywords" CONTENT="free surf manual surf exchange money get paid traffic visitors hits"> <META NAME="description" CONTENT="Generate crazy hits to your website by visiting others, and earning money!"> </head>   <META content="text/html; charset=windows-1252" http-equiv=Content-Type> <BODY aLink="#333333" bgColor="white" link="#333333" text="#000000" vLink="#333333"> <basefont face='tahoma'><table width=100% background='images/1.jpg' cellpadding="0" cellspacing="0" style="background-repeat: no-repeat">   <tr valign="middle">  [tab][/tab]<td colspan="2" valign='middle'> <br> [tab][/tab]  <blockquote> <b><font face="Verdana, Arial, Helvetica, sans-serif" color="#000099" size=6>  [tab][/tab][tab][/tab]<? echo $title; ?></font></b> </blockquote> [tab][/tab]</td>   </tr>   <tr>  [tab][/tab]<td width=60% bgcolor="#FFFFFF" align="center"><small>(<a href='reset.php'>I've lost my password</a>)</small></td> [tab][/tab]<td width="40%" align="right" class="nowrapbg" background="images/logback.jpg" style="background-repeat: no-repeat"><small>  [tab][/tab]  <form action='validate.php' method=post> [tab][/tab][tab][/tab]<font size="2">Username:  [tab][/tab][tab][/tab]<input name="uname" type="text" size="6"> [tab][/tab]Password:  [tab][/tab]<input name="password" type="password" size="7"> [tab][/tab]<input type="image" border="0" name="imageField" src="images/arrow.gif" width="17" height="17"> [tab][/tab]</font>  [tab][/tab]  </form> [tab][/tab]  </small></td>   </tr> </table><font color=red><? echo @$invalid; echo "<br>"; ?></font>  <? echo $mainText; ?> <? if (@$err_msg) echo "<br><font color=red size=2>$err_msg</font><br>"; ?> [tab][/tab][tab][/tab][tab][/tab][tab][/tab]  <form name="form"  action="<? echo $PHP_SELF; ?>" method="POST"> <input type="hidden" name="signup" value="true">[tab][/tab][tab][/tab][tab][/tab][tab][/tab]     <table width=100% cellpadding="2" cellspacing="0" align=center> [tab][/tab][tab][/tab][tab][/tab][tab][/tab][tab][/tab]   [tab][/tab]<tr>  [tab][/tab]  <td colspan=2 bgcolor="#CCCCFF"><b>Please Enter Your  [tab][/tab][tab][/tab]Information:</b></td> [tab][/tab]<tr><td>Real Name:</td><td><input type="text" name="signup[rname]" maxlength="36" size="25" value="<? echo @$signup[rname]; ?>"></td></tr><tr><td> E-mail:</td><td><input type="text" name="signup[email]" maxlength="255" size="25" value="<? echo @$signup[email]; ?>"></td></tr> [tab][/tab]<tr>  [tab][/tab]  <td colspan = 2 bgcolor="#CCCCFF"> <b>Please supply  [tab][/tab][tab][/tab]a Username and Password</b></td> [tab][/tab]</tr><tr><td> Username:</td><td>  <input type="text" name="signup[username]" maxlength="10" size=25 value="<? echo @$signup[username]; ?>"></td></tr><tr><td> Password:</td><td> <input type="password" name="signup[password]" maxlength=10 size="25"></td></tr><tr> <td> Re-Enter Password:</td><td>   <input type="password" name="signup[repassword]" size=25></td></tr> [tab][/tab]<tr align="center">  [tab][/tab]  <td colspan=2>Press the button below ONCE to continue the process it will  [tab][/tab][tab][/tab]take a few seconds, please be patient! </td> [tab][/tab]</tr> [tab][/tab]<tr align="center">  [tab][/tab]  <td colspan=2>  [tab][/tab][tab][/tab]<input name="submit2" type="submit" value="Signup"> [tab][/tab]  </td> [tab][/tab]</tr></table></form> <tr><td width="800" align="center"> <CENTER>  <table> <tr>   <td class="font" align=center><a href="contact.php" target=_blank>-contact us-</a>  <a href="privacy.htm" target="_blank">-privacy policy-</a>  <a href="spam.htm" target="_blank">-spam policy-</a><br> [tab][/tab][tab][/tab][tab][/tab]This has been a Sabu production</td> [tab][/tab][tab][/tab]</tr>  </table>  </CENTER></td></tr> </body></html>







    this is validate.php
    session_start(); [tab][/tab][tab][/tab]require 'dconn.php'; $connection = mysql_connect($db_server, $db_user,$db_pass) or die(mysql_error()); [tab][/tab]mysql_select_db($db_name, $connection) or die(mysql_error());  [tab][/tab]$uname = $_POST['uname']; [tab][/tab]$password = $_POST['password'];  [tab][/tab]//set up the query [tab][/tab]$query = "SELECT * FROM $user_table WHERE username='$uname' AND password='$password'"; [tab][/tab][tab][/tab][tab][/tab] [tab][/tab]//run the query and get the number of affected rows   [tab][/tab]$result = mysql_query($query, $connection) or die('error making query'); [tab][/tab]$affected_rows = mysql_num_rows($result);  [tab][/tab]//if there's exactly one result, the user is validated. Otherwise, he's invalid [tab][/tab]if($affected_rows == 1) { [tab][/tab] [tab][/tab][tab][/tab][tab][/tab][tab][/tab]$_SESSION['letmein'] = true; [tab][/tab][tab][/tab][tab][/tab][tab][/tab]$result = mysql_query("SELECT userid, verified, username AS uuname FROM $user_table where username='$uname'",$connection); [tab][/tab][tab][/tab][tab][/tab][tab][/tab]if ($myrow = mysql_fetch_array($result)) {  [tab][/tab][tab][/tab][tab][/tab][tab][/tab][tab][/tab]$_SESSION["id"]=$myrow['userid']; [tab][/tab][tab][/tab][tab][/tab][tab][/tab]   if ($myrow["verified"] == 'n') { [tab][/tab][tab][/tab][tab][/tab][tab][/tab][tab][/tab]   die("You have not yet verified your account."); [tab][/tab][tab][/tab][tab][/tab][tab][/tab]   } [tab][/tab][tab][/tab][tab][/tab][tab][/tab] [tab][/tab][tab][/tab][tab][/tab][tab][/tab][tab][/tab][tab][/tab][tab][/tab]$_SESSION["username"]=$myrow['uuname'];  [tab][/tab][tab][/tab][tab][/tab]  header("Location: start.php?option=main");  [tab][/tab][tab][/tab][tab][/tab][tab][/tab][tab][/tab]} else {  [tab][/tab][tab][/tab][tab][/tab][tab][/tab][tab][/tab][tab][/tab]echo "Sorry, no records were found!";[tab][/tab]  [tab][/tab][tab][/tab][tab][/tab][tab][/tab][tab][/tab]} [tab][/tab][tab][/tab] [tab][/tab][tab][/tab] [tab][/tab][tab][/tab]}  else { [tab][/tab][tab][/tab]echo mysql_error(); [tab][/tab][tab][/tab]header ("Location: index.php?invalid=invalid+username/password"); [tab][/tab]} ?>


  4. Hi mastercomputers,i can see some things have been changed on php...this doesn't sound good ;)so,i can't just make "autoglobals" on??i have many errors since last time i used my site(which is no longer hosted,i am using wamp to finish it)i will need to make many changes on my site because of this,and i won't if i can do something else ;)Thanks...Eggie


  5. He will probably get 23 replies someday. However, today, he only has 12 replies, my own one being not a real reply.

    yeah,sorry i misread...

    it is nice that people here are willing to help,afterall they are getting MyCents for it,so who wouldn't,i think that there are many people who don't know that this kind of getting "money" is around...why don't we get more people here ;)

     

    Thanks...Eggie


  6. He only has 1 post and he already got 23 replies....wow...
    i think that you should start creating your game,and learn in the mean time...

    i did first web page only with

    <phpprint 'Welcome';?>

    and than i downloaded some game scripts which i rewrote...
    after that game was running fine until i had no time running it...
    i stopped,and now i have nothing except my scripts....my sql database is gone... i contacted my host,but they don't have backups back to 2007/08 when i hosted there...now i am looking at scripts and trying to rewrite my database...;)
    you should always backup scripts AND databases ;)

    Thanks...Eggie

  7. I am "rewriting" my old game scripts and i am having problems with it ...
    right now i am having problems recovering my login form script

    this is in my head.php

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

    this is in my login.php
    <?php $title = "Login"; if (!$user || !$pass) {	include("head.php");	print "Please fill out all fields.";	include("foot.php");	exit;}


    it says "Notice: Undefined variable: user in C:\wamp\www\login.php on line 2" when i try to login ...
    what is the problem??it worked before.

  8. ohhh...nice,i saw this site once,but it did not interest me at that time,and in the mean time,i forgot about it...thank you for remembering me of this site(program).i will do that and try sorting it out ...this will really help me ;)did any of you ever done that or see other people do it on their PC's?which application should i use to do it?should i use windows default application to do it?and how can i say to my PC which is at home while i am at my girlfriends house not to remote connect to any other connection but mine???'password?


  9. Thanks for your answers...I just didn't know if there really exists one program that does such a thing...i really like that you don't have to retype everything,but just some mistakes that program makes which rarely happens...I will download trial of Abby Finereader and try it at first,but i think i'll like it that much to buy it afterall ;)Thanks...Eggie


  10. Is it possible to convert scanned picture(jpg) which has text into plain .txt file?my girlfriend got a mail from her professor which he scanned,not typed,and she wants it in .txt format....can this be easily done with some converter or she must retype it ?Need this information asap ;)Thanks...Eggie

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.