brainstem Posted September 26, 2006 Share Posted September 26, 2006 Here is my issue (I am still green, be nice);Trying to pull values from 2 arrays based on error or changed state, i.e you just logged in, you didn't fill a form right, etc...This is going to be implimented accoss a large site with multiple dir levels so i wanted an include to handle arrays where all of the errorlevel and messagelevel information was and thier corresponding links.The issue i'm having is, I have accomplished this with 'list' but its very cumbersome and I know there is a way to compact it down to a simple $array[0] type call but i cant get it to work.here is my code, plz help. The error i am currently getting is 'Unexpected ['.thanks in advance.call_defs.php ~<?php$statei = array(0=>'Error(s) Found.',1=>'Success!',2=>'Logging In '.$user.'.',3=>'Logging Out '.$user.'.',4=>'Welcome Administrator');$linki = array(0=>'javascript:history.back()',1=>'console.php',2=>'login.php',3=>'../index.php');?>index.php ~<?php...if ($err<>null) {include ("call_defs.php");$state = &statei[0]; //FAILING ON THIS LINE 'Unexpected ['$linkstate = &linki[0];include ("call_state.php");echo ("<META HTTP-EQUIV=Refresh CONTENT=\"5; URL=javascript:history.back(-1)\">");exit();...?>call_state.php ~<?phpecho <<<html... // in a table blah blah blah$state //echos errorlevel$linkstate //echos appropriate link in case browser doesn't support refresh....html;?> Quote Link to comment Share on other sites More sharing options...
brainstem Posted September 26, 2006 Author Share Posted September 26, 2006 onlamp is now on my php blacklist.A help reference on getting values out of arrays told me to use & instead of $ when calling directly to an array value.basterds.thanks anyways- Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.