Jump to content

[SOLVED] Parse Error


S3C

Recommended Posts

Hello all,

 

I'm trying to make a simple app that asks me for my username, and the redirects me to it on a website.

 

Here's my code:

 

<?
if ($_POST['website']) {
header("Location: http://".  $_POST['website'] . newgrounds.com)
}
?>
<html>
<head>
	<title> Welcome </title>
</head>
<body>
	<form action="welcome.php" method="post">
	Enter username: <input type="text" name="website" />

</body>
</html>

 

I get a parse error on line 4 and I dont understand why.

 

Parse error: syntax error, unexpected '}'

 

Thanks for help!

Link to comment
https://forums.phpfreaks.com/topic/103589-solved-parse-error/
Share on other sites

Try this...

 

<?
if ($_POST['website']) {
header("Location: http://".  $_POST['website'] . "newgrounds.com")
}
?>
<html>
<head>
	<title> Welcome </title>
</head>
<body>
	<form action="welcome.php" method="post">
	Enter username: <input type="text" name="website" />

</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/103589-solved-parse-error/#findComment-530466
Share on other sites

Appreciate it!

 

<?
if ($_POST['website']) {
header("Location: http://".  $_POST['website'] . "newgrounds.com");
}
?>
<html>
<head>
	<title> Welcome </title>
</head>
<body>
	<form action="welcome2.php" method="post">
	Enter username: <input type="text" name="website" />

</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/103589-solved-parse-error/#findComment-530479
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.