Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 17th, 2007, 03:01 PM
Registered User
 
Join Date: Jan 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default undefined offset error

Dudes: getting an undefined offset error 45 times. there are 45 images (which aren't displaying), image numbers are stored in the $invoice array which i'm trying to call. anyone can help this newbie? thx!!

<?php elseif ($page=="cases"):
for ( $counter = 1; $counter <= 45; $counter ++ ){
echo "<a href='case$counter.php'><img src='images/th-case$invoice[$counter].jpg' border=0 alt='' title='" . $artist["case$counter"] . " - " . $track["case$counter"] . "'</a>";
}?>
Reply With Quote
  #2 (permalink)  
Old January 17th, 2007, 04:54 PM
Registered User
 
Join Date: Jan 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

never mind, solutions seem so obvious after a bit of lunch.
Reply With Quote
  #3 (permalink)  
Old January 17th, 2007, 09:53 PM
Authorized User
 
Join Date: Jan 2007
Location: kota bharu, kelantan, Malaysia.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to syazlan
Default

aiiii..i'm new user at here n my english is not very power..hehee
i want to ask my members here how to solve my problem when i build one form...example:
i have:
1)name:
2)address:
3)job
4)kategori
5)payment

i want when i put at job's box(jobs here,user can choose),ex: user choose system analyst, n then at the kategory n payment box automatic view the out put as group a or group b or group c n at the payment's box view as RM 5,Rm 4,RM 3 n so on....

Reply With Quote
  #4 (permalink)  
Old January 17th, 2007, 09:56 PM
Authorized User
 
Join Date: Jan 2007
Location: kota bharu, kelantan, Malaysia.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to syazlan
Default

pleaze...someone help me..!!i should settle my form 1st...i'm really really blur...i want my project can realese before i leave my prac....huhuhu

Reply With Quote
  #5 (permalink)  
Old January 17th, 2007, 10:05 PM
Authorized User
 
Join Date: Jan 2007
Location: kota bharu, kelantan, Malaysia.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to syazlan
Default

here i giv u my coding:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style7 {font-size: 12px}
-->
</style>
</head>

<body><form name="daftar" action="../php/sah_maklumat.php" method="post" target="_top">
<table width="444" border="0" align="center">
  <tr>
    <th width="434" height="48" bordercolorlight="#003300"><span class="style5">.::Sila masukkan butir-butir mengenai ahli baru kelab::.</span></th>
    </tr>
</table>

<table width="450" border="0" align="center">
  <tr>
    <th colspan="6" align="center" valign="top" scope="row">&nbsp;</th>
    </tr>
  <tr>
    <th width="12" align="center" valign="top" scope="row"><span class="style1">* </span></th>
    <td width="135" align="left" valign="top"><span class="style1 style7">1.NAMA</span></td>
    <td width="3" align="center" valign="top"><span class="style1">:</span></td>
    <td colspan="2" align="left" valign="top"><input name="nama" type="text" size="40" maxlength="100"></td>
    <td width="10">&nbsp;</td>
  </tr>
  <?php
 $jawatan='jawatan';
 echo"<tr>
     <th width='12' align='center' valign='top' scope='row'<span class='style1'>* </span></th>
    <td width='135' align='left' valign='top'><span class='style1 style7'>2.JAWATAN</span></td>
    <td width='3' align='center' valign='top'><span class='style1'>:</span></td>
    <td colspan='2' align='left' valign='top'>
    <select name='jawatan' value='$jawatan' id='select'>
      <option value= '00'>----------------------------Pilihan-------------------------</option>
      <option value='Dekan'>Dekan</option>
      <option value='Timbalan Dekan'>Timbalan Dekan</option>
      <option value='Profesor'>Profesor</option>
      <option value='Profesor Madya'>Profesor Madya</option>
      <option value='Pensyarah'>Pensyarah</option>
      <option value='Penolong Pendaftar'>Penolong Pendaftar</option>
      <option value='Pegawai Sains'>Pegawai Sains</option>
      <option value='Pegawai Sistem Maklumat'>Pegawai Sistem Maklumat</option>
      <option value='Pegawai Dietetik'>Pegawai Dietetik</option>
      <option value='Pegawai Pemulihan Perubatan'>Pegawai Pemulihan Perubatan</option>
      <option value='Juruteknologi Makmal Perubatan'>Juruteknologi Makmal Perubatan</option>
      <option value='Penolong Pegawai Sains'>Penolong Pegawai Sains</option>
      <option value='Jurupulih Perubatan'>Jurupulih Perubatan</option>
      <option value='Penolong Pegawai Tadbir'>Penolong Pegawai Tadbir</option>
      <option value='Penolong Pegawai Sistem Maklumat'>Penolong Pegawai Sistem Maklumat</option>
      <option value='Pereka'>Pereka</option>
      <option value='Juru X-ray'>Juru X-ray</option>
      <option value='Pembantu Tadbir Kesetiausahaan'>Pembantu Tadbir Kesetiausahaan</option>
      <option value='Pembantu Tadbir'>Pembantu Tadbir</option>
      <option value='Pembantu Tadbir Rendah'>Pembantu Tadbir Rendah</option>
      <option value='Pembantu Am Rendah'>Pembantu Am Rendah</option>
      <option value='Pembantu Makmal'>Pembantu Makmal</option>
      <option value='Atendan Kesihatan'>Atendan Kesihatan</option>
      <option value='Juruteknik'>Juruteknik</option>
    </select></td>
    <td width='10'>&nbsp;</td>
  </tr>";

