Jump to content

gaya

Members
  • Posts

    101
  • Joined

  • Last visited

Posts posted by gaya

  1. My code is not working. Please help me by giving some sample code to restrict the digit in the textbox with backspace working.Otherwise please tell me what else the changes to be made in the above code.

  2. The following is my code.

    function noAlphabets(evt,val) {var no=val;		  var charCode = (evt.which) ? evt.which : event.keyCode;		   if (charCode != 46 && charCode!=8 && charCode > 31  && (charCode < 48 || charCode > 57 )  )    {			 return false;    }else{if ((/^[1-4]/.test (val))) {//alert ("No should be within 1 character");return false;}}}<td>correct Answer<font color="red">*</font></td><td>:</td>   <td><input type="text" name="corr_ans" id="corr_ans"  size="16" onkeypress="return noAlphabets(event, this.value)"></td>

    the backspace key is not working.Please anyone help me. I dont know what i'm doing wrong here.

  3. Hi, My form is having fields like year, pageno,chapterno,standard and correct answer. I have written the script

    function isNumberKey(evt , val)	   {    var no=val;		  var charCode = (evt.which) ? evt.which : event.keyCode;		   if (charCode != 46 && charCode!=8 && charCode > 31  && (charCode < 48 || charCode > 57 )  )    {			 return false;    }   else    {	 if (no.length < 4)	 {	 return true;	 }    else if(no.length ==4)	 {	 alert("No should be within 4 characters");	 return false;	 }    else	 {	 return false;	 }    }		  return true;	   }

    But for correct answer i need to restrict input to one of the digits 1, 2 ,3 or 4. please tell me how to do this with another function.

  4. I'm doing a code for creating question bank for all subjects. I've dont the coding for 6different question type,like fillup,choose etc.In future, if any more new question type is added by admin,the page should not be viewed empty. Just it should show an imge like page is under construction.so i'm trying to create a empty php file and the img code sholud be written in that php file using fopen() & fwrite(). This is what i'm trying to do.

  5. <form accept-charset="utf-8" action="a.php" method="post" name="choose" enctype="multipart/form-data" onSubmit="return validate();"><table align="center" border="1" width="850" height="500" bgcolor="FFF5EE" ><tr><td><table align="center" bgcolor="">  <tr><td align="center" colspan="10"><img src="img/laugh.gif" alt="Smiley" /></td></tr>  <tr><td align="center" style="color:#FF0000; text-decoration:blink;" colspan="10" ><b><?php echo $qtype2;?></b></td></tr>  <tr><td colspan="10"> </td></tr>   <tr>   <td>   Question<font color="red">*</font>   </td>   <td>   :   </td>     <td><textarea name="ques1" id="ques1" cols="25" rows="5" style="resize:none;"></textarea>   </td>   <td>	<table>	<tr>	<td width="10">	<div style="background-image:url(img/mic1_30.jpg); width:30px; height:25px;" >	<input type="file" id="quest_wav1" name="quest_wav1"  style="opacity:0;-moz-opacity:0 ;filter:alpha(opacity: 0);" size="1"  />	</div>	</td>	</tr>	<tr>	<td width="10">	<div style="background-image:url(img/img1.jpeg); width:30px; height:30px;" >	<input type="file" id="quest_img1" name="quest_img1"  style="opacity:0;-moz-opacity:0 ;filter:alpha(opacity: 0);" size="1"   />	</div>	</td>	</tr>	</table>   </td>   <td> </td>    </tr>  <tr>   <td>Page No<font color="red">*</font></td><td>:</td>   <td><input type="text" name="pno" id="pno"  size="16" onkeypress="return isNumberKey(event, this.value)"/></td>   <td> </td>   <td> </td>   <td>Chapter No<font color="red">*</font></td><td>:</td>   <td><input type="text" name="cno" id="cno" size="16"  onkeypress="return isNumberKey(event, this.value)"/></td>   <td> </td>   <td> </td>  </tr>  <tr>   <td>Board</td><td>:</td>   <td><input type="text" name="board_txt" id="board_txt" size="16" readonly="" value="<?php echo $boardname; ?>" style="background-color:#FFFFFF;" /></td>   <td> </td>   <td> </td>   <td>Subject</td><td>:</td>   <td><input type="text" name="subject_txt" id="subject_txt" size="16" readonly="" value="<?php echo $subjectname; ?>" style="background-color:#FFFFFF;" />     <input type="hidden" name="language" id="language" value="<?php echo $language_name; ?>" />   <input type="hidden" name="qtype" id="qtype" value="<?php echo $qtype2; ?>" />   </td>   <td> </td>   <td> </td>  </tr>  <tr>   <td>Short Type</td>   <td>:</td>   <td>   <select id="short_type" name="short_type" >   <option value="" selected="selected">----</option>   <option value="Problem" >Problem</option>   <option value="Deleted">Deleted</option>     </select>   </td>   <td> </td>   <td> </td>    </tr>  <tr><td colspan="10">  </td></tr>  <tr>	  <td><font color="#FF0000"><b>Note :</b></font></td>	 <td colspan="2" align="center"><font color="#FF0000">*</font> Mandatory Fields</td>	 <td colspan="3" align="left"><img src="img/mic1_30.jpg" alt="Upload Wave" />Upload WAVE</td>	<td colspan="4" align="left"><img src="img/img1.jpeg" alt="Upload Image" />Upload IMAGE</td>  </tr>  <tr>  <tr><td colspan="10">  </td></tr>   <td colspan="10" align="center">   <input type="submit" name="add" value="Add" style="background-color:#FFFF00; font:Arial, Helvetica, sans-serif; color:#FF0000"/>	   <input type="reset" name="clear" value="Clear" style="background-color:#FFFF00; font:Arial, Helvetica, sans-serif; color:#FF0000"  />   </td>  </tr> </table></td></tr></table></form>

    The above is my formWhat What i want to do is i need to equalise the fields.As the question field nearby is empty space. But the other subject is in right side and board in left side.But no fields is seen nearby question field. Simply i want to fill the space.

  6. In the first mentioned code i simply use the if condition alone. Where i'm creating a new type,i included the code as

     $qtname1="$qtname";	   $var1=fopen("$qtname1".".php","x+");$stringData = "<img src='../uc1.jpg'/>";fwrite($var1, $stringData);fclose($var1);

    In the above code $qtname is the name what i am entering newly to the database,and open the created file name included image using file write. ie)$qtname=a.php.

  7. Is it possible to change the width and height of textarea.If means please tell me how to do that.The following is my code.

    <tr>		    <td>		    Ques:<font color="red">*</font>		   		    </td>		   		    <td><textarea name="ques1" id="ques1" cols="25" rows="5" style="resize:none;"></textarea>		    </td>		    <td>			    <table>			    <tr>			    <td width="10">			    <div style="background-image:url(img/mic1_30.jpg); width:30px; height:25px;" >			    <input type="file" id="quest_wav1" name="quest_wav1"  style="opacity:0;-moz-opacity:0 ;filter:alpha(opacity: 0);" size="1"  />			    </div>			    </td>			    </tr>			    <tr>			    <td width="10">			    <div style="background-image:url(img/img1.jpeg); width:30px; height:30px;" >			    <input type="file" id="quest_img1" name="quest_img1"  style="opacity:0;-moz-opacity:0 ;filter:alpha(opacity: 0);" size="1"   />			    </div>			    </td>			    </tr>			    </table>		    </td>		    <td> </td>		   	    </tr>	    <tr>		    <td>Pno<font color="red">*</font></td><td>:</td>		    <td><input type="text" name="pno" id="pno"  size="16" onkeypress="return isNumberKey(event, this.value)"/></td>		    <td>Cno<font color="red">*</font></td><td>:</td>		    <td><input type="text" name="cno" id="cno" size="16"  onkeypress="return isNumberKey(event, this.value)"/></td>		    </tr> 

    Please tell me i've to increase the size of textarea for the question field only. Please tell me how to do that.

  8. Ya i just want to create a new empty php file like "empty.php". I did it. Now i'm trying to do,by creating that php file, i am trying to show some image.Is that possible.please tell me

  9. for($i=0; $i<6;$i++){if($var[$i]==$str){echo "$str".$var[$i];$strfirstlettercaps = strtolower($str);$var1=$strfirstlettercaps.".php";require_once $var1; }else{$strfirstlettercaps="";$var1=fopen("$strfirstlettercaps".".php","x+");echo "<img src='../uc1.jpg'>";} 

    The loop is checking for both if and else condition. I dont know why.please anyone tell me what i'm doing wrong here.

  10. Thanks justsomeguy. I used the following code and compared the two values.

    for($i=0; $i<6;$i++){if($var[$i]==$str){    echo "welcome----".$str;	    $a=a.php;[/font]} 

    Now i have to include another php file inside the if condition,storing the php file name in a variable like $a=a.php,and when clicking it have to open the corresponding output in which a.php file is needed. Any ideas please tell me.

  11. I found out the solution for this

    $sql="select type from qtype";$result=mysql_query($sql);$var = array();while ($rw = mysql_fetch_array($result)) {  $var[] = $rw['type'];}print_r ($var);

    But now i have to compare the two fields.

    $quer="select type from qtype whereid='$qtype'";$res=mysql_query($quer);if(mysql_num_rows($res)){while($row=mysql_fetch_array($res)){$qtype1=$row[0];}}

    In the above code i take the type corresponding to its id.I have to compare if the type is in the array, and if it is some conditions should be done. please tell me how to do this.

  12. Hi, Please tell me how to store a column from db in array. My table name is qtype, and the fields in table are id & type.

    $sql="select type from qtype";$result=mysql_query($sql);

    I had selected the type from table.There are some 6types in type field, and i have to store all the 6 in array.How shall i do this. Any ideas please tell me.

  13. Yes i've not written for answer button.

    function reply_click(clicked_id){alert(clicked_id);var clicked_id=this.id;}function validate(){/*var a=document.getElementById('1').value;alert(a);var b=document.getElementById('2').value;alert(;*/if(clicked_id=="ques"){alert("hai");var quest1=document.getElementById('ques1').value;var board_txt=document.getElementById('board_txt').value;var subject_txt=document.getElementById('subject_txt').value;var cno=document.getElementById('cno').value;var pno=document.getElementById('pno').value;short_type=document.getElementById('short_type');short_type1=short_type.options[short_type.selectedIndex].value;quest1=trim(quest1);board_txt=trim(board_txt);subject_txt=trim(subject_txt);pno=trim(pno);cno=trim(cno);if(quest1==""){alert("Please enter Question");document.getElementById('ques1').focus();return false;}else if (board_txt==""){alert("Please Select Board");document.getElementById('board_txt').focus();return false;}else if (subject_txt==""){alert("Please Select Subject");document.getElementById('subject_txt').focus();return false;}else if( pno==""){alert("Please enter valid Page No");document.getElementById('pno').focus();return false;}else if (cno==""){alert("Please Select Chapter No");document.getElementById('cno').focus();return false;}}else if(clicked_id=="ans"){alert("hhh");var stmt1=document.getElementById('stmt1').value;}}

    But now its seems like when clicking answer button, it doesnt come to the elseif condition.I dnt knw wat i did wrong in that part. please tell me.

  14. as replied, what's the problem? Where is your javascript code? What are you stuck on?
    My javascript is
    function reply_click(clicked_id){alert(clicked_id);var clicked_id=this.id;}function validate(){/*var a=document.getElementById('1').value;alert(a);var b=document.getElementById('2').value;alert(;*/if(clicked_id=="ques"){alert("hai");var quest1=document.getElementById('ques1').value;var board_txt=document.getElementById('board_txt').value;var subject_txt=document.getElementById('subject_txt').value;var cno=document.getElementById('cno').value;var pno=document.getElementById('pno').value;short_type=document.getElementById('short_type');short_type1=short_type.options[short_type.selectedIndex].value;quest1=trim(quest1);board_txt=trim(board_txt);subject_txt=trim(subject_txt);pno=trim(pno);cno=trim(cno);if(quest1==""){alert("Please enter Question");document.getElementById('ques1').focus();return false;}else if (board_txt==""){alert("Please Select Board");document.getElementById('board_txt').focus();return false;}else if (subject_txt==""){alert("Please Select Subject");document.getElementById('subject_txt').focus();return false;}else if( pno==""){alert("Please enter valid Page No");document.getElementById('pno').focus();return false;}else if (cno==""){alert("Please Select Chapter No");document.getElementById('cno').focus();return false;}}else if(clicked_id=="ans"){alert("hhh");var stmt1=document.getElementById('stmt1').value;}}

    When clicking the answer button it didnt come the elseif condition.

  15. ok. Then please tell me. I'm having a form with two buttons.

    <input type="submit" name="question" id="1" value="question" onclick="reply_click(this.id)" /><input type="submit" name="answer" id="2" value="answer" onclick="reply_click(this.id)" />

    I've to write the javascript by checking the conditions for both buttons sepeately in one validate function.

  16. ya sure. The following is my form and script

    <form action="a.php" method="post" name="choose" onSubmit="return validate();"><table align="center" border="1" width="850" height="500" bgcolor="FFF5EE" ><tr><td><table align="center" bgcolor="">  <tr><td align="center" colspan="10"><img src="img/laugh.gif" alt="Smiley" /></td></tr>  <tr><td align="center" style="color:#FF0000; text-decoration:blink;" colspan="10" ><b><?php echo $qtype2;?></b></td></tr><tr><td align="center"><input type="submit" name="question" value="question" /><input type="submit" name="answer" value="answer" /></td></tr>  <tr><td colspan="10"> </td></tr><input type="hidden" name="board_txt" id="board_txt" value="<?php echo $board_name; ?>" /><input type="hidden" name="subject_txt" id="subject_txt" value="<?php echo $subject_name; ?>" /><input type="hidden" name="qtype" id="qtype" value="<?php echo $qtype2; ?>" /> <?$board_name=$_POST['board_txt'];$subject_name=$_POST['subject_txt'];$qtype2=$_POST['qtype'];//echo "$board_name";if($_POST['question']=="question"){?><tr><td align="center" style="color:#FF0000; text-decoration:blink;" colspan="10" ><b><?php echo $qtype2;?></b></td></tr>  <tr>   <td>   Question<font color="red">*</font>   </td>   <td>   :   </td>     <td><textarea name="ques1" id="ques1" cols="25" rows="5" style="resize:none;"></textarea>   </td>   <td>	<table>	<tr>	<td width="10">	<div style="background-image:url(img/mic1_30.jpg); width:30px; height:25px;" >	<input type="file" id="quest_wav1" name="quest_wav1"  style="opacity:0;-moz-opacity:0 ;filter:alpha(opacity: 0);" size="1"  />	</div>	</td>	</tr>	<tr>	<td width="10">	<div style="background-image:url(img/img1.jpeg); width:30px; height:30px;" >	<input type="file" id="quest_img1" name="quest_img1"  style="opacity:0;-moz-opacity:0 ;filter:alpha(opacity: 0);" size="1"   />	</div>	</td>	</tr>	</table>   </td>   <td> </td>     <tr>   <td>Page No<font color="red">*</font></td><td>:</td>   <td><input type="text" name="pno" id="pno"  size="16" onkeypress="return isNumberKey(event, this.value)"/></td>   <td> </td>   <td> </td>   <td>Chapter No<font color="red">*</font></td><td>:</td>   <td><input type="text" name="cno" id="cno" size="16"  onkeypress="return isNumberKey(event, this.value)"/></td>   <td> </td>   <td> </td>  </tr>  <tr>   <td>Board</td><td>:</td>   <td><input type="text" name="board_txt" id="board_txt" size="16" readonly="" value="<?php echo $board_name;?>" style="background-color:#FFFFFF;" /></td>   <td> </td>   <td> </td>   <td>Subject</td><td>:</td>   <td><input type="text" name="subject_txt" id="subject_txt" size="16" readonly="" value="<?php echo $subject_name;?>" style="background-color:#FFFFFF;" />     <input type="hidden" name="language" id="language" value="<?php echo $language_name; ?>" />   <input type="hidden" name="qtype" id="qtype" value="<?php echo $qtype2; ?>" />   </td>   <td> </td>   <td> </td>  </tr>  <tr>   <td>Short Type</td>   <td>:</td>   <td>   <select id="short_type" name="short_type" >   <option value="" selected="selected">----</option>   <option value="Problem" >Problem</option>   <option value="Deleted">Deleted</option>   <option value="Very Short">Very Short</option>   <option value="Long">Long</option>   <option value="Short">Short</option>   <option value="Punctuation">Punctuation</option>   <option value="Vocabulary">Vocabulary</option>   <option value="Cogentorder">Cogentorder</option>   </select>   </td>   <td> </td>   <td> </td>   <!--<td>Explanation</td><td>:</td>   <td><input type="text" name="exp" id="exp" size="16"  /></td>   <td> </td>   <td> </td>-->  </tr>  <tr><td colspan="10">  </td></tr>  <tr>	  <td><font color="#FF0000"><b>Note :</b></font></td>	 <td colspan="2" align="center"><font color="#FF0000">*</font> Mandatory Fields</td>	 <td colspan="3" align="left"><img src="img/mic1_30.jpg" alt="Upload Wave" />Upload WAVE</td>	<td colspan="4" align="left"><img src="img/img1.jpeg" alt="Upload Image" />Upload IMAGE</td>  </tr>  <tr>  <tr><td colspan="10">  </td></tr>   <td colspan="10" align="center">   <input type="submit" name="add" value="Add" />	   <input type="reset" name="clear" value="Clear"  />   </td>  </tr> </table></td></tr><!--</table></form>--><?include("config/config_on.php");}else if($_POST['answer']=="answer"){?><tr><td align="center" style="color:#FF0000; text-decoration:blink;" colspan="10" ><b><?php echo $qtype2;?></b></td></tr>  <tr>   <td>   Statement1<font color="#0000FF">*</font>   </td>   <td>   :   </td>     <td><textarea name="stmt1" id="stmt1" cols="25" rows="5" style="resize:none;"></textarea>   </td>   <td>	<table>	<tr>	<td width="10">	<div style="background-image:url(img/mic1_30.jpg); width:30px; height:25px;" >	<input type="file" id="stmt_wav1" name="stmt_wav1"  style="opacity:0;-moz-opacity:0 ;filter:alpha(opacity: 0);" size="1"  />	</div>	</td>	</tr>	<tr>	<td width="10">	<div style="background-image:url(img/img1.jpeg); width:30px; height:30px;" >	<input type="file" id="stmt_img1" name="stmt_img1"  style="opacity:0;-moz-opacity:0 ;filter:alpha(opacity: 0);" size="1"   />	</div>	</td>	</tr>	</table>   </td>   <td> </td>   <td>   Statement2<font color="#0000FF">*</font>   </td>   <td>   :   </td>   <td><textarea name="stmt2" id="stmt2" cols="25" rows="5" style="resize:none;"></textarea>   </td>   <td> </td>   <td>	<table>	<tr>	<td width="10">	<div style="background-image:url(img/mic1_30.jpg); width:30px; height:25px;" >	<input type="file" id="stmt_wav2" name="stmt_wav2"  style="opacity:0;-moz-opacity:0 ;filter:alpha(opacity: 0);" size="1"  />	</div>	</td>	</tr>	<tr>	<td width="10">	<div style="background-image:url(img/img1.jpeg); width:30px; height:30px;" >	<input type="file" id="stmt_img2" name="stmt_img2"  style="opacity:0;-moz-opacity:0 ;filter:alpha(opacity: 0); " size="1"   />	</div>	</td>	</tr>	</table>   </td>    </tr>  <tr>   <td>   Option1<font color="red">*</font>   </td>   <td>   :   </td>     <td>   <textarea name="opt1" id="opt1" cols="25" rows="3" style="resize:none;"></textarea>   </td>   <td>	<table>	<tr>	<td width="10">	<div style="background-image:url(img/mic1_30.jpg); width:30px; height:25px;" >	<input type="file" id="opt_wav1" name="opt_wav1"  style="opacity:0;-moz-opacity:0 ;filter:alpha(opacity: 0);" size="1"  />	</div>	</td>	</tr>	<tr>	<td width="10">	<div style="background-image:url(img/img1.jpeg); width:30px; height:30px;" >	<input type="file" id="opt_img1" name="opt_img1"  style="opacity:0;-moz-opacity:0 ;filter:alpha(opacity: 0);" size="1"   />	</div>	</td>	</tr>	</table>   </td>   <td> </td>   <td>   Option2<font color="blue">*</font>   </td>   <td>   :   </td>     <td><textarea name="opt2" id="opt2" cols="25" rows="3" style="resize:none;"></textarea>   </td>   <td> </td>   <td>	<table>	<tr>	<td width="10">	<div style="background-image:url(img/mic1_30.jpg); width:30px; height:25px;" >	<input type="file" id="opt_wav2" name="opt_wav2"  style="opacity:0;-moz-opacity:0 ;filter:alpha(opacity: 0);" size="1"  />	</div>	</td>	</tr>	<tr>	<td width="10">	<div style="background-image:url(img/img1.jpeg); width:30px; height:30px;" >	<input type="file" id="opt_img2" name="opt_img2"  style="opacity:0;-moz-opacity:0 ;filter:alpha(opacity: 0); " size="1"   />	</div>	</td>	</tr>	</table>   </td>    </tr>      <td>	<table>	<tr>	<td width="10">	<div style="background-image:url(img/mic1_30.jpg); width:30px; height:25px;" >	<input type="file" id="opt_wav4" name="opt_wav4"  style="opacity:0;-moz-opacity:0 ;filter:alpha(opacity: 0);" size="1"  />	</div>	</td>	</tr>	<tr>	<td width="10">	<div style="background-image:url(img/img1.jpeg); width:30px; height:30px;" >	<input type="file" id="opt_img4" name="opt_img4"  style="opacity:0;-moz-opacity:0 ;filter:alpha(opacity: 0); " size="1"   />	</div>	</td>	</tr>	</table>   </td>    </tr>    <tr><td colspan="10">  </td></tr>  <tr>	  <td><font color="#FF0000"><b>Note :</b></font></td>	 <td colspan="2" align="center"><font color="#FF0000">*</font> Mandatory Fields</td>	 <td colspan="3" align="left"><img src="img/mic1_30.jpg" alt="Upload Wave" />Upload WAVE</td>	<td colspan="4" align="left"><img src="img/img1.jpeg" alt="Upload Image" />Upload IMAGE</td>  </tr>  <tr>  <tr><td colspan="10">  </td></tr>   <td colspan="10" align="center">   <input type="submit" name="add" value="Add" style="background-color:#FFFF00; font:Arial, Helvetica, sans-serif; color:#FF0000"/>	   <input type="reset" name="clear" value="Clear" style="background-color:#FFFF00; font:Arial, Helvetica, sans-serif; color:#FF0000"  />   </td>  </tr> <!--</table></td></tr>--></table></form> function validate(){alert("hai");var quest1=document.getElementById('ques1').value;var board_txt=document.getElementById('board_txt').value;var subject_txt=document.getElementById('subject_txt').value;var cno=document.getElementById('cno').value;var pno=document.getElementById('pno').value;short_type=document.getElementById('short_type');short_type1=short_type.options[short_type.selectedIndex].value;quest1=trim(quest1);board_txt=trim(board_txt);subject_txt=trim(subject_txt);pno=trim(pno);cno=trim(cno);if(quest1==""){alert("Please enter Question");document.getElementById('ques1').focus();return false;}else if (board_txt==""){alert("Please Select Board");document.getElementById('board_txt').focus();return false;}else if (subject_txt==""){alert("Please Select Subject");document.getElementById('subject_txt').focus();return false;}else if( pno==""){alert("Please enter valid Page No");document.getElementById('pno').focus();return false;}else if (cno==""){alert("Please Select Chapter No");document.getElementById('cno').focus();return false;}}

  17. Hi, Please any1 tell me how to validate the form. I'm having two buttons ques and ans in a form. By clicking question button the same form with some text fields will get open. And same for clicking the answer button the same form with some text fields will get open.Both forms have add & clear button. I'm having single form validate function.By clicking add it have to enter ques and ans in the database to corresponding tables. But by clicking add by setting all the fields empty using the script i've to get some alerts like the field is empty. But i didnt get any alerts it enters the database as emptyfield.please tell me how to write script for both the buttons with some conditions. Please tell me how to do this.

  18. Please any1 help me.how to use fread,fwrite,fopen in same code.Please any1 help me for this with some sample code.

  19. The following is my code.I've to include another seperate folder in this code itself.How shall i include the another text file in this itself.

    $img=$_GET['a'];$txt=$_POST['txt'];$ans = "$img.txt";$imgsplit=explode("-",$img);$qid = $imgsplit[0];$qidsplit = preg_split("/[0-9]/",$qid);$len = strlen($qidsplit[0]);if($len==5){    $sub = substr($qidsplit[0],2,3);	    $bd =   substr($qidsplit[0],0,2);   }else{    $bdsub = str_split($qidsplit[0],2);	    $bd = $bdsub[0];	    $sub = $bdsub[1];}$id = $imgsplit[1];$no = $imgsplit[2];$qno = $imgsplit[3];$folder="$bd-$sub-$id/";$upload = "img/$folder";$uploadfile = $ans;$uploadPath = $upload.$uploadfile;$incomingdata = file_get_contents('php://input');if(!$incomingdata)    die("No input data");if(!is_dir($upload))    mkdir($upload);$anshandle = fopen($ans, 'w+') or die("can't open file - $ans");if (!fwrite($anshandle, $txt))   {       echo "hai";   }else{// code}

×
×
  • Create New...