Jump to content

vasoftwaresolutions

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Everything posted by vasoftwaresolutions

  1. Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/pacifij1/public_html/bluewavesvirtual/checklogin.php on line 23 Does any know what that means.. here is my code <?php $host="localhost"; // Host name $username="pacifij1_blue"; // Mysql username $password="8336994895"; // Mysql password $db_name="pacifij1_blue"; // Database name $tbl_name="pilot"; // 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"); // username and password sent from signup form $callsign=$_POST['callsign']; $password=$_POST['password']; $first_name=$_POST['first_name']; $last_name=$_POST['last_name']; $sql="SELECT * FROM $tbl_name WHERE callsign='$callsign' and password='$password'"; $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 row if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" session_register("callsign"); session_register("password"); session_register("first_name"); session_register("last_name"); header("location:login_success.php"); } else { echo "Wrong Username or Password"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- TemplateBeginEditable name="doctitle" --> <title>Loading</title> <!-- TemplateEndEditable --> <!-- TemplateBeginEditable name="head" --> <!-- TemplateEndEditable --> </head> <body> </body> </html>
  2. AH THANKS.. i forgot to post the varibles.. lol
  3. hello, My string below i think is correct but when i apply it .. it inserts it into the database as nothing just a entry thats blank. here is my code.. any help is appresheated <?php $hostname = "localhost"; $database = "pacifij1_blue"; $username = "pacifij1_blue"; $password = "8336994895"; $vrbo = mysql_connect($hostname, $username, $password) or die(mysql_error()); mysql_select_db($database, $vrbo); $query_in = "INSERT INTO pilot (first_name, last_name, password, email, hub, city, state, country, about) VALUES ('$first_name', '$last_name', '$password', '$email', '$hub', '$city', '$state', '$country', '$about')"; $in = mysql_query($query_in, $vrbo) or die(mysql_error()); header('Location: index.php'); ?>
  4. is this a valid string ? <?php $to = "captaintyson@austin.rr.com"; $subject ="Blue Hawiaan Virtual | A new pilot has signed up"; $message = "A new pilot has signed up ... please add them into the system."; mail($to, $subject, $message); ?>
  5. For some reason this will not let me login.. you can see the error if you login here is the page.. http://globalskyairlines.com/pilots user = BLUE101 password = 833699 thanks for any help! here is my source <?php $hostname = "localhost"; $database = "globalsky_bluehawaiian"; $username = "bluehawaiian"; $password = "8336994895"; $vrbo = mysql_connect($hostname, $username, $password) or die(mysql_error()); ?> <?php // *** Validate request to login to this site. if (!isset($_SESSION)) { session_start(); } $loginFormAction = $_SERVER['PHP_SELF']; if (isset($_GET['accesscheck'])) { $_SESSION['MM_redirectLoginSuccess'] = $_GET['accesscheck']; } if (isset($_POST['username'])) { $username=$_POST['username']; $password=$_POST['password']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "overview.php"; $MM_redirectLoginFailed = "index.php?M=Login Failed"; $MM_redirecttoReferrer = false; mysql_select_db($database, $vrbo); $LoginRS__query=sprintf("SELECT callsign, password FROM pilots WHERE callsign=%s AND password=%s", GetSQLValueString($username, "text"), GetSQLValueString($password, "text")); $LoginRS = mysql_query($LoginRS__query, $vrbo) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = ""; //declare two session variables and assign them $_SESSION['MM_Username'] = $username; $_SESSION['MM_UserGroup'] = $loginStrGroup; if (isset($_SESSION['MM_redirectLoginSuccess']) && false) { $MM_redirectLoginSuccess = $_SESSION['MM_redirectLoginSuccess']; } header("Location: " . $MM_redirectLoginSuccess ); } else { header("Location: ". $MM_redirectLoginFailed ); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Blue Hawaiian Login</title> <style type="text/css"> <!-- .style1 {color: #C0C0C0} --> </style> </head> <body> <span class="style1"><br /> </span><br /> <br /> <form id="form1" name="form1" method="POST" action="<?php echo $loginFormAction; ?>"> <table width="100%" border="0"> <tr> <td>Callsign:</td> <td><label> <input type="text" name="Username" id="Username" /> </label></td> </tr> <tr> <td>Password:</td> <td><input type="password" name="password" id="password" /></td> </tr> <tr> <td height="23"> </td> <td> </td> </tr> <tr> <td height="23"> </td> <td><label> <input type="submit" name="button" id="button" value="Login" /> </label></td> </tr> </table> </form> </body> </html>
  6. thanks.. how would i do that.. if i could then i could figure out whats wronge
  7. ??? ??? For some reason when i go to this page [url http://vasoftwaresolutions.com/cpanel]here[/url] it will not display anything on it.. it just blank.. can someone tell me what i am doing wrong thats my code below <?php require(sql/index.php); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } ?> <?php // *** Validate request to login to this site. if (!isset($_SESSION)) { session_start(); } $loginFormAction = $_SERVER['PHP_SELF']; if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck']; } if (isset($_POST['Username'])) { $loginUsername=$_POST['Username']; $password=$_POST['Password']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "ceo/index.php"; $MM_redirectLoginFailed = "index.php?M=Login Failed"; $MM_redirecttoReferrer = false; mysql_select_db($database_cPanel, $cPanel); $LoginRS__query=sprintf("SELECT VA_name, password FROM virtual_airlines WHERE VA_name=%s AND password=%s", GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); $LoginRS = mysql_query($LoginRS__query, $cPanel) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = ""; //declare two session variables and assign them $_SESSION['MM_Username'] = $loginUsername; $_SESSION['MM_UserGroup'] = $loginStrGroup; if (isset($_SESSION['PrevUrl']) && false) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; } header("Location: " . $MM_redirectLoginSuccess ); } else { header("Location: ". $MM_redirectLoginFailed ); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>V.A.S.S. Login</title> <style type="text/css"> <!-- .style1 {color: #C0C0C0} --> </style> </head> <body> <span class="style1">Please Login<br /> </span><br /> <br /> <form id="form1" name="form1" method="POST" action="<?php echo $loginFormAction; ?>"> <table width="100%" border="0"> <tr> <td>Va Name:</td> <td><label> <input type="text" name="va_name" id="va_name" /> </label></td> </tr> <tr> <td>Password:</td> <td><input type="password" name="password" id="password" /></td> </tr> <tr> <td height="23"> </td> <td> </td> </tr> <tr> <td height="23"> </td> <td><label> <input type="submit" name="button" id="button" value="Login" /> </label></td> </tr> </table> </form> </body> </html>
×
×
  • Create New...

Important Information

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.