if ($jawatan='Dekan'){
          $kategori="Pensyarah";
        $yuran="RM 5.00";
        }
else if ($jawatan='Pegawai Sains'){
        $kategori="kakitangan kump a";
        $yuran="RM 4.00";
        }
echo"<tr>
    <th width='12' align='center' valign='top' scope='row'><span class='style1'>* </span></th>
    <td width='135' align='left' valign='top'><span class='style1 style7'>4.KATEGORI</span></td>
    <td width='3' align='center' valign='top'><span class='style1'>:</span></td>
    <td colspan='2' align='left' valign='top'><input name='kategori' value='$kategori' type='text' size='20' maxlength='40'></td>
    <td width='10'>&nbsp;</td>
  </tr>";
echo"<tr>
    <th width='12' align='center' valign='top' scope='row'><span class='style1'>* </span></th>
    <td width='135' align='left' valign='top'><span class='style1 style7'>5.YURAN BULANAN </span></td>
    <td width='3' align='center' valign='top'><span class='style1'>:</span></td>
    <td colspan='2' align='left' valign='top'><input name='yuran' value='$yuran' type='text' size='20 maxlength='40'> </td>
    <td width='10'>&nbsp;</td>
  </tr>";
  ?>
  <tr>
    <th width="12" align="center" valign="top" scope="row"><span class="style1">* </span></th>
    <td width="135" align="left" valign="top"><span class="style1 style7">3.NO. TEL PEJABAT </span></td>
    <td width="3" align="center" valign="top"><span class="style1">:</span></td>
    <td colspan="2" align="left" valign="top"><span class="style1 style7">609-766</span>
      <input name="tel_pejabat" type="text" size="4" maxlength="4"></td>
    <td width="10">&nbsp;</td>
  </tr>
  <tr>
    <th width="12" align="center" valign="top" scope="row"><span class="style1">* </span></th>
    <td width="135" align="left" valign="top"><span class="style1 style7">3.NO. TEL BIMBIT </span></td>
    <td width="3" align="center" valign="top"><span class="style1">:</span></td>
    <td colspan="2" align="left" valign="top">
<select name="tel_bimbit" id="select">
  <option value="00" >012</option>
  <option value="1">017</option>
  <option value="2">013</option>
  <option value="3">019</option>
  <option value="4">016</option>
  <option value="5">014</option>
