Jump to content

suma237

Members
  • Posts

    282
  • Joined

  • Last visited

    Never

Everything posted by suma237

  1. thanks. and sorry to ask silly questions again , could you please explain me how to prevent others from from accessing the secured page by "back button" once i've successfuly logged out my session. I need to set the page to ask the user to login again with the correct password
  2. guru'ji thanks for the advice, but i am looking for a page with a message like "your session has been expired" or "Please sign in back" while clicking on the browsers back button
  3. Is there any other ways to end the secured pages session while opening other website in the same window ?
  4. hi Anish .. i suppose the problem is not clear, just take an example .. I have logged into my rediffmail account and after accessing my inbox i've opened another website without logging out my rediff account in the same window , then i l left my PC for a while and somene else purposefully click the back button and accessed my rediff mail accound . i just want to avoid that .. hope now the issue is clear
  5. Dear Thorpe, Is there any other ways to solve this problem ?
  6. I actually want to deactivate the browser's "back button" action when a user has accidently forgot to logged out his session and opened another website in the same window without logging out his session. I have noticed such faults with rediffmail.com.
  7. hi all check this code instead of project name use country table and replace task table with state . dynamicdropdown.php <? include("mysqlconnect.php"); $db='universus'; mysql_select_db($db); ?> <html> <head> <script src="selectcustomer.js"></script> </head> <body> <form> Select a Project Name: <? $sql_sel="select * from prjmaster"; $res=mysql_query($sql_sel); ?> <select name="prjname" onchange="showCustomer(this.value)"> <? while($row1=mysql_fetch_array($res)){ echo "<option " .$select. " value='".$row1['prjID']."'>".$row1['prjName']."</option>"; } echo "</select>"; ?> </form> <p> <div id="txtHint"><b>Task info will be listed here.</b></div> </p> </body> </html> <script language="javascript"> var xmlHttp function showCustomer(str) { xmlHttp=GetXmlHttpObject(); if (xmlHttp==null) { alert ("Your browser does not support AJAX!"); return; } var url="gettask.php"; url=url+"?q="+str; url=url+"&sid="+Math.random(); xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function stateChanged() { if (xmlHttp.readyState==4) { document.getElementById("txtHint").innerHTML=xmlHttp.responseText; //alert(document.getElementById("txtHint").innerHTML); } } function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } </script> gettask.php <? include("mysqlconnect.php"); $db='universus'; mysql_select_db($db); $id=$_REQUEST['q']; //echo "$id"; $sql_task="select * from prjtaskdetail where prjID='".$id."'"; $query2=mysql_query($sql_task); echo "<select name='prjtask'>"; while($row2 = mysql_fetch_array($query2)){ echo "<option value='".$row2['taskID']."'>".$row2['Description']."</option>"; } echo "</select>"; ?> bye
  8. hi, Check this code- nl2br will work <? $msg="gjjljk hjljklk jojl jjlk hojl bjhkjkk hkhkklp hkjljlk bgjhlko ghjhkj hihjlo"; print nl2br($msg); ?>
  9. <? $name = $_GET['name']; $score = $_GET['score']; $dbh=mysql_connect ("localhost", "username", "password") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db("database"); if ($score > 0) { $query = "SELECT id , score FROM testdata WHERE id = 1 LIMIT 0, 2 "; $result = mysql_query($query); $row=mysql_fetch_array($result); echo "Id=" .$row['id']."<br>"; echo "score=" .$row['score']."<br>"; } else { echo('No score was submitted'); } ?>
  10. Hi, check this code <? $id=1; $sql_sel="select username,email from tablename where id='$id'"; $res=mysql_query($sql_sel); $row=mysql_fetch_array($res); ?> <form method="post" action="'.$_SERVER['PHP_SELF'].'"> <table> <tr><td><input type="text" name="username" value="'.$row[username].'"> <tr><td><input type="text" name="email" value="<?=$row['email']?>"> <tr><td><input type="submit" name="submit" value="Update"> </table> </form>
  11. hi, use unset() function in your logout.php. Try this
  12. Hi, Use mysql_close() function at the end try..
  13. Hope your query solved?if still have any problem please include the code
  14. hi, Please check this In the above code (if ($parameterselect == $piod[$j]) { ) is wrong, Before the if loop select the variable $parameterselect then only the loop will execute. <? $parameterselect='draden'; $piod=array ('praden','draden'); //if ($_SESSION['perform'] == 1) { for ($j = 0; $j <2; $j++) { if ($parameterselect == $piod[$j]) { # first column echo '<td'; echo ' bgcolor="#ffffee" class="a10_b"><nobr> <b>'; echo $nval[$j]; echo '</b> </nobr>'; echo '</td>'; echo $piod[$j]; echo "<td><nobr> <input name=name".$counterup." type=hidden size=8 value=$nval[$j]> </nobr></td>"; echo "<td class=a10_b><input name=test_value".$counterup." type=text size=8 value=$pval[$j]> </td>"; echo "<td><nobr> <input name=msr_unit".$counterup." type=hidden size=7 value=$ms_r[$j]> </nobr></td>"; echo "<td><nobr> <input name=ranges".$counterup." type=hidden size=7 value= $rval[$j]> </nobr></td>"; $counterup++; }} // } R u able to understand this?
  15. Hi, Please check this <?php $email = "mymailaddress"; $subject = "Contact Form"; $message = "\name: ".$_POST['name']; $message .= "\nEmail Adress: ".$_POST['email']; $message .= "\nTelephone: ".$_POST['telephone']; $message .= "\nday: ".$_POST['day']; $message .= "\nmonth: ".$_POST['month']; $message .= "\nyear: ".$_POST['year']; $message .= "\nnights: ".$_POST['nights']; $message .= "\nrooms: ".$_POST['rooms']; $message .= "\npersons: ".$_POST['persons']; $message .= "\nmessage: ".$_POST['message']; $message = addslashes($message); $ok=mail($email, $subject, $message); if($ok==1){ header( "Location: http://www.mywebsite" );} else{ echo"application could not sent .Error try again"; } ?>
  16. post the code now so that i can check it.is it a link
  17. Hi, Check this <?php $var=3; $query="SELECT * FROM table-name WHERE id=$var";//this will display the imagesource for id=3 or $query="SELECT * FROM table-name WHERE id >$var";//this will display the imagesource greater than id=3 $res=mysql_query($query); $row=mysql_fetch_array($res); echo $row['img_source']; ?>
  18. Hi, $link=http://school.discovery.com/clipart/images/baseball.gif; header('Location: http://tristage.siteburg.com/whovisitsme.php?name=MEME&ownerID=abc123&viewerID=aaabbb&age=18&country=United States&city=Orangeville&vsex=Male&photo='.$link.'&userID=TheLostGuru&podize=1); Please try this
  19. Are you call the database connection more than once?please check it?
  20. Hi, Please check the database type of the particular field.
  21. Hai, Thanks for ur reply.my requirment is after valid the feild name and mailid,i want to go to next page. After submitimg,if the feild value will match with the databse value then i want to go to next page. Example-Same function of gmail main page..if u have any code like that pls send me.please.....
  22. hi, list means-dropdown menu or some thing else. i will send u a sample code. index.php if name of the client is selected then corresponding mail id should displayed.... <tr> <td >ClientName</td> <td ><? $sql_sel="select * from tb_client"; $db->query($sql_sel)or die($db->error()); echo "<select name='client_id' onChange='info1()'>"; /*echo "<option>Select Client Name</option>";*/ while($row5=$db->fetchArray()) echo "<option value=\"$row5[mailid]\">$row5[clientname]</option>"; echo "</select>"; ?></td> </tr> <tr> <td >ClientMail ID</td> <td > <!--<input name="email3" id="my_div" size="30">--> <div id="my_div"> Select Client Name: </div> </td> </tr> Script.js---this page contain ajax coding // JavaScript Document //Create Microsoft.XMLHTTP Object function makeObject(){ var x; var browser = navigator.appName; //detect the client browser if(browser == "Microsoft Internet Explorer"){ x = new ActiveXObject("Microsoft.XMLHTTP"); }else{ x = new XMLHttpRequest(); } return x; } //call the function makeObject() var request = makeObject(); //function send request function info1(){ //alert("hh"); var val = document.form.client_id.options[document.form.client_id.selectedIndex].value; //alert(val); request.open('get', 'test.php?id=' + val); request.onreadystatechange = parseInfo; request.send(''); } //function send data function parseInfo(){ if(request.readyState == 1){ document.getElementById('my_div').innerHTML = 'Loading...'; } if(request.readyState == 4){ var answer = request.responseText; document.getElementById('my_div').innerHTML = answer; } } test.php--the value is displayed in the div area of index.php <?if( $_GET['id'] != "" ) { //echo "hhh"; echo $id=$_GET['id']; } ?>
  23. Hai, im unable to go to next page after database validation....pls find the error in this page Main form-- <!-- theform.php --> <div style="padding: 10px;"> <div id="messagebox"></div> <form method="get" name="myForm" action="" > <input type="hidden" name="submit" value="send"> Your Name<br /> <input id="yourname" type="text" value="" /> <br /> Your MailId<br /> <input id="mailid" type="text" value="" /> <input type="button" value="Submit" onclick="validateform()" /> <div align="right"><a href="javascript:close()">close</a></div> </form> </div> <script language="javascript"> function validateform (){ var ajaxRequest; try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } thevalue=document.getElementById('yourname').value; themail=document.getElementById('mailid').value; serverPage = "validator.php?sstring=" + thevalue+ "&themail=" + themail ; //alert(serverPage); objID = "messagebox"; var obj = document.getElementById(objID); ajaxRequest.open("GET", serverPage,true); //ajaxRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); ajaxRequest.onreadystatechange = function() { if (ajaxRequest.readyState == 4 && ajaxRequest.status == 200) { obj.innerHTML = ajaxRequest.responseText; }} ajaxRequest.send(null); } </script> 2.validator.php <?php include("includes/db.inc.php"); $db=new DB; $db->open(); //validator.php //A list of valid names. //Again, this would usually come from a database. //echo'<pre>';print_r($_REQUEST);echo'</pre>'; if($_GET['sstring']==""){ //Then return with an error. ?> <span style="color: #FF0000;">Name should not be blank...</span><?php } else if($_GET['themail']=="") {?> <span style="color: #FF0000;">mailid should not be blank...</span> <?php } else if(!ereg ("^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$", $_GET['themail'])) {?> <span style="color: #FF0000;">Email format is incorrect ...</span> <? }else if($_GET['sstring']!="" && $_GET['themail']!=""){ ?><span style="color: #FF0000;">Form would now submit...</span><?php //echo'<pre>';print_r($_GET);echo'</pre>'; $nam=$_GET['sstring']; $ma=$_GET['themail']; $sql="select * from tbl_login where name='$nam' and mail='$ma'"; $result=$db->query($sql)or die($db->error()); $numrows=$db->numRows($result); if($numrows>0) { //header('Location:form2.php'); ?> <!--<script language="javascript"> alert("sss"); window.location.href="form2.php"; </script> <span style="color: #FF0000;">Thanks </span> --> <? } else{?> <span style="color: #FF0000;">Invalid Login</span> <?} } ?>
×
×
  • 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.