Jump to content

mrjameer

Members
  • Posts

    102
  • Joined

  • Last visited

    Never

Everything posted by mrjameer

  1. hi, i tested it putting-- or die (mysql_error()); at every mysql function.it is not showing any warnings or errors regarding mysql.it simply displays wrong username/password even if i enter the correct username/password mrjameer
  2. here is my db.php in which i have connections with my site phpmyadmin <?php $host="localhost"; $username="abcd"; $password="dcba"; $db="test"; $table41="clients"; ?>
  3. hi, i have a php script for login to my web site.it works very well when i test it in localhost but when i upload it to my site it is not allowing me login.here is the code.help me to get out of it. thanks mrjameer <?php session_start(); include 'db.php'; $use=$_POST['username']; $pwd=$_POST['password']; $use1=sha1($use); $pwd1=sha1($pwd); $conn4=mysql_connect($host,$username,$password); mysql_select_db($db,$conn4); $sql="SELECT * FROM $table41"; $result=mysql_query($sql,$conn4); while($newarray=mysql_fetch_array($result)) { $username=$newarray['username']; $password=$newarray['password']; } $errorMessage = ''; if (isset($_POST['username']) && isset($_POST['password'])) {     // check if the username and password combination is correct     if ($use1 === $username && $pwd1 === $password) {         // the username and password match,          // set the session         $_SESSION['basic_is_logged_in'] = true;                 // after login we move to the main page         header('Location: menu1.php');         exit;     } else {         $errorMessage = 'Sorry, wrong username / password';     } } ?> <html> <head> <title>Basic Login</title> <style type="text/css"> html, body { margin: 0px; padding: 0px;  border: 0px; background: url(bg1.gif)repeat-x; background-color:#8db0e5; } #m { margin-left:450px; margin-top:150px; } #n { margin-left:50px; margin-top:20px; } #o { margin-left:560px; margin-top:20px; } </style> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php if ($errorMessage != '') { ?> <p align="center"><strong><font color="#990000"><?php echo $errorMessage; ?></font></strong></p> <?php } ?> <form action="" method="post" name="frmLogin" id="frmLogin"> <div id="m"> <b>PLEASE ENTER USER ID /  PASSWORD</b></div> <div id="n"> <table width="400" border="1" align="center" cellpadding="2" cellspacing="2">   <tr>   <td width="150">User Id</td>   <td><input name="username" type="text" id="username" size="25"></td>   </tr>   <tr>   <td width="150">Password</td>   <td><input name="password" type="password" id="password" size="27"></td>   </tr>   <tr>   <td width="150">&nbsp;</td>   <td><input name="btnLogin" type="submit" id="btnLogin" value="Login"></td>   </tr> </table> </div> <div id="o"> <a href="javascript:window.close();">Exit</a></div> </form> </body> </html>
  4. hi, A visitor selects some options from a page and press the submit button,then the second page shows his selected options and there he fill his details and again press the submit button then the selected options with his details is stored in db i have used sessions to move the data from one page to another.with localhost it is working good but when i upload  the scripts to my site it is showing following warnings.how to overcome with this. Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/comm/public_html/local_dynamic/br.php:6) in /home/comm/public_html/local_dynamic/br.php on line 168 your help will appreciated. thanks mrjameer
  5. hi, can anybody please tell me how to avoid the user from entering any html code like '<','>', any other malicious characters in textarea using php. thanks mrjameer
  6. hi, i have a form which contains some textboxes for name,email,phone,address.the user will enter some values in that.i want to validate them.how to do it.i want to validate the user so that he can enter name in name textbox and number in phone textbox and in email.could you please tell me how to validate this. thanks mrjameer
  7. hi, i have a web page on which i put some radio buttons and when i click it, its value is displayed in textbox.when i click 2 radio,the 2 values will be addded and displayed in textbox[like shopping cart]. next if i click submit button it print's those values in second page and i want to take some user input on second page and then all the data will be stored in db.i did all this using sessions.it's working but when iam in second page,and when i click the browsers back button,to go to the radio buttons page and select some other options it is showing session has expired.how to solve this problem. your help will be appreciated thanks mrjameer
  8. hi, can anybody tell me where i can find the php chat scripts that can handle the multiple users with complete privacy.i already tested many scripts but there is no privacy between one user and another.. your help will be appreciated. thanks mrjameer
  9. hi, i have developed one web page using php/mysql.when i view the web page in IE or FF then that webpage is good. but when i click the restore down button on right hand side top corner of browser my web page is like broken but when i click maximize button of browser iam getting good one how to overcome with this problem.i want to view my web page same in maximize and restore down states.how to do it. thanks mrjameer
  10. hi, i want to create a textarea in which the user can input 100 characters only.he canot able to input more than 100.i want to do this with out using php/javascript.is it possible.your help will be appreciated thanks mrjameer
  11. hi, i want to store css styles(simple box) in one table and in another table divs as one field and content as another field.so that when i combine these two tables in a select query i can get a some text in that box.how to do it.your help will be appreciated.i had stored styles and divs and content but when i retrieve it the content(text) is displaying outside of styles.i want to display the text in box thanks mrjameer
  12. hi, i want to combine 2 fields in a single select query fields. pageheader name values. abcd <div id="d"></div> i want to merge/combine the pageheader and name in a single select query so that it can retrieve the pageheader with some styles which i have stored in another table thanks mrjameer
  13. i want to build a cms,in such a manner that the client who dont know php can update the content( can change text of left navbar,right navbar,center content by entering his own choice in a form of admin control panel) and upload images(banners,ads) etc...how to do it.whether i have to store css,html in db or i create a separate .css file and implement it in php script.guide me which one i approach.if i store the css in db and retrieve the css,html divs in textarea from db,for updations the html tags should be hided but not ignored and display the 'text' only in textareas.so that he can delete or update those text.. thanks mrjameer
  14. hi i want to know how to validate multiple set of radiobuttons.for example 1.item A a.item1-$100 b.item2-$200 c.item3-$300 2.item B a.item4-$200 b.item5-$300 c.item6-$400 3.item C a.item7-$10 b.item8-$20 c.item9-$30 when item1 of itemA is clicked its value should be displayed in one textbox and when 3 items had been selected from three sets of radio buttons its total value should be displayed in same textbox like this.how to do it please help me. mrjameer
  15. iam getting this error.iam using php4,mysql4,apache 1.3 ,windows platform[xp] 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 'right='#right {position : relative; height : 779px; width : 267 mrjameer
  16. ya i want to store css code in db and retrieve it and want to update css code from admin cp.i already tested htmlentities,htmlspecialchars like that.everything is displaying correctly but when updating it from admin panel it is not updated. thanks mrjameer
  17. hi, i want to store css template which has header,left navbar,center,right navbar,footer in mysql db.iam using like this 1..i will store a css template in db 2..retrieve it from db and assigned its value to some textarea for updations 3..update content $header='<style type ="text/css"> #header{ background-color:white; color:#009900; border-style:solid; border-width:3px; height:200px; width:300px; padding:5px;}</style><div id="header">WELCOME</div>'; if i use this type everything is displayed correctly but when updating it iam getting error is it the correct way to store in db or i have to use $header='<link rel="stylesheet" type="text/css" href="abc.css"> <div id="header">WELCOME</div>'; mrjameer
  18. hi, i want to know how to validate multiple radiobuttons.for example 1.hobbies--radiobutton1[play],radobutton2[tv],radiobutton3[music] finally one submit button.when i click the radio button and press submit button,it should display the selected radio button value in a textbox1. 2.class--radiobutton1[business],radobutton2[executive],radiobutton3[normal] finally one submit button.when i click the radio button and press submit button,it should display the selected radio button value. in a textbox2 means total 6 radiobuttons and 2 submit buttons how to handle it.i know with  3 radiobuttons and 1 submit button here is code.just correct the mistakes <form name="fname" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>"> <b>hosting</b> 100<input type="radio" name="check[]" value="100"> 200<input type="radio" name="check[]" value="200"> 300<input type="radio" name="check[]" value="300"> value<input type="text" name="text1" value="<?php echo $check['0'];?>"> <input type="submit" value="submit"> <br><br><br> <b>digichat</b> 100<input type="radio" name="check1[]" value="100"> 200<input type="radio" name="check1[]" value="200"> 300<input type="radio" name="check1[]" value="300"> value<input type="text" name="text1" value="<?php echo $check1['0'];?>"> <input type="submit" value="retrieve" onclick="this.form.action='<?php echo $_SERVER['PHP_SELF'];?>'"> i need your help mrjameer
  19. hi, iam developing a web site with online customer service feature. 1.when a customer opens my site then he should see the red button image on header(means the sales operator is not available like that)which is default. 2.when the sales operator is logged in then the red button image should change to green button image  on main page(means that operator is online). 3.when second customer open our site,after sales operators login, he should see green button image(means he can chat with the operator) and  similarly when sales operator logged out then the green button image should change to red one. i have login script but when i test the condition of after login image should change,its not working.after login red button as it is.i want to do this with php/javascript... thanks mrjameer
  20. hi syed, iam developing a website.on main page i have one red button image on header.below that login box.when i enter username/password it will display welcome message on the same page(other web contents should remain same)  and on the same page the red button image should change to green button image. second, once the user login,if i open the same page in other browser it should display the green button image(means user is online like that) jameer
  21. hi i want to change the image of a webpage on user login using php.bydefault i have some other image on my webpage.after user login when i open this web page in some other browser i need the second image..how to do it help me jameer ???
  22. hi when i execute a mail program iam getting some error as follows Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in c:\appserv\www\mails.php on line 20 what is the solution to this problem code <?php // Target email address. $to="webmaster@localhost"; // Your subject. $subject="Test Email"; // Sender. You may put the sender's email address after "from:". This example file use "[email protected]" $mail_from="from: [email protected] \n"; // Set this email to HTML email format. $mail_from .="Content-Type: text/html; charset=utf-8 \n"; // Your message. $message="Hello, This is your test email.<br> Your email server is working now! "; // Send email. $sentmail = mail($to,$subject,$message,$mail_from); // If your email succesfully sent. if($sentmail){ echo "Email has been sent."; } else { echo "Cannot send email."; } ?> thanks mrjameer
  23. hi, iam trying to build a chat application using php/mysql for my web-site.can anybody knows any tutorials or sites for building a chat application.the application should be like this.when a sales person of my company login to my site then the online service image should be displayed,and when he logout it should disappear.when sales person is online,  customers can chat with him by sending instant messages like that...this is my application..if you have any info for doing this application your help will be appreciated. thanks mrjameer
  24. iam storing a variable in db as follows $str='<html><b>ABCD</b></html>'; by using insert query,i put it in mysql db. in my second program iam creating one textbox and inserting it in db as follows $textbox1='name<input type="text" name="t1" value="<?php echo $str;?>">'; by using insert query iam storing it in db.... finally i have written a third program to retrieve these textboxes with $str values from db;but iam getting textbox with <?php echo $str;?> value.but i want to get <html><b>ABCD</b></html> in that textbox.please tell me how to do it. //program for storing html code in db <?php $var1='<html><b>ABCD</b></html>'; $var2='<html><h3>EFGH</h3></html>'; $var3='<html><b>IJKL</b></html>'; $var4='<html><b>MNOP</b></html>'; $conn4=mysql_connect("localhost","",""); mysql_select_db("mrj",$conn4); function escape_quotes( $html ) { if ( get_magic_quotes_gpc() ) { return( $html ); } else { return( addslashes( $html ) ); } } $var1 = escape_quotes( $var1 ); $var2 = escape_quotes( $var2 ); $var3 = escape_quotes( $var3 ); $var4= escape_quotes( $var4 ); $sql="INSERT INTO mak VALUES('$var1','$var2','$var3','$var4')"; $result=mysql_query($sql,$conn4); echo "record inserted"; ?> //program for storing textboxes with some values in db <?php $conn4=mysql_connect("localhost","",""); mysql_select_db("mrj",$conn4); $va1='variable1<input type="text" name="vars1" size="35" value ="' .$var1.'"><br>'; $va2='variable2<input type="text" name="vars2" size="35" value ="' .$var2.'"><br>'; $va3='variable3<input type="text" name="vars3" size="35" value ="' .$var3.'"><br>'; $va4='variable4<input type="text" name="vars4" size="35" value ="' .$var4.'"><br>'; $updates='<input type="submit" value="update" onclick="this.form.action=\'upd.php\'"><br>'; function escape_quotes( $html ) { if ( get_magic_quotes_gpc() ) { return( $html ); } else { return( addslashes( $html ) ); } } $va1 = escape_quotes( $va1 ); $va2 = escape_quotes( $va2 ); $va3 = escape_quotes( $va3 ); $va4 = escape_quotes( $va4 ); $updates = escape_quotes( $updates ); $sql="INSERT INTO sampl1 VALUES('$va1','$va2','$va3','$va4','$updates')"; $result=mysql_query($sql,$conn4) or die (mysql_error()); echo "record inserted"; ?> //program for retriving the textboxes with the values from db (the values which i stored in db by writing first program) <?php $conn4=mysql_connect("localhost","",""); mysql_select_db("mrj",$conn4); $sql="SELECT * FROM sampl1"; $result=mysql_query($sql,$conn4); while($newarray=mysql_fetch_array($result)) { $va1=$newarray['va1']; $va2=$newarray['va2']; $va3=$newarray['va3']; $va4=$newarray['va4']; $updates=$newarray['updates']; echo $va1."".$va2."".$va3."".$va4."".$updates; } ?> with this code either iam getting the value in textbox is <?php echo $str;?> like that or some blank textboxes.please help me to solve my problem mrjameer :)
  25. iam storing a variable in db as follows $str='<html><b>ABCD</b></html>'; by using insert query,i put it in mysql db. in my second program iam creating one textbox and inserting it in db as follows $textbox1='name<input type="text" name="t1" value="<?php echo $str;?>">'; by using insert query iam storing it in db.... finally i have written a third program to retrieve these textboxes with $str values from db;but iam getting textbox with <?php echo $str;?> value.but i want to get <html><b>ABCD</b></html> in that textbox.please tell me how to do it. //program for storing html code in db <?php $var1='<html><b>ABCD</b></html>'; $var2='<html><h3>EFGH</h3></html>'; $var3='<html><b>IJKL</b></html>'; $var4='<html><b>MNOP</b></html>'; $conn4=mysql_connect("localhost","",""); mysql_select_db("mrj",$conn4); function escape_quotes( $html ) { if ( get_magic_quotes_gpc() ) { return( $html ); } else { return( addslashes( $html ) ); } } $var1 = escape_quotes( $var1 ); $var2 = escape_quotes( $var2 ); $var3 = escape_quotes( $var3 ); $var4= escape_quotes( $var4 ); $sql="INSERT INTO mak VALUES('$var1','$var2','$var3','$var4')"; $result=mysql_query($sql,$conn4); echo "record inserted"; ?> //program for storing textboxes with some values in db <?php $conn4=mysql_connect("localhost","",""); mysql_select_db("mrj",$conn4); $va1='variable1<input type="text" name="vars1" size="35" value ="' .$var1.'"><br>'; $va2='variable2<input type="text" name="vars2" size="35" value ="' .$var2.'"><br>'; $va3='variable3<input type="text" name="vars3" size="35" value ="' .$var3.'"><br>'; $va4='variable4<input type="text" name="vars4" size="35" value ="' .$var4.'"><br>'; $updates='<input type="submit" value="update" onclick="this.form.action=\'upd.php\'"><br>'; function escape_quotes( $html ) { if ( get_magic_quotes_gpc() ) { return( $html ); } else { return( addslashes( $html ) ); } } $va1 = escape_quotes( $va1 ); $va2 = escape_quotes( $va2 ); $va3 = escape_quotes( $va3 ); $va4 = escape_quotes( $va4 ); $updates = escape_quotes( $updates ); $sql="INSERT INTO sampl1 VALUES('$va1','$va2','$va3','$va4','$updates')"; $result=mysql_query($sql,$conn4) or die (mysql_error()); echo "record inserted"; ?> //program for retriving the textboxes with the values from db (the values which i stored in db by writing first program) <?php $conn4=mysql_connect("localhost","",""); mysql_select_db("mrj",$conn4); $sql="SELECT * FROM sampl1"; $result=mysql_query($sql,$conn4); while($newarray=mysql_fetch_array($result)) { $va1=$newarray['va1']; $va2=$newarray['va2']; $va3=$newarray['va3']; $va4=$newarray['va4']; $updates=$newarray['updates']; echo $va1."".$va2."".$va3."".$va4."".$updates; } ?> with this code either iam getting the value in textbox is <?php echo $str;?> like that or some blank textboxes.please help me to solve my problem mrjameer :)
×
×
  • 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.