138 Posted Topics
What is the difference between following functions? Does these both functions perform same task? $wh_ope=clean($_POST['whop'])?(int)$_POST['whop'] : 0; $wh_ope=(int)clean($_POST['whop']); function clean($str) { $cstr=trim($str); $cstr=addslashes($str); $cstr=strip_tags($str); $cstr=htmlspecialchars($str); return $cstr; } | |
Sir I have following codes to create table <?php function create_table(){ $query = "CREATE TABLE IF NOT EXISTS country ( id INT(6) not null AUTO_INCREMENT PRIMARY KEY, name VARCHAR(30) NOT NULL, reg_date TIMESTAMP)"; $host = "localhost"; $db = "mysql"; $user = "root"; $pass = ""; $conn = mysqli_connect($host, $db,$user, $pass) … | |
Dear Experts I am using windows 7 32bit. I have created database named "accounts" and 2 tables in it through pgAdmin III. The database is working well but I am unable to found it physical location on hard disk. On what path should I find it? Thanks | |
Sir I have these codes <html> <head> <style type="text/css"> #pic { float:left; width: 170px; border: 1px solid red; padding: 1px; text-align: center; font-size:12px; } #pic img { float:left; width: 50px; height: 45px; } </style> </head> <body> <div id="pic"> <p> <img src="https://www.gravatar.com/avatar/ecefb26ed5fc91eca453b31a1f7cdfd8? d=identicon&s=80"> General Manager<br/> Azhar Sharif<br/> 0302-1234567 </p> </div> <body> … | |
Sir I using Gallery Slider from this link http://www.a2zwebhelp.com/jquery-auto-image-rotator It works fine but after sometime Google Chrome displays this error message Either Chrome ran out of memory of or the process for the webpage was terminated for some other reason. How to overcome this error message message. I have these … | |
Sir I have following codes <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title> Test </title> <style type="text/css"> #aboutus { border: 1px solid silver; color: white; font-size: 12pt; width: 250px; margin: 0 auto; background: #F0FFF0; background: url(images/dream2.jpg); background-size: cover; text-align: center; padding: … | |
Sir I have these codes <html> </head> <style type="text/css"> #box1{ width:300px; border:1px solid green; overflow:hidden; margin:0 auto; padding:10px; } th { background:#6495ED; padding-bottom:5px; color:white; } td { border-collapse: collapse; text-align:center; } .format{ padding:5px; background:white; border:1px solid #90bade; } .namebold { color:brown; font-size:12pt; font-weight:bold; text-align:center; font-family: Georgia, "Times New Roman", Times, … | |
Sir I have these codes <!DOCTYPE HTML> <html> <head> <title>Untitled 1</title> <style type="text/css"> #box1 { width:400px; height:60px; padding:5px; border:1px solid blue; margin:50px auto; overflow:auto; } #menu ul li { display:inline; margin:2px; background:khaki; width:150px; height:50px; color:blue; font-size:14px; font-weight: bold; padding: 10px; border-radius: 10px 10px 0 0; } #menu ul li a:hover … | |
Sir I have these codes <html> <head> <title>untitled</title> <style type="text/css"> #box5{ margin:10px; width:250px; height:250px; border:1px solid green; overflow:auto; float:left; background-size:50%; background: url(https://developer.mozilla.org/media/img/mdn-logo.png); background-repeat:no-repeat; background-position:center; padding:20px; opacity: 0.2; } #box5 p{ opacity:1; color:red; font-size:18; font-weight:bolder; } </style> </head> <body> <div id="box5"> <p>This text is normat text over opacity background</p> </div> </body> … | |
Sir I am using these codes <html> <head> <title>untitled</title> <style type="text/css"> #boxA{ float:left; } #boxB{ float:left; } #boxC{ clear:left; } #boxD{ float:left; } #boxA, #boxB, #boxC, #boxD{ border:1px solid green; text-align:center; line-height:100px; margin:10px; width:100px; height:100px; } </style> </head> <body> <p>First Row</p> <div id="boxA">Box A</div> <div id="boxB">Box B</div> <p>Second Row</p> <div … | |
Sir I am using these codes <html> <head> <title>Center dive</title> <style type="text/css"> html body{ margin:0 atuo; margin-top:20px; } #main { margin: 0 auto; background-color: lightgreen; overflow: auto; text-align:center; height:400px; width:400px; color:blue; } #box { display:table-cell; vertical-align: middle height: 200px; width: 200px; background-color:#FFA500; border:1px solid silver; color:blue; font-weight:bolder; font-size:24px; padding:10px; margin:0 … | |
Re: [CODE]Public Sub RunSqlTransaction(myConnString As String) Dim myConnection As New SqlConnection(myConnString) myConnection.Open() Dim myCommand As SqlCommand = myConnection.CreateCommand() Dim myTrans As SqlTransaction ' Start a local transaction myTrans = myConnection.BeginTransaction(IsolationLevel.ReadCommitted, "SampleTransaction") ' Must assign both transaction object and connection ' to Command object for a pending local transaction myCommand.Connection = myConnection … | |
Sir, I am using these codes <?php require_once("connect.php"); if(isset($_POST ['display'])) { $sql="select * from photo where id=2 "; $query=mysqli_query($con,$sql); while($row=mysqli_fetch_array($query)) { $image=$row ['picture']; echo '<img src="upload/'.$image.'" width="50" height="50">'; } } ?> <html> <head> <style type="text/css"> html { overflow:auto; } body{ background-color:#e7f4fe; } #container { margin: auto; position:absolute; top:0;left:0;right:0;bottom:0; background-color:#CFC; padding:10px; … | |
Sir, I am using these codes <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><title>My Contacts</title> <style type="text/css"> html { overflow:auto; } body{ background-color:#e7f4fe; } #container { margin: auto; position:absolute; background-color:#CFC; padding:10px; overflow:auto; width:150px; height:150px; text-align:center; border:1px solid #09F; } .hidden{ display:none; } </style> <body> <div id="container"> <form … | |
Sir, I am using these codes. <script type="text/javascript" src="jquery-1.7.1.min.js"></script> <script type="text/javascript"> function checkEmail() { var email = document.getElementById(xemail); alert(email); var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; if (!filter.test(email.value)) { alert('Please provide a valid email address'); email.focus; return false; } } </script> <tr> <td width="40"><label>Email</label></td> <td width="40"> <input type="text" name="email" id="xemail" value="<?php echo $myemail; … | |
Sir I am using these codes <div id="search"> <label for="filter">Filter</label> <input type="text" name="filter" value="" id="filter" /> </div> <br /> <table cellpadding="2" cellspacing="0" width="90%" id="resultTable"> <thead> <tr> <th> <strong>ID</strong> </th> <th> <strong>Name</strong> </th> <th> <strong>Mobile</strong> </th> <th> <strong>City</strong> </th> <th> <strong>Country</strong> </th> </tr> </thead> <tbody> <?php $sql = "SELECT * from … | |
Sir I am have these codes <?php session_start(); require_once("connect.php"); function clean($str) { $cstr=trim($str); $cstr=addslashes($str); $cstr=htmlspecialchars($str); return $cstr; } if(isset($_POST['login'])) { $myusername=clean($_POST['username']); $mypassword=clean($_POST['password']); if(empty($myusername) || !empty($mypassword)) { echo ('<script>alert("User name or password must not be empty")</script>'); header ("location: login.php"); exit; } else { $query="SELECT * FROM admin where username ='". $myusername … | |
Sir I am using these codes to clear all textboxes in form <script type="text/javascript" src="jquery-1.7.1.min.js"> function clearboxes() { document.getElementById("my_name").value=""; document.getElementById("my_moba").value=""; document.getElementById("my_mobb").value=""; document.getElementById("my_add").value=""; document.getElementById("my_email").value=""; document.getElementById("my_myfax").value=""; document.form1.my_name.focus() ; } </script> Is there any way to run loop to clear all textboxes rather then writinng separte line for every textbox? | |
Sir, i am using these codes <?php $myusername=""; $mypassword=""; $myemail=""; $mymobile=""; $mycountry=""; $mycity=""; $myage=""; $mygender=""; $myphoto=""; if(isset($_POST['save'])){ require_once("connect.php"); function clean($str){ $cstr=trim($str); $cstr=addslashes($str); $cstr=htmlspecialchars($str); return $cstr; } $myusername=clean($_POST['username']); $mypassword=clean($_POST['password']); $myemail=clean($_POST['email']); $mymobile=clean($_POST['mobile']); $mycountry=clean($_POST['country']); $mycity=clean($_POST['city']); $myage=clean($_POST['age']); if(empty($myusername)) { echo ('<script>alert("User name must not be empty")</script>'); echo '<script>document.getElementById("form1.username").focus()</script>'; } elseif (empty($mypassword)) { echo ('<script>alert("Password … | |
Dear Experts, I have following codes $sql = "SELECT * from contacts order by name" ; $select = mysqli_query($con,$sql); $row=mysqli_num_rows($select); //echo ($row); while($row = mysqli_fetch_array($select)) { echo "<tr>"; echo "<td> <a href='edit.php?id=".$row['id']."'> <img border=noborder src=images/pencil.png title=Display></a></td>"; echo "<td align='left'> " . $row["name"]. "</td>"; echo "<td> " . $row["moba"]. "</td>"; echo … | |
Sir, I am using these codes. <script type="text/javascript"> $("#moba").change(function() { var formVal = $("#moba").val(); $.get( "ajax_find.php", { id: formVal } ) .done(function( data ) { $('#my_name').val(data); $('#mobb').val(data); $('#email').val(data); }); }); </script> And ajax_find.php has these codes <?php require_once("connect.php"); if (isset($_GET['id'])) { $sno =trim($_GET['id']); $record_check ="SELECT * FROM contacts WHERE moba … ![]() | |
Sir, I am using these codes if(isset($_POST['update'])) { // Get values from form $name=$_POST['name']; $moba=$_POST['moba']; $mobb=$_POST['mobb']; $ptcl=$_POST['ptcl']; $fax =$_POST['fax']; $email=$_POST['email']; $web =$_POST['web']; $add =$_POST['add']; $city =$_POST['city']; $country =$_POST['country']; $job =$_POST['job']; $office =$_POST['office']; $place =$_POST['place']; $phone =$_POST['phone']; $others =$_POST['others']; if (empty($moba)){ echo "<script>alert('No username is selected')</script>"; }else{ $query = "UPDATE contacts … | |
Sir I have following codes <?php // Connection variables $host = "localhost"; $username = "root"; $password = ""; $db_name = "phonebook"; $con = mysql_connect($host, $username, $password, $db_name); if (!$con) { echo ('<script type="text/javascript">alert("Error Connecting to database")' . mysql_connect_error($con) . '</script>'); } $result = ""; $username = ""; $password = ""; … | |
Sir, I am using these codes <?php if(isset($_POST['login'])){ require_once("connect.php"); session_start(); // username and password sent from Form $myusername=addslashes($_POST['username']); $mypassword=addslashes($_POST['password']); if(empty($myusername) || empty($mypassword)) { echo '<script>alert("User name and password must not be empty")</script>'; }else{ $query="SELECT name FROM admin WHERE mobile='".$myusername."' and password='".$mypassword. "'"; $result=mysql_query($query); if(!$result) { echo "<script>alert('username, password query is … | |
Dear Sir, I am using these codes <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><title>My Contacts</title> <style type="text/css"> html { overflow:auto; } body{ background-color:#e7f4fe; } #container { margin: auto; position:absolute; top:0;left:0;right:0;bottom:0; background-color:#CFC; padding:10px; overflow:auto; width:300px; height:300px; } </style> <body> <div id="container"> <form action="" method="post" enctype="multipart/form-data"> <img align="middle … | |
Re: <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> | |
I am using following codes <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1- transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>My Contacts</title> <style type="text/css"> html { overflow:auto; } body{ background-color:#e7f4fe; } #container { margin:0 auto; background-color:#FFC; padding:10px; overflow:auto; } #header { height:50px; color:#06F; background-image:url(header.gif); background-repeat:no-repeat; font-family:Georgia, "Times New Roman", Times, serif; font-size:32px; font-weight:bold; … | |
Dear Sir, When control enter in any textbox then following codes must run. Please help me what is wrong with my codes <html> <head><title>My Contacts</title> <style type="text/css"> body{ margin-top:100px; margin-left:100px; } </style> <script type="text/javascript"> $(document).ready(function(){ $('input[type="text"]').onfocus(function(){ $('input[type="text"]').css({ "background-color:silver" "font-size:12px" "color:green" }); }); }); </script> </head> <body> <form> <input type="text" name="text1"><br … | |
Dear Sir, I have following codes if(isset($_POST['delete'])) { // Get values from form $sno = $_POST['txtsno']; $pro = $_POST['txtpro']; $wet = $_POST['txtwet']; $query = "delete from test WHERE sno={$sno}" ; $result = mysqli_query($con, $query); if(!$result){ echo "<script>alert('Record not deleted')</script>"; }else{ echo ("<script>alert('Record deleted successfully')</script>"); } } It works fine, but … | |
Dear Sir, I have following codes <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><title>My Contacts</title> <style type="text/css"> body{ margin-top:200px; font-family:Georgia, "Times New Roman", Times, serif; } </style> </head> <body> <center> <img src="Photo96.png"><br/> <a href="">Get Photo</a> </center> </body> </html> It shows this image [IMG]http://i40.tinypic.com/141saa0.jpg[/IMG] I want to upload … ![]() | |
Dear Sir, I have following codes. These code wok fine. Is it possible to get table data with ajax. If yes then please help me to modify my code. Thanks <?php require_once("connect.php"); $productCode = ""; $productValue=""; if(isset($_POST['button1'])) { // Get values from form $sno =$_POST['txtsno']; $record_check ="SELECT * FROM test … ![]() | |
Dear Sir, I have following codes <?php $country=""; $capital=""; if (isset($_POST['submit'])){ $country=$_POST['text1']; $capital=$_POST['text2']; if (empty($country) || empty($capital)){ die ("<script> alert('Please fill both boxes')</script>"); }else{ echo "<script> alert('The capital of $country is $capital')</script>"; } if (isset($_POST['clear'])){ $country=""; $capital=""; } } ?> <html> <head> <title>Result on same page</title> </head> <body> <center> <form … | |
Re: Why do you not post a new thread? | |
Dear Sir, I have following code <html> <head> <title>Javascript function </title> <script type="text/javascript"> function hello(){ var xx=eval(form1.text1.value); var yy=eval(form1.text2.value); if (xx>0 && xx>yy){ alert("Amount 1 is greater") form1.text3.value=("Amount 1 is greater") }else{ alert("Amount 2 is greater") form1.text3.value=("Amount 2 is greater") } } </script> </head> <body onload="form1.text1.focus()"> <center> <h1 style="color:#2c80d3 ">Javascript … ![]() | |
Sir I have following codes <?php if(isset($_POST['button1'])) { $aa = $_POST['text1']; echo ("My name is " . $aa); } ?> <html> <head> <title>First form</title> </head> <body> <form name="aa" action="mix.php" method="POST"> Name<input type="text" name="text1" value=""> <input type="submit" value="display" name="button1"> </form> </body> </html> These codes work fine. I am beginner so I … ![]() | |
Dear Sir, I have following codes <?php require_once("connect.php"); if(isset($_POST['button1'])) { // Get values from form $sno =$_POST['txtsno']; $record_check ="SELECT * FROM test WHERE sno = " . $sno; $result=mysqli_query($record_check); $row = mysqli_fetch_array($result) ; if(!$row) die ('No record Found'); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> … | |
Dear Experts I have following codes <?php if(isset($_get['submit'])) { // Connection variables $host="localhost"; $username="root"; $password=""; $db_name="asia"; // Connect to database $con=mysqli_connect("$host", "$username", "$password"); // Connect result if(!$con){ die('Error Connecting to Database: ' . mysqli_error()); //die '<script type="text/javascript">alert("Error Connecting to Database"). mysqli_error($con);</script>'; } else { echo "<script type=\"text/javascript\">alert(\"Connected\")" . mysqli_error($con) . … | |
Dear I have following codes <?php // Connection variables $host="localhost"; $username="root"; $password=""; $db_name="asia"; // Connect to database $con=mysqli_connect("$host", "$username", "$password"); // Connect result if(!$con){ die('Error Connecting to Database: ' . mysqli_error()); //die '<script type="text/javascript">alert("Error Connecting to Database"). mysqli_error($con);</script>'; } else { echo '<script type="text/javascript">alert("Connected"). mysqli_error($con);</script>'; } // Database Selection $sel … | |
Dear Sir, HTML file has following codes <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Connection Checking</title> </head> <body> <center> <h1>Connection Checker</h1> <fieldset style=width:300px;background-color:#E0FFFF> <legend sytle=font-size:12;>Click Connect</legend> <form name="form1" action="connect.php" method="post"> <table> <tr><td></td><td align="center"><input type="submit" name="button1" value="Connect"> </td></tr> </table> </form> </fieldset> </center> … | |
Dear Sir, I have following codes to save record in MySql. <?php include("connect.php"); $insert_query = "INSERT INTO ghee (sno,pack,weight) VALUES (18,'kk',80)"; $insertion_result = mysql_query($insert_query); //check whether the data insertion was successful if(!$insertion_result) { die("Sorry! Something went wrong.</p>"); } else { echo "<p>Record saved successfully.</p>"; } mysql_close(); ?> These codes work … | |
Sir, I have following codes <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="language" content="english"> <meta http-equiv="Content-Style-Type" content="text/css"> <title>Numeric Textbox</title> <style type="text/css"> body { margin-top:220px; } #bc { background-color:#FFE4B5; } #ft { font-family: "verdana"; font-size:14; font-weight: bolder; color: green; } .bt { width:100px; … | |
Dear Sir, I have following codes <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <title>Numeric Textbox</title> <SCRIPT LANGUAGE="JAVASCRIPT"> //------------------------------------------------------------------ function isNumberKey(evt) { var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57 || charCode == 110)) { alert("Enter … | |
Sir, I have Andriod QMobile Noir A8, I am facing folder problem as: I create new folder and put some applications in it. When I restart my phone then I found that folder empty. All application can be seen outside that folder. What should I do to resolve this issue? | |
Dear sir my html file has following coedes <Html> <head> <title>Add two numbers on same form</title> <body> <center> <h1><font color="blue"> Sum Two Numbers</font></h1> <form name="thisform" method="Get" action="getsum2.php"> <table cellpadding=3 cellspacing=3> <tr> <td>Enter First Number</td><td><input type="Text" name="text1"></td> </tr> <tr> <td>Enter Second Number</td><td><input type="Text" name="text2"></td> </tr> <tr> <td style="color: #ff0000">Result</td><td><input type="Text" name="text2" … ![]() | |
Dear Sir, I have following codes <?php mysql_connect("localhost", "root", "") or die("Connection failed! " . mysql_error()); mysql_select_db("asia"); echo "Connection successful!"; $find_query = "select *FROM ghee where sno=3"; $strSQL = mysql_query($find_query); // Execute the query (the recordset $rs contains the result) $rs = mysql_query($strSQL); // Loop the recordset $rs // Each … | |
Dear Experts How to view PHP files without local host? I need a PHP Viewer software. Please help | |
Dear Sir, Please help me to locate errors in following coedes <html> <head> <title>PHP</title> </head> <body> <?php echo "Your name is:"." $_GET['text1'] </br>; echo "Your city is:"." $_GET['text2'];</br> echo Your mobile is:"." $_GET['text3']; ?> </body> </html> | |
Dear Sir, please see what is wrong with my codes <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Bismillah Cotton</title> <style type="text/css"> .foramt { border-color:green; border-width:2px; border-style:solid; width:200px; height:50px; color:red; font-family:verdana; font-size:14px; font-style:italic; text-align:center; } </style> </head> <body> <div class="format"><p>How are you?</p></div> … | |
Dear Sir, When I try to launch wamp server then it show an error message. Please see error message in following links http://html.net/forums/download/file.php?id=710 http://html.net/forums/download/file.php?id=709 Please help | |
Dear Experts I am using Nokia C2-00 Dual Sim. I connected this device with my pc through USB data cable. Now in device manager it is shown as Nokia C2-00 USB Modem # 2 on port 15. I have inserted two sims and active sim is 1. I am using … |
The End.