Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

php error? version issue?

Status
Not open for further replies.

VAMick

Programmer
Nov 18, 2005
64
US
i just switched hosts, going from php4 to php5 and have a slew of problems with my code now. Can anyone tell me what's going on here?

I'm getting a PHP notice error of:
PHP Notice: Undefined offset: 1 in /var/ on line 76

that points to this code. Anything wrong here?
Code:
if(isset($_POST['submit_create_record'])){
   $varorderdate = preg_split("/(-|\/)/",$_POST['orderdate']);
   $varorderdate = $varorderdate[2]."-".$varorderdate[0]."-".$varorderdate[1];
   $varinvoicedate = preg_split("/(-|\/)/",$_POST['invoicedate']);
   $varinvoicedate = $varinvoicedate[2]."-".$varinvoicedate[0]."-".$varinvoicedate[1];
   $varstartdate = preg_split("/(-|\/)/",$_POST['startdate']);
   $varstartdate = $varstartdate[2]."-".$varstartdate[0]."-".$varstartdate[1];
   $varenddate = preg_split("/(-|\/)/",$_POST['enddate']);
   $varenddate = $varenddate[2]."-".$varenddate[0]."-".$varenddate[1];
 
I'm guessing either one of these arrays does not have a key in position 1.

$varinvoicedate[1]
$varstartdate[1]
$varenddate[1]


At least that's what the error is telling you. Make sure your arrays are populated correctly.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top