St3ff3n Posted May 15, 2007 Share Posted May 15, 2007 Hi, I recently loaded up my new php script, and when I try to access the page it says: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /customers/meieriklubben.no/meieriklubben.no/httpd.www/autorisert/bilder/upload.php on line 172 ---------------------------------------------------- The code around line 172 is: // Kill the old, and move in teh new unlink($user_name . "/" . $imgupload['name']); if(move_uploaded_file ($imgupload['tmp_name'], $user_name . "/" . $imgupload['name'])) { chmod($user_name . "/" . $imgupload['name'], 0644); echo "Bildet ditt ble lastet opp!"; echo "Klikk . '<a href="' . $user_name . '/' . $imgupload['name'] . '" target="_blank">her</a>' . for å se bildet ditt."; } } else { echo "Bildet du ville laste opp eksisterer allerede!"; <br /> "Vennligst velg ~overskriv~ bildet eller skift navn."; } } else { if(move_uploaded_file ($imgupload['tmp_name'], $user_name . "/" . $imgupload['name']) I know i'ts in norwegian, but that's not where the problem is. Quote Link to comment https://forums.phpfreaks.com/topic/51523-whats-wrong/ Share on other sites More sharing options...
kenrbnsn Posted May 15, 2007 Share Posted May 15, 2007 This line looks suspicious: <?php echo "Klikk . '<a href="' . $user_name . '/' . $imgupload['name'] . '" target="_blank">her</a>' . for å se bildet ditt."; ?> Check the use of double and single quotes. Ken Quote Link to comment https://forums.phpfreaks.com/topic/51523-whats-wrong/#findComment-253745 Share on other sites More sharing options...
St3ff3n Posted May 15, 2007 Author Share Posted May 15, 2007 Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/51523-whats-wrong/#findComment-253748 Share on other sites More sharing options...
St3ff3n Posted May 15, 2007 Author Share Posted May 15, 2007 Well, I'm back. First script, many wrongs.. } else { if(move_uploaded_file ($imgupload['tmp_name'], $user_name . "/" . $imgupload['name'])) { chmod($user_name . "/" . $imgupload['name'], 0644); echo "Bildet ditt ble lastet opp<br />"; echo "Klikk . "<a href="" . $user_name . "/" . $imgupload['name'] . " target="_blank">her</a>" . "for å se bildet ditt."; { { } } else { echo "Området ditt eksisterer ikke. Vennligst kontakt en admin.<br />"; } } else { echo "Bildet du prøver å laste opp er feilaktig, eller er av en filtype som ikke er tillatt.<br />"; } } else { echo "Du må velge en bildefil.<br />"; } } Parse error; Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /customers/meieriklubben.no/meieriklubben.no/httpd.www/autorisert/bilder/upload.php on line 181 Quote Link to comment https://forums.phpfreaks.com/topic/51523-whats-wrong/#findComment-253751 Share on other sites More sharing options...
taith Posted May 15, 2007 Share Posted May 15, 2007 again... echo "Klikk . "<a href="" . $user_name . "/" . $imgupload['name'] . " target="_blank">her</a>" . "for å se bildet ditt."; Quote Link to comment https://forums.phpfreaks.com/topic/51523-whats-wrong/#findComment-253756 Share on other sites More sharing options...
St3ff3n Posted May 15, 2007 Author Share Posted May 15, 2007 Thank you for answering, but I already did that. It didn't work anyway.. Quote Link to comment https://forums.phpfreaks.com/topic/51523-whats-wrong/#findComment-253760 Share on other sites More sharing options...
tg989 Posted May 15, 2007 Share Posted May 15, 2007 echo 'Bildet ditt ble lastet opp<br />'; echo 'Klikk <a href="' . $user_name . '/' . $imgupload['name'] . ' target="_blank">her</a> for å se bildet ditt.'; Quote Link to comment https://forums.phpfreaks.com/topic/51523-whats-wrong/#findComment-253761 Share on other sites More sharing options...
St3ff3n Posted May 15, 2007 Author Share Posted May 15, 2007 Next problem: QUOTE Parse error: syntax error, unexpected T_ELSE in /customers/meieriklubben.no/meieriklubben.no/httpd.www/autorisert/bilder/upload.php on line 185 The lines around line 185: CODE { } } else { echo "Området ditt eksisterer ikke. Vennligst kontakt en admin.<br />"; } } else { echo "Bildet du prøver å laste opp er feilaktig, eller er av en filtype som ikke er tillatt.<br />"; Quote Link to comment https://forums.phpfreaks.com/topic/51523-whats-wrong/#findComment-253775 Share on other sites More sharing options...
kenrbnsn Posted May 15, 2007 Share Posted May 15, 2007 You can't have an "else" clause without a corresponding "if" or "elseif". All of these errors are syntax errors which means you've written something incorrectly. You really should learn the correct syntax before trying to write complex routines. Ken Quote Link to comment https://forums.phpfreaks.com/topic/51523-whats-wrong/#findComment-253785 Share on other sites More sharing options...
tg989 Posted May 15, 2007 Share Posted May 15, 2007 You can't have an "else" clause without a corresponding "if" or "elseif". All of these errors are syntax errors which means you've written something incorrectly. You really should learn the correct syntax before trying to write complex routines. Ken x2 Quote Link to comment https://forums.phpfreaks.com/topic/51523-whats-wrong/#findComment-253928 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.