</select>
<input name="tel_bimbit" type="text" size="7" maxlength="7">
</td>
    <td width="10">&nbsp;</td>
  </tr>
  <tr>
    <th align="center" valign="top" scope="row"><span class="style1"> *</span></th>
    <td align="left" valign="top"><span class="style1 style7">7.ALAMAT</span></td>
    <td align="center" valign="top"><span class="style1">:</span></td>
    <td colspan="2" align="left" valign="middle"> <span class="style1">
      <textarea name="alamat" cols="31" id="textarea" rows="5"></textarea>
    </span></td>
    <td>&nbsp;</td>
  </tr>

  <tr>
    <th align="center" valign="top" scope="row">*</th>
    <td rowspan="2" align="left" valign="top"><span class="style1 style7">8.ID STAF </span></td>
    <td rowspan="2" align="center" valign="top"><span class="style1">:</span><span class="style1"></span></td>
    <td colspan="2" align="left" valign="top">
      <input name="id_staf" type="text" id="ad_staf1" size="10" maxlength="7">
</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <th align="center" valign="top" scope="row">&nbsp;</th>
    <td colspan="2" align="left" valign="top"><span class="style1 style7">*Tidak melebihi 7 aksara. </span></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <th align="center" valign="top" scope="row"> *</th>
    <td rowspan="2" align="left" valign="top"><span class="style1 style7">9.KATA LALUAN </span><span class="style1 style7"></span></td>
    <td rowspan="2" align="center" valign="top"><span class="style1">:</span><span class="style1"></span></td>
    <td colspan="2" align="left" valign="top">
      <input name="kata_laluan" type="password" id="kata_laluan1" size="12" maxlength="12">
</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <th align="center" valign="top" scope="row">&nbsp;</th>
    <td colspan="2"><span class="style1 style7">*Diantara 6 - 12 aksara.</span></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <th colspan="6" scope="row"><span class="style1"></span><span class="style1"></span><span class="style1"></span><span class="style1"></span><span class="style1"></span><span class="style1">
<input type="submit" name="Submit" value="Daftar">
<input type="reset" name="Submit2" value="Batal">
    </span></th>
    </tr>

</table>
</form>
</body>
</html>



Reply With Quote
  #6 (permalink)  
Old January 17th, 2007, 11:51 PM
Friend of Wrox
 
Join Date: Oct 2003
Location: colombo, WP, Sri Lanka.
Posts: 481
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

hi,
Replace your code with this,


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style7 {font-size: 12px}
-->
</style>
</head>
<script language="javascript">
<!--//
function loadcat()
{
    if(document.daftar.jawatan.value=="Dekan"){
        document.daftar.kategori.value="Pensyarah"
        document.daftar.yuran.value="RM 5.00"
    }
    else if(document.daftar.jawatan.value=="Pegawai Sains"){
        document.daftar.kategori.value="kakitangan kump a"
        document.daftar.yuran.value="RM 4.00"
    }
}
//-->
</script>
<body><form name="daftar" action="../php/sah_maklumat.php" method="post" target="_top">
<table width="444" border="0" align="center">
  <tr>
    <th width="434" height="48" bordercolorlight="#003300"><span class="style5">.::Sila masukkan butir-butir mengenai ahli baru kelab::.</span></th>
    </tr>
</table>

<table width="450" border="0" align="center">
  <tr>
    <th colspan="6" align="center" valign="top" scope="row">&nbsp;</th>
    </tr>
  <tr>
    <th width="12" align="center" valign="top" scope="row"><span class="style1">* </span></th>
    <td width="135" align="left" valign="top"><span class="style1 style7">1.NAMA</span></td>
    <td width="3" align="center" valign="top"><span class="style1">:</span></td>
    <td colspan="2" align="left" valign="top"><input name="nama" type="text" size="40" maxlength="100"></td>
    <td width="10">&nbsp;</td>
  </tr>

