Jump to content

form varibles empty problem


ottoman_

Recommended Posts

as u can see , the form submits info into vars $user and $passswd in php section

 

the problem i am getting is that when i echo these vars , nothing shows up

meaning they are empty while input is present in form and i click check

 

the mysql thing works fine i have checked it by hardcoding my row variables

 

i confused why the input is not coming to php section

 

thankyou in advance

 


<?php
session_start(); // start up your PHP session!
?>


<html>
  <body>
<!-- a new form to hold our text fields , username and password-->
  <form new_from="aa.php" method=Check>
  <!-- my_from_page.php is actual page hosted on the webserver being accessed-->
  username <input type=text name='uname'> <br />
  <!-- username is field , its name used by parser is username and type is text-->
  password<input type=password name='passwd'> <br />
  <!-- name of textfield is passwd , the varibale name i maen used by parser-->
  <input type=submit value=Check > <p>
  <!-- when u click on button named check , the info is submitted , actually php takes over-->
  </form>

  <?php
$user=$_Check[uname];
$passwd=$_Check[passwd];


mysql_connect("localhost", "root", "sa") or die(mysql_error());
mysql_select_db("test") or die(mysql_error());


$result = mysql_query("SELECT count(id) from usr where passwd = '$passwd' ") or die(mysql_error());  

$row = mysql_fetch_array( $result );
echo $row[0];
if( $row[0] !=1) echo "no";
else echo "yes";


Link to comment
https://forums.phpfreaks.com/topic/136671-form-varibles-empty-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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