Jump to content

Vinodpv

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by Vinodpv

  1. Hello freinds, Here 1st dropdown list not holding its value... CAN U HELP ME... <body> <?php include "db_conexn.php"; ?> <form method="post" name="admin"> <select name="value1" onChange="this.form.submit();"> // 1Ste Drop Down Menu Starts here <?php $result = mysql_query("SELECT distinct(comp_name) from company"); echo("<option value=''>---Select Company Name---</option>"); if(mysql_num_rows($result)) { while($row = mysql_fetch_row($result)) { echo("<option value='$row[0]'>$row[0]</option>"); } } else { echo("<option value=''>No</option>"); } echo "</select>"; ?> <?php if(isset($_POST['value1'])){ // Checks if 1Ste Drop Down menu has a value. $value1=$_POST['value1']; ?> <select name="value2"> //2nd Drop Down Menu Starts here <?php $result = mysql_query("SELECT distinct(branch) from branch where comp_name='$value1'"); if(mysql_num_rows($result)) { while($row = mysql_fetch_row($result)) { echo("<option value='$row[0]'>$row[0]</option>"); } } else { echo("<option value=''>No Data</option>"); } echo "</select>"; ?> <?php }else{ echo "\n"; } ?> </form> </body> drop.php
  2. Hi Freind, Yes getting alert box the values, but incase of one element in the branch(2nd dropdown) in alert box no values, Y like this? If u need I will send full code.. PLEASE HELP ME..
  3. Can u please help me to do this. Y the second drop down box not showing element, if it is one. Onlly the multiple elements are shows in branch
  4. Hi Friends, Here the problem getting like, if I have more than one elements in branch its working. (Display Branches while selecting Company) but if only one branch its coming blank in branch list Please help....I take ......lot of time ... cant find where is the mistake
  5. Connected DropDown List working in Local host not in online-- Please help me any one <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.8.17.custom.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('.userAddress').change(function(){ var company=$('.userAddress').val(); $.ajax({ type:"post", url:"branch.php", data:"company="+company, success:function(data){ $("#branch").html(data); } }); }); </script> <?php $queryComp = mysql_query("SELECT comp_name FROM company"); ?> <tr> <td width="125">Company</td> <td width="10">:</td> <td><select name="company" id="company" style="background:#DFDFFF" class="validate[required] userAddress"> <option>-select your company-</option> <?php include "db_conexn.php"; $result=mysql_query("SELECT comp_name from company order by comp_name"); while($company=mysql_fetch_array($result)){ echo "<option value=$company[comp_name]>$company[comp_name]</option>"; } ?> </select> </td></tr> <tr><td>Branch </td><td>:</td> <td> <select name="branch" id="branch" style="background:#DFDFFF"> <option>-select your branch-</option> </select> </td> </tr> branch.php <?php include "db_conexn.php"; $company=$_POST["company"]; $result=mysql_query("select branch,comp_name FROM branch where comp_name='$company' "); while($branch=mysql_fetch_array($result)){ echo"<option value=$branch[branch]>$branch[branch]</option>"; } ?>
  6. index.php <tr> <td width="125">Access Permission</td> <td width="10">:</td> <td width="175"> <form name="frmMain" action="" method="post"> <input type="text" name="txtSel" id="txtSel" style="background:#DFDFFF"> <input name="btnSelect" type="button" id="btnSelect" value="Click here ...." onClick="javascript:MM_openBrWindow('access_permission.php','pop', 'scrollbars=no,width=500,height=500,left=750')"> </form> </td> </tr> access_permission.php <script language="javascript"> function selValue() { var val = ''; for(i=1;i<=frmPopup.hdnLine.value;i++) { if(eval("frmPopup.Chk"+i+".checked")==true) { val = val + eval("frmPopup.Chk"+i+".value") + ','; } } window.opener.document.getElementById("txtSel").value = val; window.close(); } </script> <form id="frmPopup" action="" method="post" name="frmPopup"> <?php include "db_conexn.php"; if($_SESSION['designation'] == 'Manager') { $selectQuery = mysql_query("SELECT * FROM navigation"); if(mysql_num_rows($selectQuery)>0){$i=0; echo ' <tr>'; while($row = mysql_fetch_object($selectQuery)){$i++;?> <?php if(($i%2)==0){echo '</tr><tr>';}?> <div style="width:200px; float:left;"><input name="permission[]" type="checkbox" class="validate[minCheckbox[1]] checkbox" id="Chk<?=$i;?>" value="<?php echo $row->id;?>" ><span style="font-size:12px;"> <?php echo $row->name;?></span></div> <?php //if(($i%2)==0){echo ' </tr>';} } } ?> <input name="hdnLine" type="hidden" value="<?=$i;?>"> <br> <input name="btnSelect" type="button" value="Select" onClick="JavaScript:selValue();"> </form> ................................................................................................................................................. Here I can select all check box value from db, Please help me to display checked check boxes for edit page
  7. index.php <tr> <td height="31">logo Upload </td><td><input type="file" name="image" /></td> </tr> db.php $image_dir = 'imagess/'; $image_name=mysql_real_escape_string($_FILES["image"]["name"]); $image_path = $image_dir . $image_name; if(!move_uploaded_file($_FILES["image"]["tmp_name"], $image_path)) { echo 'Unable to move '.$_FILES["image"]["name"].' to '.$image_dir; } else{ $insert = mysql_query("INSERT INTO `company`(comp_name,comp_address,branch,user_from,photo) VALUES ('$compName','$compAddress','$branch','$sub','$image_name')"); } This is my working code .. image will save in database and folder, Can u please help me for updation image using update query . And display this image ...
  8. thank you friend it is working good, image is uploading in folder and database both. Can u please tell me how to display it
  9. Hi, Below is my image browse upload code , here I can insert image in database, but it is dispaly only icon instead of image, Please help me to display image...many many thanks in advance index.php <!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>Logo Upload here..</title> </head> <body> <form action="index.php" method="post" enctype="multipart/form-data"> <label>Product Name</label> <input type="text" name="pname" /> <label>Product image</label> <input type="file" name="image" > <input type="submit" name="submit" value="Add Logo"> </form> <?php include "db_conexn.php"; if(!isset($_FILES["image"]["tmp_name"])) echo "Please select an image.."; else { $image=addslashes(file_get_contents($_FILES["image"]["tmp_name"])); $image_name=addslashes($_FILES["image"]["name"]); $image_size=getimagesize($_FILES["image"]["tmp_name"]); if($image_size==FALSE) echo "It is not an image"; else { $insert=mysql_query("insert into images values('','$image_name','$image')"); echo "<img src='uploadsql.php'>"; } } ?> </body> </html> uploadsql.php <html> <body> <?php $result=mysql_query("select * from images"); while($row=mysql_fetch_array($result)) { header("Content-Type:image/jpeg"); $image=$row['image']; echo $image; } ?> </html> table table : images id name image 26 Chrysanthemum.jpg [bLOB - 858.8 KiB]
×
×
  • 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.