<tr>
     <th width="12" align="center" valign="top" scope="row"<span class="style1">* </span></th>
    <td width="135" align="left" valign="top"><span class="style1 style7">2.JAWATAN</span></td>
    <td width="3" align="center" valign="top"><span class="style1">:</span></td>
    <td colspan="2" align="left" valign="top">
    <select name="jawatan" value="jawatan" onchange="javascript:loadcat()" id="select">
      <option value= "00">----------------------------Pilihan-------------------------</option>
      <option value="Dekan">Dekan</option>
      <option value="Timbalan Dekan">Timbalan Dekan</option>
      <option value="Profesor">Profesor</option>
      <option value="Profesor Madya">Profesor Madya</option>
      <option value="Pensyarah">Pensyarah</option>
      <option value="Penolong Pendaftar">Penolong Pendaftar</option>
      <option value="Pegawai Sains">Pegawai Sains</option>
      <option value="Pegawai Sistem Maklumat">Pegawai Sistem Maklumat</option>
      <option value="Pegawai Dietetik">Pegawai Dietetik</option>
      <option value="Pegawai Pemulihan Perubatan">Pegawai Pemulihan Perubatan</option>
      <option value="Juruteknologi Makmal Perubatan">Juruteknologi Makmal Perubatan</option>
      <option value="Penolong Pegawai Sains">Penolong Pegawai Sains</option>
      <option value="Jurupulih Perubatan">Jurupulih Perubatan</option>
      <option value="Penolong Pegawai Tadbir">Penolong Pegawai Tadbir</option>
      <option value="Penolong Pegawai Sistem Maklumat">Penolong Pegawai Sistem Maklumat</option>
      <option value="Pereka">Pereka</option>
      <option value="Juru X-ray">Juru X-ray</option>
      <option value="Pembantu Tadbir Kesetiausahaan">Pembantu Tadbir Kesetiausahaan</option>
      <option value="Pembantu Tadbir">Pembantu Tadbir</option>
      <option value="Pembantu Tadbir Rendah">Pembantu Tadbir Rendah</option>
      <option value="Pembantu Am Rendah">Pembantu Am Rendah</option>
      <option value="Pembantu Makmal">Pembantu Makmal</option>
      <option value="Atendan Kesihatan">Atendan Kesihatan</option>
      <option value="Juruteknik">Juruteknik</option>
    </select></td>
    <td width="10">&nbsp;</td>
  </tr>
<tr>
    <th width="12" align="center" valign="top" scope="row"><span class="style1">* </span></th>
    <td width="135" align="left" valign="top"><span class="style1 style7">4.KATEGORI</span></td>
    <td width="3" align="center" valign="top"><span class="style1">:</span></td>
    <td colspan="2" align="left" valign="top"><input name="kategori" value="" type="text" size="20" maxlength="40"></td>
    <td width="10">&nbsp;</td>
  </tr>
<tr>
    <th width="12" align="center" valign="top" scope="row"><span class="style1">* </span></th>
    <td width="135" align="left" valign="top"><span class="style1 style7">5.YURAN BULANAN </span></td>
    <td width="3" align="center" valign="top"><span class="style1">:</span></td>
    <td colspan="2" align="left" valign="top"><input name="yuran" value="" type="text" size="20" maxlength="40"></td>
    <td width="10">&nbsp;</td>
  </tr>

  <tr>
    <th width="12" align="center" valign="top" scope="row"><span class="style1">* </span></th>
    <td width="135" align="left" valign="top"><span class="style1 style7">3.NO. TEL PEJABAT </span></td>
    <td width="3" align="center" valign="top"><span class="style1">:</span></td>
    <td colspan="2" align="left" valign="top"><span class="style1 style7">609-766</span>
      <input name="tel_pejabat" type="text" size="4" maxlength="4"></td>
    <td width="10">&nbsp;</td>
  </tr>
  <tr>
    <th width="12" align="center" valign="top" scope="row"><span class="style1">* </span></th>
    <td width="135" align="left" valign="top"><span class="style1 style7">3.NO. TEL BIMBIT </span></td>
    <td width="3" align="center" valign="top"><span class="style1">:</span></td>
    <td colspan="2" align="left" valign="top">
<select name="tel_bimbit" id="select">
  <option value="00" >012</option>
  <option value="1">017</option>
  <option value="2">013</option>
  <option value="3">019</option>
  <option value="4">016</option>
  <option value="5">014</option>
