Jump to content

What's wrong?


St3ff3n

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

 

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 />";

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.