Jump to content

vikaspa

Members
  • Posts

    74
  • Joined

  • Last visited

Everything posted by vikaspa

  1. Dear All I tacked this issue in following manner when php read a cell that stores "TRUE" or "FALSE" suppose php variable $a1 stores cell A:1<TRUE> php variable $a2 stores cell A:2<FALSE> in this case a1=1 when it gets ($a1 php value) value "TRUE" and a2(cell A:2 value) will have value NULL ($a2 php value) ------------------------------------------------------- php variable $a2 stores cell A:1<TRUE> php variable $a1 stores cell A:2<FALSE> if ( ($a2=='') or ($a2==' ') or ($a2=='')) // check for false and oter variable eis true { $a2='FALSE'; $a1='TRUE'; } php variable $a2 stores cell A:1<FALSE> php variable $a2 stores cell A:2<TRUE> in this case a2=1 when it gets value "TRUE" and a2(cell A:2 value) will have value NULL ------------------------------------------------------- if ( ($a1=='') or ($a1==' ') or ($a1=='')) ) // check for false and other variable true { $a1='FALSE'; $a2='TRUE'; }
  2. Dear All Using following code We can read data properly except when cell value stored is “TRUE” or “FALSE” I get 1 and blank I want TRUE or FALSE as text and not logical operator How to read / get only values stored in cell My code include(‘PHPExcel-develop/Classes/PHPExcel/IOFactory.php’); try { $objPHPExcel = PHPExcel_IOFactory::load($inputFileName); } catch(Exception $e) { die(‘Error loading file "’.pathinfo($inputFileName,PATHINFO_BASENAME).’": '.$e->getMessage()); } $allDataInSheet = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true); $arrayCount = count($allDataInSheet); // the to get cell data $excelsrno=trim($allDataInSheet[$i][“A”]); $q= trim($allDataInSheet[$i][“B”]); $a1= trim($allDataInSheet[$i][“C”]); $a2= trim($allDataInSheet[$i]["D"] ); $a3= trim($allDataInSheet[$i]["E"] ); $a4= trim($allDataInSheet[$i]["F"] ); $a= preg_replace('/[^0-9]/', '', trim($allDataInSheet[$i]["G"])); $level=trim($allDataInSheet[$i]["H"]); $marks=trim($allDataInSheet[$i]["I"]);
  3. I tried the reverse part when timing is blank, uncheck the checkbox however let weekday = $(".weekday[data-id="+id+"]") ; ==> I am getting this undefined pls help code $('.timing').blur(function() { let id = $(this).data("id") let timing=$(this).text().trim(); //text stored in timing console.log('timing text ='+timing); // display the text stored in timing let weekday = $(".weekday[data-id="+id+"]") ; // find timing input with same data-id value // i am getting weekday as unefined console.log( 'timing blur weekday '+weekday ); // timing blur weekday [object Object] if (timing =='') // text is blank { $(weekday).prop('checked', true);// set checkbox checked } }); else { $(weekday).prop('checked', false);// set checkbox un-checked } });
  4. <input name="weekday[8]" type="checkbox" value="21" class="weekday" checked=""> <input name="timing[8]" type="text" id="name" value="11" size="45" /> <input name="weekday[9]" type="checkbox" value="99" class="weekday" checked=""> <input name="timing[9]" type="text" id="name" value="12" size="45" /> <input name="weekday[10]" type="checkbox" value="77" class="weekday" checked=""> <input name="timing[10]" type="text" id="name" value="13" size="45" /> I have above html code 1. when checkbox for checkbox name="weekday[8]" is clicked, I want to check whether timing[8] is empty or not (we need to derive field name timing[8] from field name weekday[8] 2. when timing[8] some value is entered , i want to name="weekday[8]" -> checked (we need to derive field name weekday[8] from timing[8] we can find the name (jquery) $('.weekday').click(function(){ var checkboxname=$(this).attr('name'); // we get checkbox clicked name=name[8] console.log('checkbox name='+checkboxname); }) In simple case (without dimension) this is easy we get name of field (checkbox is clicked) as name[8] i want to derive field name timing[8] i tried (jquery) $('.weekday').click(function(){ var checkboxname=$(this).attr('name'); console.log('checkboxname='+checkboxname);// i got this correct weekday[8] in this case var splitname=checkboxname.split('weekday');// seperated [8] , console.log(splitname[0]+' 1='+splitname[1]); //splitname[1] will have [8] //now want to form or generate value of variable mobile[8] var n='mobile'+splitname[1];//the n will be mobile[8] console.log('n='+n);// ths will be mobile[8] var inp=$('input[name="'+n+'"]').val(); console.log(' inp='+inp);// but no success //here I want value of $('input[name=name[8]').val(); }) Please guide how i derive (using jquery) filed name mobile[8] from filed name[8]
  5. I really appreciate prompt reply As specified by you I am getting values for $_POST['weekday'][$i] code do { //reading weekday table and assigning id as index ?> <tr> <td class='text15' > <input name="weekday[<?php $rows['id'];?>]" type="checkbox" value="<?php echo $rows['id'];?>" class='weekday' /> <?php echo $rows['name'] ;?> <br>Timing <input type="text" name="timing[<?php $rows['id'];?>]" class='timepicker timing' /> </td> </tr> <?php } while ($rows=$query->fetch()); ?> after submit $cntr=count($_POST['weekday']); echo "weekday count=".count($_POST['weekday']); echo "timing count=".count($_POST['timing']); for($i=8; $i < 18 ; $i++) { echo "<br>".$i." Loop Week day =>". $_POST['weekday'][$i]." timing =>". $_POST['timing'][$i]; } output weekday count=5 8 Loop Week day => timing => 9 Loop Week day =>9 timing => 10 Loop Week day =>10 timing => 11 Loop Week day =>11 timing => 12 Loop Week day =>12 timing => 13 Loop Week day =>13 timing => 14 Loop Week day => timing => 15 Loop Week day => timing => 16 Loop Week day => timing => 17 Loop Week day => timing => We get the values for weekday[9], weekday[10], weekday[11], weekday[12], weekday[13] ------------------------------------------------------------ but not getting any values for timing[9], timing[10], timing[11], timing[12], timing[13] pls help
  6. Dear All I am accepting following 2 field in a form one is checkbox and another is input <input name="weekday[]" type="checkbox" value="<?php echo $rows['id'];?>" class='weekday' /> <?php echo $rows['name'] ;?> <br>Timing <input type="text" name="timing[]" ' class='timepicker ' /> the form look like this (refer image) after submit i can get checkbox value After submit I tried $cntr=count($_POST['weekday']); for($i=0; $i < $cntr=count($_POST['weekday']) ; $i++) { echo "<br>".$i." Loop Week day =>". $_POST['weekday'][$i]." timing =>". $_POST['timing'][$i]; // Addcenterdaystime($staffcompanyid, $newid, $_POST['weekday'][$i], $_POST['timing'][$i] ) ; } However could not get values of timing pls help
  7. Dear Sir if (version_compare(PHP_VERSION, '5.3', '>=')) { error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED); } else { error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE); } I want to know whether this code DONOT ALLOW execution in case PHP verson is > 5.3 and above complete code switch (ENVIRONMENT) { case 'development': error_reporting(-1); ini_set('display_errors', 1); break; case 'testing': case 'production': ini_set('display_errors', 0); if (version_compare(PHP_VERSION, '5.3', '>=')) { error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED); } else { error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE); } break; default: header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); echo 'The application environment is not set correctly.'; exit(1); // EXIT_ERROR }
  8. Dear GIZMOLA Thanks a TON for the reply. I will check this and revert
  9. Dear All Code generated from https://github.com/dompdf/dompdf/issues/2481 I am using dompdf 2.0 Main program to create pdf https://prajaktasoftware.com/onlineexam/vendor-special-message.php <- input html file forms input to generated PDF https://prajaktasoftware.com/onlineexam/testfont-1.php <- program that generates pdf using above program I am using dompdf (testfont-1.php) the output generated shows ??? characters pls help <?php ob_start(); include 'vendor-special-message.php'; // pdf generatef from this file $_template = ob_get_clean(); require( 'dompdf/autoload.inc.php'); use Dompdf\Dompdf; $dompdf=new Dompdf(); //$dompdf->loadHtml($_template, "UTF-8"); $dompdf->loadHtml($_template, "UTF-8"); $dompdf->setPaper("A4", "portrait"); $dompdf->set_option('isFontSubsettingEnabled', true); $dompdf->set_option('defaultMediaType', 'all'); $dompdf->set_option('isRemoteEnabled', true); $dompdf->render(); $dompdf->stream( time() . ".pdf", array("Attachment" => false)); // $dompdf->stream(); // stream the pdf in browser exit; ?> vendor-special-message.php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; UTF-8"> <style> @import url('https://fonts.googleapis.com/css2?family=Hind:wght@300&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200&display=swap'); div {font-family: 'Hind', sans-serif;} body { font-family: 'Oswald', sans-serif } </style> </head> <body> <p>Happy Birthday</p> <p>Happy Birthday</p> <p>Happy Birthday</p> <div>सभ मानव जन्मतः स्वतन्त्र अछि तथा गरिमा आʼ अधिकारमे समान अछि। सभकेँ अपन–अपन बुद्धि आʼ विवेक छैक आओर सभकेँ एक दोसराक प्रति सौहार्दपूर्ण व्यवहार करबाक चाही।</div> </body> </html>
  10. Dear All Can I display display url http://www.mywebsite.com/abcd.php?id=1 as http://www.mywebsite.com/abcd.php/1 or http://www.mywebsite.com/contact.php as http://www.mywebsite.com/contact pls help
  11. Dear All I am trying to seperate the rows from a table (html) in order to do this as a 1st step I am doing $str1 = preg_replace('/<tr >/', "<tr>", $str1); $str1 = preg_replace('/<td >/', "<td>", $str1); so that all <tr > will become <tr> .. removing space and <td > will become </td>.. removing spaces As a next step I am trying $str1 = preg_replace('/<tr> <td>/', "\n", $str1); replace start of row with \n i.e. new line feed But it doesnot work pls help <tr> <td> दिनांक</td> <td> वार</td> <td> मास</td> <td> कृष्ण / शुक्ल</td> <td> तिथी</td> <td> वार</td> <td> यात्रा/जत्रा/ ऊरुस/ उत्सव/ जयंती/ पुण्यतिथी</td> <td> ठिकाण</td> <td> तालुका जिल्हा</td> </tr> I have Unicode data ..whether the unicode data is an issue or something else Pls help no replacements are made
  12. Dear All I have unicode data in following sheet https://docs.google.com/spreadsheet/ccc?key=0AnL8C-M5yG2odEtqanRNSTBGdGZubk81dFQzUEdqOEE#gid=0 This data is in Devnagari I tried to save as (download as from this data sheet - comma separated values) and then upload data But when i read the data, I am getting junk characters .... in short could not read data in the font seen in this file
  13. <html> <head> <title>the title</title> <script type="text/javascript" src="javascript/jquery-1.4.2.js"></script> <script type="text/javascript" language="javascript"> $(document).ready(function() { $("#driver").click(function(event){ $('#stage').load('contactus.php'); }); $("#stage").click(function(event){ $('#stage').load('photogallery.php?cid=36&&subcid=48'); }); }); </script> </head> <body> <p>Click on the button to load result.html file:</p> <div id="stage" style="background-color:blue;"> STAGE </div> <input type="button" id="driver" value="Load Data" /> </body> </html> I tried this ajax the contactus.php is getting loaded however the link with parameters photogallery.php?cid=36&&subcid=48 show blank page please help
  14. Dear All Salute to this forum .... Please refer following link http://m2k-education.com/a001.php This link displays a video in videobox.js & videoboox.css The video file name is used in link ..on click the said video is opened up like 'lightbox' I want to avoid using video name in link instead want to pass the id of the video to ajax which will open up this video Can i do this ? Please please help Thanks in advance 18664_.php
  15. Dear All need help in ajax-PHP i am using following code to display video. <a href="<?php echo $vrows['image1'] ; ?> " rel="vidbox" title="<?php echo $vrows['name']."<br>".nl2br($rows['detail']) ; ?>" id="m5"><?php echo $vrows['name'].$vrows['id'] ; ?></a> However using right click one can download the video (which client donot want to happen) I am thinking of using AJAX in following manner (this may be different so as to use AJAX) Note: I tried disabling of right click but it doesn't work chrome This is what i want to happen using AJAX on click the link will pass value of row id (INSTEAD OF FILE NAME) AND WE NEED TO open the video in videobox
  16. I found this code most useful ... however, can we display countdown time ... please help
  17. I am puttting following code in text area (which is nothing but you-tube embed code <iframe width="425" height="349" src="http://www.youtube.com/embed/wDPZuRLIV70" frameborder="0" allowfullscreen></iframe> When submit is clicked it gives error (image attached) You dont have permission to acccess xxx.php xxx.php is nothing but the program file My insert script is as follow $insert=sprintf("INSERT INTO youtube( id, status, srno, name, detail , code ) VALUES ('', %s, %s, %s, %s , %s )", GetSQLValueString($_POST["status"], "int"), GetSQLValueString($_POST["srno"], "int"), GetSQLValueString(addslashes($_POST["name"]), "text"), GetSQLValueString(addslashes($_POST["detail"]), "text"), GetSQLValueString(addslashes($_POST["code"]), "text")); which works (Inser quesry) alright in case i enter normal text like "abcd " insted of <iframe width="425" height="349" src="http://www.youtube.com/embed/wDPZuRLIV70" frameborder="0" allowfullscreen></iframe> refer page for error please help [attachment deleted by admin]
  18. Dear xyph thanks for valuable tip as per fugix, dreamhost will be ideal web host to go for ... any other recommendations are welcomed .. this will be most useful for many developers of this forum salute !!
  19. Can i state here that I appreciates the views exchanged from solution point of view customization of php.ini (php5.ini in case of PHP5 as per fugix thanks for this valued information) and .htaccess is a must
  20. dear all Pls help me to upload video files of size more than 40 MB I noticed that for this we need to change values in php.ini or .htaccess file Many hosting companies do that allow to change these values pls help me to get web hosting company who will allow to change these parameters (i dont mind taking up reseller p[lan) and parameters we need to change Thanks you in advance
  21. I tried another code Got following error Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 10368 bytes) in /home/savarkar/public_html/resizedirimages.php on line 16 how can i fix this up Please please help .. code is attached [attachment deleted by admin]
×
×
  • 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.