</select>
<input name="tel_bimbit" type="text" size="7" maxlength="7">
</td>
    <td width="10">&nbsp;</td>
  </tr>
  <tr>
    <th align="center" valign="top" scope="row"><span class="style1"> *</span></th>
    <td align="left" valign="top"><span class="style1 style7">7.ALAMAT</span></td>
    <td align="center" valign="top"><span class="style1">:</span></td>
    <td colspan="2" align="left" valign="middle"> <span class="style1">
      <textarea name="alamat" cols="31" id="textarea" rows="5"></textarea>
    </span></td>
    <td>&nbsp;</td>
  </tr>

  <tr>
    <th align="center" valign="top" scope="row">*</th>
    <td rowspan="2" align="left" valign="top"><span class="style1 style7">8.ID STAF </span></td>
    <td rowspan="2" align="center" valign="top"><span class="style1">:</span><span class="style1"></span></td>
    <td colspan="2" align="left" valign="top">
      <input name="id_staf" type="text" id="ad_staf1" size="10" maxlength="7">
</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <th align="center" valign="top" scope="row">&nbsp;</th>
    <td colspan="2" align="left" valign="top"><span class="style1 style7">*Tidak melebihi 7 aksara. </span></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <th align="center" valign="top" scope="row"> *</th>
    <td rowspan="2" align="left" valign="top"><span class="style1 style7">9.KATA LALUAN </span><span class="style1 style7"></span></td>
    <td rowspan="2" align="center" valign="top"><span class="style1">:</span><span class="style1"></span></td>
    <td colspan="2" align="left" valign="top">
      <input name="kata_laluan" type="password" id="kata_laluan1" size="12" maxlength="12">
</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <th align="center" valign="top" scope="row">&nbsp;</th>
    <td colspan="2"><span class="style1 style7">*Diantara 6 - 12 aksara.</span></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <th colspan="6" scope="row"><span class="style1"></span><span class="style1"></span><span class="style1"></span><span class="style1"></span><span class="style1"></span><span class="style1">
<input type="submit" name="Submit" value="Daftar">
<input type="reset" name="Submit2" value="Batal">
    </span></th>
    </tr>

</table>
</form>
</body>
</html>

surendran
(Anything is Possible)
http://ssuren.spaces.msn.com
Reply With Quote
  #7 (permalink)  
Old January 18th, 2007, 04:39 AM
Authorized User
 
Join Date: Jan 2007
Location: kota bharu, kelantan, Malaysia.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to syazlan
Default

wokey...tq very much....

Reply With Quote
  #8 (permalink)  
Old January 22nd, 2007, 12:07 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: colombo, WP, Sri Lanka.
Posts: 481
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

syazlan,
welcome,
good luck for you.

surendran
(Anything is Possible)
http://ssuren.spaces.msn.com
Reply With Quote
  #9 (permalink)  
Old January 24th, 2007, 04:20 AM
Authorized User
 
Join Date: Jan 2007
Location: kota bharu, kelantan, Malaysia.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to syazlan
Default

aii..i have a problem against.!!
i need the coding to select two table from database...


Reply With Quote
  #10 (permalink)  
Old January 24th, 2007, 04:41 AM
Authorized User
 
Join Date: Jan 2007
Location: kota bharu, kelantan, Malaysia.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to syazlan
Default

aii..i have a problem against.!!
i need the coding to select two table from database...
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Undefined Offset 7thsense101 BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 December 9th, 2009 06:49 AM
Re: Undefined offset: 1 chapter 5 form.php sreenivasharish BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 November 9th, 2008 06:08 PM
Notice: Undefined offset: ## Herjan BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 November 27th, 2005 12:29 PM
Loops and Arrays - Undefined offset notice dkintheuk Beginning PHP 6 September 12th, 2005 11:38 PM
ImageLine Undefined offset error ss2003 Beginning PHP 3 January 13th, 2004 04:37 PM



All times are GMT -4. The time now is 12:43 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.