Jump to content

SUNIL16

Members
  • Posts

    59
  • Joined

  • Last visited

    Never

Everything posted by SUNIL16

  1. this is form <form action="foo.php" method="POST"> Name: <input type="text" name="username" /><br /> Email: <input type="text" name="email" /><br /> <input type="submit" name="submit" value="Submit me!" /> </form> in foo.php i am getting values of username and email in firefox but in ie6 i am not getting using $_POST['username'] or using $_REQUEST['username'];
  2. Hi Friends, I have form in that i am sending some values using POST method. But i cant able to get values using $_POST['var'] or $_REQEUST['var'] Data is not coming in IE6, But it is coming in firefox and other browsers even in IE8. What may be problem? any settings i have to make for IE6. ? Any suggestions
  3. thank u sir, it solved my problem
  4. Hi friends How to get data between two same dates my query is working for timestamp 00:00:00 below is my query SELECT ACTIVITY_TYPE,,date_format(ACTIVITY_DATE,'%Y/%m/%d') as logdate FROM activity_log WHERE ACTIVITY_DATE BETWEEN STR_TO_DATE('10/12/2010','%d/%m/%Y') and STR_TO_DATE('10/12/2010,'%d/%m/%Y') values in table type date a 10/12/2010 11:39:43 b 10/12/2010 13:39:43 c 10/12/2010 14:39:43 my above query will work and returns these 3 rows wen data is like this a 10/12/2010 00:00:00 b 10/12/2010 00:00:00 c 10/12/2010 00:00:00 but when time is there how to fetch data any ideas thanks sunil
  5. Thanks AbraCadaver, Let me know other type of getting values, Let me learn more.
  6. Hi friends, How can i get month in numeric and year in date format mar/2008 date format. I need to store month value in one variable and year in other. for above $a=3, $b=2008 like this.
  7. Hi kenrbnsn, They are coming from database. for($i = 0; $i<$num ; $i++) { $arr.$i = array('$result[type]'=>'$result[values]'); this will be 'a'=>'1' }
  8. Please any one having any logic
  9. Hi friends, below is my code $arr1 = array('a'=>'1'); $arr2 = array('a'=>'0.5'); $arr3 = array('b'=>'1'); $arr4 = array('a'=>'1.5'); $arr5 = array('c'=>'1'); $arr6 = array('b'=>'1'); $arr7 = array('c'=>'1.5'); $arr8 = array('a'=>'1'); $all_array = array_merge_recursive($arr1, $arr2, $arr3, $arr4, $arr5, $arr6, $arr7, $arr8); echo "<pre>"; print_r($all_array); echo "</pre>"; foreach($all_array as $all_array_key => $all_array_value) { $all_count = 0; foreach($all_array_value as $all_array_value_key => $all_array_value_value) { $all_count += $all_array_value_value; } echo $all_array_key." = ".$all_count."<br>"; } now result i am getting a = 4 b = 2 c = 2.5 but my condition is not this i will be creating multiple array using loop, then how can use array_merge_recursive? I want for this above result for($i = 0; $i<$num ; $i++) { $arr.$i = array('a'=>'1');//like this i will be sending value dynamically //(say second will be array('b'=>'1.5') 3rd array('c'=>'1'), 4th array('a'=>'1.5') like that } then it will create arrays untill that $num value reaches, now how can i get the result in the same way as above. Please let me know any logic or code. how to do this.
  10. Its working in IE wen made XMLHttpRequestObject = new ActiveXObject("Microsoft", "XMLHTTP"); to XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP"); Its not working in Morzilla, chrome y?
  11. Hi Friends, why i am not able fetch message in data.txt file <html> <head><title>Ajax Demo</title> <script language="javascript"> var XMLHttpRequestObject = false; if(window.XMLHttpRequest) { XMLHttpRequestObject = new XMLHttpRequest(); } else if(window.ActiveXObject) { XMLHttpRequestObject = new ActiveXObject("Microsoft", "XMLHTTP"); } function get_data(sourcedata, DivId) { if(XMLHttpRequestObject) { var obj=document.getElementById(DivId); XMLHttpRequestObject.open("GET", sourcedata); XMLHttpRequestObject.OnreadyStateChange=function() { if(XMLHttpRequestObject.readystate == 4 && XMLHttpRequestObject.status ==200) { obj.innerHTML=XMLHttpRequestObject.ResponseText; } } XMLHttpRequestObject.Send(null); } } </script> </head><body> <h1> Ajax demo</h1> <form> <input type="button" value="fetch message" OnClick="get_data('data.txt','targetdiv')"> </form> <div id="targetdiv"> <p>fetched message will apear here</p> </div> </body></html> Where i went wrong?
  12. What is this error? Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\xampp\htdocs\jaga\login.php:9) in C:\xampp\htdocs\jaga\login.php on line 12 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\jaga\login.php:9) in C:\xampp\htdocs\jaga\login.php on line 12 Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\jaga\login.php:9) in C:\xampp\htdocs\jaga\login.php on line 37 Why it is showing? below is my code <html> <head> <meta http-equiv="Content-Language" content="en-us"> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Login Page</title> <?php require("config.php"); session_start(); if ($_POST['submit']=='login') { $username="$_POST[username]"; $password="$_POST[password]"; $sql="SELECT username FROM users where username='$username' AND password='$password'"; $result = mysql_query($sql) or die (mysql_error()); $num = mysql_num_rows($result); if ( $num != 0 ) { // A matching row was found - the user is authenticated. list($username) = mysql_fetch_row($result); // this sets variables in the session $_SESSION['user']= $username; header("Location: Content.html"); //echo "Logged in..."; exit(); } header("Location: login.php?msg=Invalid Login"); } ?> </head> <body> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="325"> <tr> <td width="100%" height="114"><font size="7">Login Page</font></td> </tr> <tr> <td width="100%" height="178">Login:<div align="center"> <center> <p><?php if(isset($_GET[msg])) { echo $_GET[msg]; }?> </p> <form name="form1" method="post" action=""> <table border="1" cellpadding="4" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="51%"> <tr> <td width="36%" align="center">Username:</td> <td width="64%" align="center"><input type="text" name="username" size="28"></td> </tr> <tr> <td width="36%" align="center">Password:</td> <td width="64%" align="center"><input type="password" name="password" size="28"></td> </tr> <tr> <td width="100%" align="center" colspan="2"> <input type="submit" name="submit" value="login"> </td> </tr> </table> </form> </center> </div> </td> </tr> <tr> <td width="100%" height="31"> </td> </tr> </table> </body> </html>
  13. Ya thanks i agree i was wrong. i send query two times.
  14. Is my sql syntax wrong! It worked for me in live server? Suggestions...
  15. Hi Friends, I am getting below error Warning: mysql_query() expects parameter 1 to be string, resource given in C:\xampp\htdocs\lib_management\login.php on line 22 Wen i run this code <?php require("config.php"); if(isset($_REQUEST["login_clicked"])) { if($_REQUEST["username"]=="") { header("location:login.php?msg=please enter a valid username"); exit(); } elseif($_REQUEST["password"]=="") { header("location:login.php?msg=please enter a valid password"); exit(); } else { $password=$_REQUEST["password"]; $username=$_REQUEST["username"]; } $sql=mysql_query("SELECT username,password FROM admintable WHERE username='$_POST[username]' AND password='$_POST[password]'"); $result = mysql_query($sql) or die (mysql_error()); $num = mysql_num_rows($result); if ( $num != 0 ) { header("location:home.html"); exit(); } else { header("location:login.php?msg=invalid login"); } } ?> My table code is <?php require "config.php"; $result = mysql_query("CREATE TABLE `admintable` ( `admintableid` int(20) NOT NULL auto_increment, `username` varchar(200) collate latin1_general_ci NOT NULL default '', `password` varchar(200) collate latin1_general_ci NOT NULL default '', PRIMARY KEY (`admintableid`) )"); if (!$result) { die('Invalid query: ' . mysql_error()); } ?> What is the above warning i am not getting.
  16. Hi thorpe waynewex, Thanks for your response. Its working nice. Thank you all for your conversation. to be safer i continue using exit after header.
  17. Hi Friends, I am having a field user_activated in my table. I want to check whether it is active or not. once the user click on the activation link the user_activated becomes "1". I am using below code <?php require "config.php"; if ($_POST['Submit']=='Login') { $username = mysql_real_escape_string($_POST['uname']); $md5pass = md5($_POST['password']); $sql1 = mysql_query("SELECT user_activated FROM users WHERE username = '$username' AND password = '$md5pass'"); $checkactive = mysql_num_rows($sql1); if ($checkactive != 1) { header("Location: login.php?msg=Your account not active"); exit(); } else { $sql = "SELECT usersid,username FROM users WHERE username = '$username' AND password = '$md5pass' "; $result = mysql_query($sql) or die (mysql_error()); $num = mysql_num_rows($result); if ( $num != 0 ) { // A matching row was found - the user is authenticated. session_start(); list($user_id,$usernamel) = mysql_fetch_row($result); // this sets variables in the session $_SESSION['user']= $username; if (isset($_GET['ret']) && !empty($_GET['ret'])) { header("Location: $_GET[ret]"); } else { header("Location: myaccount.php"); } //echo "Logged in..."; exit(); } } header("Location: login.php?msg=Invalid Login"); echo "Error:"; exit(); } ?> here if the user not active if ($checkactive != 1) { header("Location: login.php?msg=Your account not active"); exit(); } this condition is not executing. where i went wrong please let me know. I want to display " user not active " if user_activated is other than 1. now this code showing invalid login only. Please help me out in this.
  18. Thanks taith for your reply.. now its coming as it is. I am using print htmlentities($str1); functions bcoz if some one sends some html code or php code it should display the code not to run that code. means it has to take like comment. Is this nl2br() functions display code sent in form?
  19. Hi friends, I am having a form in that users can send some information. i am able to get the values sent by users. but problem is if they used enter key for next line it is not coming its coming continuously without break. i want to display as it is the user sends. i am using print htmlentities($str1); function while retrieving. please give some suggestions. thanks
  20. Thanks man i really had that doubt its cleared. Thanks once again for ur reply..
  21. Hello friends, I am using MD5 function for storing members password while registering. Now i want send them password if the forget it. For this i am again using MD5(password) to get the real password not encrypted. But i am not getting the real password what they given at the time of registering. below is my code for sending passwor <?php require "config.php"; if ($_POST['Submit']=='Send') { $host = $_SERVER['HTTP_HOST']; $rs_search = mysql_query("select username,password,email from users where email='$_POST[email]'"); $user_count = mysql_num_rows($rs_search); if ($user_count != 0) { $result = mysql_query("select username,password from users where email='$_POST[email]'"); $row=mysql_fetch_array($result); $username=$row['username']; $sendpass=md5($row['password']); $host = $_SERVER['HTTP_HOST']; $message = "You have requested login details from $host. Here are the login details...\n\n User Name: $username \n Password: $sendpass\n ____________________________________________ *** LOGIN ***** \n To Login: http://$host/login.php \n\n _____________________________________________ Thank you. This is an automated response. PLEASE DO NOT REPLY. "; mail($_POST['email'], "Your Login Details", $message, "From: \"Auto-Response\" <admin@$host>\r\n" . "X-Mailer: PHP/" . phpversion()); here i am not getting the original password in variable $sendpass what is the reason?
×
×
  • 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.