Jump to content

Sajesh Mohan

Members
  • Posts

    29
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Sajesh Mohan's Achievements

Member

Member (2/5)

0

Reputation

  1. i am creating a plugin in wordpress. that need a file uploading option. i use this code <a onclick="return false;" title="Upload image" class="thickbox" id="add_image" href="media-upload.php?type=image&TB_iframe=true&width=640&height=105">Upload Image</a> need to append your Hyperlink to media-upload.php to really make it working ? my issue is that how to get the value to my textbox. but insert to post option is missing <form action="insert_logo.php" method="get" id="post" name="post"> <table width="770" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="4"> </td> </tr> <tr> <td> </td> <td colspan="3"><h3>Add Client Logo</h3></td> </tr> <tr> <td colspan="4"> </td> </tr> <tr> <td width="76" height="34"> </td> <td width="75">Logo</td> <td width="145"><input name="client_logo" id="name="client_logo"" type="text" /></td> <td width="474"><a onclick="return false;" title="Upload image" class="thickbox" id="add_image" href="media-upload.php?type=image&TB_iframe=true&width=640&height=105">Upload Image</a> </td> </tr> <tr> <td> </td> <td>Url</td> <td><input name="name=" id="name=2"client_logo"" type="text" /></td> <td>[Eg: http://www.sitename.com]</td> </tr> <tr> <td> </td> <td> </td> <td><p class="submit"><input name="addlogo" type="submit" id="addlogo" class="button-primary" value="Submit" /></p></td> <td> </td> </tr> <tr> <td colspan="4"> </td> </tr> </table> </form>
  2. $file="../myclients/clients/".$company_name."/Download/".$file_name; $size = filesize($path); // not working i try with function also function formatbytes($file, $type) { switch($type){ case "KB": $filesize = filesize($file) * .0009765625; // bytes to KB break; case "MB": $filesize = (filesize($file) * .0009765625) * .0009765625; // bytes to MB break; case "GB": $filesize = ((filesize($file) * .0009765625) * .0009765625) * .0009765625; // bytes to GB break; } if($filesize <= 0){ return $filesize = 'unknown file size';} else{return round($filesize, 2).' '.$type;} } echo formatbytes($file, "KB"); uploaded file size is 488 kb but it showing "unknown file size" please help me.
  3. my issue is to show preview of a form. the form will have a fck editor . this form is used to update a table. i need to show a preview button on this page and when we click on it should show the preview of the content. i am attaching my code. my problem is this is a update page fck value is taken from Dn "$desc" . when do some changes on editor then i click on preview button should show the changes, here showing only the $dec value from DB not the value i change. <?php session_start(); $uname=$_SESSION['usname']; include("dbconnect.php"); $admin_qry="select * from st_admin where admin_username='$uname'"; $res=mysql_query($admin_qry); $admin_res=mysql_fetch_array($res); $level=$admin_res['level']; include("status.php"); ?> <script language="javascript" src="ajax/ajax.js"></script><?php $pos=$_REQUEST['pos2']; $getqry="select * from st_aboutus where categorys='$pos'"; $resr=mysql_query($getqry); $row=mysql_fetch_array($resr); $cat=$row['categorys']; $img=$row['st_img']; //$description=$row['st_content']; $desc=stripslashes($row['st_content']); $file_name=$row['file_name']; $id=$row['st_id']; ?> <script language="javascript"> function popUpPreview() { // Display a new browser for the user var w = screen.availWidth / 2 - 450; var h = screen.availHeight / 2 - 320; var win = window.open('aboutus-prewiew.php', 'payPopupMain', 'width=900,height=650,left='+w+',top='+h+',scrollbars=1'); } </script> <link href="../css/style.css" rel="stylesheet" type="text/css" /> <form name="sform" id="sform" action="update_aboutus.php" method="post"> <table width="679" height="323" border="0" align="center" cellpadding="0" cellspacing="0" > <tr> <td colspan="5" height="40" align="left" class="page_head" valign="top"> </td> </tr> <tr> <td align="left" class="textfont"> </td> <td align="left" class="textfont"> </td> <td height="40" align="left"> </td> <td height="40" align="left" class="normaltext"><?php if($level=="dataentry" ){} else {echo " Status " ; } ?></td> <td align="left"><span style="padding-left:10px;"> <?php if($level=="dataentry" ){} else { showStatus('st_aboutus','st_id','status',$id) ; } ?> </span></td> </tr> <tr> <td width="170" align="left" class="textfont"> </td> <td width="8" align="left" class="textfont"> </td> <td height="40" colspan="3" align="left"><?php echo $message=$_GET[msg]; ?></td> </tr> <tr> <td height="19" class="listitem" align="right"> </td> <td class="listitem" align="left"> </td> <td height="19" align="left" class="listitem1">Image Size 274 X 420</td> <td colspan="2" align="left"></td> </tr> <tr> <td height="71" class="listitem" align="right">Add Image</td> <td class="listitem" align="left"> </td> <td width="236" height="71" align="left"><input name="logo" type = "text" id="logo" value="<?php echo $img; ?>" size="20" readonly="readonly" class="txtbox" /> <img src="../images/attach.gif" onClick="attachment('logo','logoimage')" class="imagebutton12" /> <img src="../images/remove.gif" onClick="removeattachment('logo','logoimage')" class="imagebutton12" /></td> <td width="265" colspan="2" align="left"><img src="<?php if($img) {echo "aboutus/".$img; } else { echo "../images/photo.gif "; } ?>" width="67" height="62" name="logoimage8" id="logoimage" /> <input type="hidden" name="image1_hiid" id="image1_hiid" value="<?php echo $img; ?>" /></td> </tr> <tr> <td colspan="5" align="left" class="optimumSize" valign="bottom"><!--Optimum size of image is 120 X 105 --></td> </tr> <tr> <td height="10" colspan="2" class="textfont"> </td> <td height="10" colspan="3"><?php include("../FCKeditor/fckeditor.php"); $oFCKeditor = new FCKeditor('desc') ; $oFCKeditor->BasePath = '../FCKeditor/'; /* $oFCKeditor->Value =stripslashes(substr($intro,0,500));*/ $oFCKeditor->Value = $desc; // here we can give size of editor as $oFCKeditor->Width = '600' ; $oFCKeditor->Height = '250' ; $oFCKeditor->Create() ; ?></td> </tr> <tr> <td height="27" align="right" class="listitem"> </td> <td height="27" class="textfont"> </td> <td height="27" align="left" valign="bottom"><span class="listitem1"><?php /*?><?php if($pos!="management" ){} else {echo " Only Upload ".pdf" file";} ?><?php */?></span></td> <td height="27" colspan="2" align="left"> </td> </tr> <?php /*?><?php if($pos!="management" ){} else {echo " <tr> <td height='68' align='right' class='listitem'>Update pdf</td> <td height='68' class='textfont'> </td> <td height='68' align='left'> <input name='logo1' type = 'text' id='logo1' value='$file_name' size='20' readonly='readonly' class='txtbox' /> <img src='../images/attach.gif' onclick=\"attachment('logo1','logoimage1')\" class='imagebutton12' /> <img src='../images/remove.gif' onclick=\"removeattachment('logo1','logoimage1')\" class='imagebutton12' /></td> <td height='68' align='left'><img src=\"aboutus/$file_name\" width='67' height='62' name='logoimage1' id='logoimage1' /></td> </tr> ";} ?><?php */?> <tr> <td height="36" colspan="2"><input type="hidden" name="des" id="des" value="<?php echo $img; ?>" /></td> <td align="left"><input name="preview" type="button" onclick="return popUpPreview();" value="Preview"/></td> <td colspan="2"> </td> </tr> <tr> <td colspan="2"><input type="hidden" name="id" value="<?php echo $id; ?>"><input type="hidden" name="pos" value="<?php echo $pos; ?>"> <input type="hidden" name="image1_hiid1" id="image1_hiid1" value="<?php echo $file_name; ?>" /></td> <td align="left"> <input type="image" name="image" value="Submit" src="../images/submit.gif" alt="Login Details" title="Submit" onclick="return fieldcheck(this.form);"></td> <td colspan="2"> </td> </tr> <tr><td colspan="5" height="10"></td></tr> </table> </form> aboutus-prewiew.php <script type="text/javascript"> document.write(opener.document.sform.logo.value); document.write(opener.document.sform.desc.value); // this value only showing from the database ,i need to get the value to show preview </script>
  4. http://jqueryui.com/demos/tabs/ check this page or use ajax on the button when we click on the image
  5. can u try if(mysql_num_rows($result) == '1')
  6. in Magento shoping cart how to pass the variable values to a jsp page?
  7. i wanto create a new payment module on magento shoping cart. how to do thanks in advance
  8. if(document.sform.chec.checked == false) { alert("Please Accept I Agree Check Box"); document.sform.chec.focus(); return false; }
  9. the code is correct and working me correctly. <?php $conn = mysql_connect("localhost", "root", "");//ignore this xD if (!$conn) { echo "Unable to connect to the database : " . mysql_error(); exit; } if (!mysql_select_db("salhia_arabic")) { echo "Unable to select database mydbname : " . mysql_error(); exit; } $sql = 'SELECT * FROM st_admin'; $result = mysql_query($sql); if (!$result) { echo "Unable to execute query ($sql) in the database : " . mysql_error(); exit; } if (mysql_num_rows($result) == 0) { echo "No rows found, nothing to display."; exit; } while ($row = mysql_fetch_assoc($result)) { echo $row["admin_username"]; } mysql_free_result($result); ?>
  10. if any body copy and paste anything from word to editor some unwanted css also coming with that pasting. when we request the data same css also coming with that. so how to clean data when we request $desc =$_request['contents']; how to solve this issue. please help me.
  11. if any body copy and paste anything from word to editor some unwanted css also coming with that pasting. when we request the data same css also coming with that. so how to clean data when we request $desc =$_request['contents']; how to solve this issue. please help me.
  12. how to copy a full folder from source to destination using php please help me.
  13. on which language you want to show on site. u should specify <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> on the top of the page + use unicode fonts also.if you use arabic language by default it will taken. other wise u should use unicode fonts. second way use font face in css and keep the font on the server and specify the fontname .
×
×
  • 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.