Paldo Posted June 1, 2009 Share Posted June 1, 2009 Hi guys could you please have a look at my code couse I realy don't know what could be a problem... I hope it's not a problem that names of my variables are in my native language, If it is I can translete it for you, but from previous experience that can couse diferences and other problems, I wanted it to be exactly the same stuff I use on my page... It says: Parse error: parse error in /3w/euweb.cz/p/parobek/zuzkeconfirm.php on line 29 I'll mark that line in code Thanks in advance for your time and help. <html> <body> <?php $cislovsringu = $_POST[cislo]; echo $cislovsringu; echo '<br>'; echo $cislovsringu{3}; echo $cislovsringu{1}; echo $cislovsringu{4}; echo '<br>'; $dlzka = strlen($cislovsringu); echo $dlzka; echo '<br>'; echo '<br>'; $poleHodnot = array( "1" => "jednotky" , "2" => "desiatky" , "3" => "stovky" , "4" => "tisicky" , "5" => "desatisicky" , "6" => "stotisicky" , "7" => "miliony" , "8" => "desatmiliony" , "9" => "stomiliony" , "10" => "miliardy" ); for ($i = $dlzka ; $i > -1; $i-- ) { // THIS IS LINE 29 THAT ERROR REFERS TO $polePoctu[$poleHodnot[$i]] = (int)cislovstringu[$i] ; } print_r($polePoctu); //1 364 720 434 ?> </body> </html> Link to comment https://forums.phpfreaks.com/topic/160473-solved-parse-error-please-help/ Share on other sites More sharing options...
glenelkins Posted June 1, 2009 Share Posted June 1, 2009 i think you just need to change the for loop to for ( $i = $dlzka; $i > -1; $i = $i -1 ) Link to comment https://forums.phpfreaks.com/topic/160473-solved-parse-error-please-help/#findComment-846823 Share on other sites More sharing options...
Paldo Posted June 1, 2009 Author Share Posted June 1, 2009 Well no It didn't work It prints the same error... Link to comment https://forums.phpfreaks.com/topic/160473-solved-parse-error-please-help/#findComment-846831 Share on other sites More sharing options...
Jibberish Posted June 1, 2009 Share Posted June 1, 2009 The for loop is fine, however you have missed a $ on the next line it should be. <?php $polePoctu[$poleHodnot[$i]] = (int)$cislovstringu[$i] ; ?> Also, I dont know if they are suposed to be the same word but you have $cislovstringu and $cislovsringu, one has an extra t in it. Link to comment https://forums.phpfreaks.com/topic/160473-solved-parse-error-please-help/#findComment-846837 Share on other sites More sharing options...
DarkSuperHero Posted June 1, 2009 Share Posted June 1, 2009 errors are usually within a few lines of specified line they are flaged. Link to comment https://forums.phpfreaks.com/topic/160473-solved-parse-error-please-help/#findComment-846849 Share on other sites More sharing options...
Jibberish Posted June 1, 2009 Share Posted June 1, 2009 errors are usually within a few lines of specified line they are flaged. Helps keep you on your toes Link to comment https://forums.phpfreaks.com/topic/160473-solved-parse-error-please-help/#findComment-846850 Share on other sites More sharing options...
Paldo Posted June 1, 2009 Author Share Posted June 1, 2009 Thank you all for your help it worked. Link to comment https://forums.phpfreaks.com/topic/160473-solved-parse-error-please-help/#findComment-846922 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.