Jump to content

a65

Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by a65

  1. still is not working plz have a look at my whole code as u suggested $(document).ready(function(){ //global vars var form = $("#myform"); var cname = $("#company_name"); var cnameInfo = $("#cnameInfo"); cname.on("blur", function() { validateName(this); }); cname.on("keyup", function() { validateName(this); }); function validateName(cname){ if(cname.val().length < 4){ cname.addClass("error"); cnameInfo.text("We want names with more than 3 letters!"); cnameInfo.addClass("error"); return false; } else{ cname.removeClass("error"); cnameInfo.text(""); cnameInfo.removeClass("error"); return true; } } });
  2. this function is not doing any change even using it blur is also not working
  3. Blur is working properly in codeignitor but why not keyup? var form = $("#myform"); var cname = $("#company_name"); var cnameInfo = $("#cnameInfo"); cname.blur(validateName); cname.keyup(validateName); function validateName(){ if(cname.val().length < 4){ cname.addClass("error"); cnameInfo.text("We want names with more than 3 letters!"); cnameInfo.addClass("error"); return false; } else{ cname.removeClass("error"); cnameInfo.text(""); cnameInfo.removeClass("error"); return true; } }
  4. Is that necesary to use sessions in codeIgnitor? as a am not able to see the files using URL which i can see after being logged in.
  5. <div id="logo"><img src="logo.jpg"</div> <div id="login">login page </div> <table> <tr><td >Name</td><td width><input type=text name=myname></td></tr> <tr><td>Age</td><td><input type=text name=myage></td></tr> <tr> <td> </td> <td><input type=submit value=submit> <input name="Reset" type=reset value=Reset></td> </tr> </table> </div> css code is #logo { float:left; width: 50px; height:10px; } #login { width:100%; font:"Courier New", Courier, mono; font_size:50px; height:50px; margin_left:150px; background:blue; margin_top:10px;
  6. why i am getting the above error.. <?php session_start(); /*this is for making payment by user*/ if(isset($_SESSION['sname']) && isset($_SESSION['spassword']) && isset($_SESSION['saccount_type'])) { mysql_connect("localhost","root",""); mysql_select_db("bank_acount"); $query="select * from account"; $result=mysql_query($query) or die(mysql_error()); $row=mysql_fetch_assoc($result); $num=mysql_num_rows($row); echo($query); ?>
  7. again writing the query solved my problem...
  8. now i am getting reset()expects parameter 1 to be array
  9. why i am not able to show the fetched data in both the combobox. it is being shown in only one combobox <tr><td>account from transfer</td><td><select name="accountname"> <?php while($row=mysql_fetch_assoc($result)) { ?> <option value="<?php echo($row['account_name']); ?>"><?php echo($row['account_name']); ?></option> <?php } ?> </select> </td> </tr> <tr><td>account to transfer</td><td><select name="accountname2"> <?php while($row=mysql_fetch_assoc($result)) { ?> <option value="<?php echo($row['account_name']); ?>"><?php echo($row['account_name']); ?></option> <?php } ?> </select> </td></tr>
  10. i am not able to fetch the values from user_info table and the code is <tr><td>username</td><td> <?php while($row=mysql_fetch_assoc($result)) { ?> <select name="myusername"><option value="<?php echo($row['username']); ?>"><?php echo($row['username']); ?></option> <?php } ?> </select></td></tr>
  11. what is the problem in this line. it is not able to fetch values from user_info ? <tr><td>username</td><td> <?php while($row=mysql_fetch_assoc($result)) { ?> <select name="myusername"><option value="<?php echo($row['username']); ?>"><?php echo($row['username']); ?></option> <?php } ?> </select></td></tr>
  12. here i have to insert these values into account after using if(isset($_POST['account_name'])) echo($account_name); still it gives Undefined index: account_name online 34
  13. why i am not getting a combobox againt usename and also it is showing Undefined index: account_name at line 33 <?php session_start(); if(isset($_SESSION['sname'])) { $var1=$_SESSION['sname']; mysql_connect("localhost","root",""); mysql_select_db("bank_acount"); $query="select * from user_info where username='".$var1."'"; $result=mysql_query($query); $row=mysql_fetch_assoc($result); ?> <form method="post" action="admin_control.php"> <table><tr><td>username</td><td> <?php while($row=mysql_fetch_assoc($result)) { ?> <select name="myusername"><option value="<?php echo($row['username']); ?>"><?php echo($row['username']); ?></option> <?php } ?> </select></td></tr> <tr><td>account name</td><td><input type="text" name="account_name"></td></tr> <td><input type=submit name=submit></td><td><input type=reset></td></table> <?php $var2=$_POST['account_name']; $query ="insert into account values('','$var1','$var2')"; $result=mysql_query($query); } else { echo("improper access"); } ?>
  14. i am trying to go to admin_control.php from login.php through session but it is showing the result improper access of page html code is <html><form method="post" action="login.php"> <link type="test/css" rel="stylesheet" href="user_info.css"></style> <body><table border="1px"> <tr><td>username</td><td><input type=text name=myusername></td></tr> <tr><td>password</td><td><input type=password name=mypassword></td> <tr><td>type</td><td><select name=account_type> <option>admin</option> <option>normal</option></select></td></tr> <tr><td><input type=submit name=login></td><td><input type=reset name=reset></td></tr></table></body></html> php code is <?php session_start(); mysql_connect("localhost","root",""); mysql_select_db("bank_acount"); $var1=$_POST['myusername']; $var2=$_POST['mypassword']; $var3=$_POST['account_type']; $query="select * from user_info where username='".$var1."' and password='".$var2."' and account_type='".$var3."'"; $result=mysql_query($query); $row=mysql_fetch_assoc($result); $num=mysql_num_rows($result); $_SESSION['sname']=$row['username']; $_SESSION['spasswword']=$row['password']; $_SESSION['saccount_type']=$row['account_type']; if($num) { if($_SESSION['saccount_type']==admin) header("location:admin_control.php"); else if($var3==normal) { header("location:user_control.php"); } } else { header("location:normal_user_reg.html"); } ?> admin_contro.php is <?php session_start(); if(isset($_SESSION['sname']) && isset($_SESSION['spassword'])&& isset($_SESSION['saccount_type']) ) { mysql_connect("localhost","root",""); mysql_select_db("bank_acount"); $query="select * from user_info"; $result=mysql_query($query); ?> <div align="center"><table width="150px" border="1px"><tr><td bgcolor="red">admin_control</td></tr> <tr><td><a href="add_account.php">add account</a></td></tr> <tr><td><a href="allocate_amount.php">allocate amount</td></tr> <tr><td><a href="make_payment.php"> make payment</a></td></tr> <tr><td><a href="fund_transfer.php"> fund transfer</a></td></tr> <tr><td><a href="set_user_type.php"> set user</a></td></tr> </table></div> <?php } else echo("improper acccess of page"); ?>
  15. using if(!$result) die(mysql_error()); it shows You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'id']}'' at line 1 and in the url field it shows http://localhost/pra...t2.php?id={$row['id']}
  16. editordelete.php <?php mysql_connect("localhost","root",""); mysql_select_db("mydb"); $query="select * from table5"; $result=mysql_query($query); if (!$result) die(mysql_error()); ?> <table><tr><td>name</td><td>age</td><td>gender </td><td>language1</td><td>language2</td><td>country </td><td>address</td><td>edit</td><td>delete</td></tr> <?php while($row=mysql_fetch_assoc($result)) { ?> <tr> <td><?php echo($row['name']); ?></td> <td><?php echo($row['age']); ?></td> <td><?php echo($row['gender']); ?></td> <td><?php echo($row['language1']); ?></td> <td><?php echo($row['language2']); ?></td> <td><?php echo($row['country']); ?></td> <td><?php echo($row['address']); ?></td> <td><a href="edit2.php?id={$row['id']}">edit</a> </td> <td><a href=delete2.php?id={$row['id']}">delete</a></td> <?php } ?> </table> edit2.php <?php mysql_connect("localhost","root",""); mysql_select_db("mydb"); $var1=$_GET['id']; $query="select * from table5 where id='".$var1."'"; $result=mysql_query($query); $row=mysql_fetch_assoc($result); print_r($row); ?> <FORM method=POST action=update.php> <table> <tr><td>name</td><td><input type=text name=myname value=<?php echo($row['name']); ?>> </td></tr> <td>age</td><td><input type=text name=myage value=<?php echo($row['age']); ?>></td></tr> <td>gender</td><td><input type=radio name=mygender value=<?php echo($row['gender']); ?>>male <input type=radio name=mygender value=<?php echo($row['gender']); ?>>female</td></tr> <td>language1</td><td><input type=checkbox name=lang1 value=<?php echo($row['language1']); ?>>hindi</td></tr> <td>language2</td><td><input type=checkbox name=lang2 value=<?php echo($row['language2']); ?>>english</td></tr> <td>country</td><td><select name=mycountry value=<?php echo($row['country']); ?>><option>India</option><option>bangladesh</option><option>pakistan</option></td></tr> <td>address</td><td><textarea rows=5 cols=5 name=myaddress value=<?php echo($row['address']); ?>></textarea></td></tr> <tr><td><input type=submit value=update></td></tr></table>
  17. yeah i corrected that now after using if(!result) die(mysql_error()); i am getting You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'id']}'' at line 1
  18. the url shows http://localhost/practices/edit2.php?id={$row['id']}
  19. <?php mysql_connect("localhost","root","")'; mysql_connect_db("mydb"); $var1=$_GET['id']; $query="select * from table5 where id='".$var1."'"; $result=mysql_query($query); $row=mysql_fetch_assoc($result); ?> <FORM method=POST action=update.php> <table> <tr><td>name</td><td><input type=text name=myname value=<?php echo($row['name']); </td> <td>age</td><td><input type=text name=myage value=<?php echo($row['age']); ?></td> <td>gender</td><td><input type=radio name=mygender value=<?php echo($row['gender']); ?></td> <td>language1</td><input type=checkbox name=lang1 value=<?php echo($row['language1']); ?></td> <td>language2</td><input type=checkbox name=lang2 value=<?php echo($row['language2']); ?></td> <td>country</td><input type=select name=mycountry value=<?php echo($row['country']); ?></td> <td>address</td><input type=textarea name=myaddress value=<?php echo($row['address']); ?></td> </tr><table>
  20. still it is giving the same error my whole code of editordelete.php is <?php mysql_connect("localhost","root",""); mysql_select_db("mydb"); $query="select * from table5"; $result=mysql_query($query); if (!$result) die(mysql_error()); ?> <table><tr><td>name</td><td>age</td><td>gender </td><td>language1</td><td>language2</td><td>country </td><td>address</td><td>edit</td><td>delete</td></tr> <?php while($row=mysql_fetch_assoc($result)) { ?> <tr> <td><?php echo($row['name']); ?></td> <td><?php echo($row['age']); ?></td> <td><?php echo($row['gender']); ?></td> <td><?php echo($row['language1']); ?></td> <td><?php echo($row['language2']); ?></td> <td><?php echo($row['country']); ?></td> <td><?php echo($row['address']); ?></td> <td><a href="edit2.php?id={$row['id']}">edit</a> </a></td> <td><a href=delete.php?id=<?php echo($row['id']); ?>></a></td> <?php } ?> </table>
  21. i have created a file editordelete.php from which reffering to another file edit2.php by <td><a href=edit2.php?id=<?php echo($row['id']); ?> and in edit2.php using $var1=$_GET['id']; to edit the date but it is giving Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\wamp\www\practices\edit2.php on line 4
  22. thanks... if (!$result) die(mysql_error()); solved the problem
  23. my coding was <?php mysql_connect("localhost","root",""); mysql_select_db("mydb"); $query="seleect * from table5"; $result=mysql_query($query); ?> <table><tr><td>name</td><td>age</td><td>gender </td><td>language1</td><td>language2</td><td>country </td><td>address</td><td>edit</td><td>delete</td></tr> <?php while($row=mysql_fetch_assoc($result)) { ?> <tr> <td><?php echo($row['name']); ?></td> <td><?php echo($row['age']); ?></td> <td><?php echo($row['gender']); ?></td> <td><?php echo($row['language1']); ?></td> <td><?php echo($row['language2']); ?></td> <td><?php echo($row['country']); ?></td> <td><?php echo($row['myaddress']); ?></td> <td><a href=edit.php?id=<?php echo($row['id']); ?> ?>>edit</a></td> <td><a href=delete.php?id=<?php echo($row['id']); ?>></a></td> <?php } ?> </table>
  24. why i am getting the above error in this code <?php while($row=mysql_fetch_assoc($result)) { ?>
×
×
  • 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.