Register  |  Login




Advertisement

Start Your Own Q&A Site

Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.

Question

Status: Open Points: 75 Time: 07:16 - Oct 25, 2007  

shashi.programmer

php code not working over web server...................

I have make a file to upload a multiple file to upload from admin side and when i click over add more records it is not working properly over server but it is working properly on my localhost. i m scare that what is going on................ plz help me out....................

following are code:

<tr class="txt">
  <td valign="top">
  <div id="dvFile">Report Type : <?php $nfiles=0; ?>
  <select name="rname<?php echo $nfiles; ?>"><?php $hsp=mysql_query("SELECT reporttype FROM report");$row = mysql_fetch_array($hsp);do{ ?><option value="<?php echo $row['reporttype']; ?>"><?php echo strtoupper($row['reporttype']); ?></option><?php } while ($row = mysql_fetch_assoc($hsp)); $rows = mysql_num_rows($hsp);if($rows > 0) { mysql_data_seek($hsp, 0); $row = mysql_fetch_assoc($hsp); }?>
  </select>
  Notes : <textarea name="sp<?php echo $nfiles; ?>" rows="5" cols="30"></textarea>
  <input type="file" name="item_file[]">
  </div>
  </td>
  <td valign="top">
  <a href="javascript:more();" title="Add more" name="add">Add More Records</a>
  </td>
 <script language="javascript">
  nfiles = 0;
  function more()
 {  
   nfiles = ++nfiles;
   
   var txt = '<br>Report Type : <select name=\'rname' + nfiles + '\'><?php $hsp=mysql_query("SELECT reporttype FROM report"); $row = mysql_fetch_array($hsp); do { ?><option value="<?php echo $row['reporttype']; ?>"><?php echo strtoupper($row['reporttype']); ?></option><?php } while ($row = mysql_fetch_assoc($hsp)); $rows = mysql_num_rows($hsp); if($rows > 0) { mysql_data_seek($hsp, 0); $row = mysql_fetch_assoc($hsp); } ?></select>';
  txt = txt + ' Notes : <textarea name=\'sp' + nfiles + '\' rows=\'5\' cols=\'30\'></textarea>';
  txt = txt + ' <input type=\'file\' name=\'item_file[]\'>';
  document.getElementById("dvFile").innerHTML += txt; 
 }
  function validate(f)
 {
  var chkFlg = false;
  for(var i=0; i < f.length; i++)
  {
   if(f.elements[i].type=="file" && f.elements[i].value != "")
   {
    chkFlg = true;
   }
   
  }
  
  if(!chkFlg)
  {
   alert('Please browse/choose at least one file');
   return false;
  }
  f.pgaction.value='upload';
  return true;
 }
 </script>
  </tr>



thanks in advance
shashi

Answer Discussion
Tutorials

 

This question has not yet been answered.

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

Tutorials cannot be submitted until the Answer Discussion is complete.

Submit answers in the Answer Discussion area

Ask a Question

Have a new question? Ask!

You have 100 characters to use



Top Experts

View More

Rank

Expert

Points

1.

nidhi

10279

2.

oracleofDelphi

6493

3.

rcastagna

5596

4.

LAGM

4848

5.

PeterNZ

3487

6.

gonzalo

2840

7.

Mason

2770

8.

jgivoni

2303

9.

xarcus

1820

10.

Anpanman

917

Become an Expert

Register today to share your knowledge with the community and be recognized and rewarded for your contributions.


Register Here




"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it



Language Options

English:

www.quomon.com

Español:

www.quomon.es