472,373 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,373 software developers and data experts.

Parse error: parse error, unexpected T_ELSE

I got the following error in my page Parse error: parse error,
unexpected T_ELSE in line 25

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Club</title>
</head>
<style type="text/css">
body {margin : 0px;}
</style>
<body bgcolor="navy">
<font color="white">
Welkom in de winkel. Wat wilt u doen?<br>
<form action="club.php" method="post">
<input type="radio" name="keuzewinkel" value="1">Voer kopen<br>
<input type="radio" name="keuzewinkel" value="2">Bijproducten
kopen<br>
<input type="radio" name="keuzewinkel" value="3">Medicijnen kopen<br>
<input type="radio" name="keuzewinkel" value="4">Praatje maken met de
verkoper<br>
<input type="radio" name="keuzewinkel" value="5">Duiven verkopen /
kopen<br>
&nbsp<br>
<input type="submit" value="Verder">
</form>
<?
if (isset($submit)) {
if ($keuzewinkel == '1') include('koopvoer.php')
else ($keuzewinkel == '2') include('koopbijproducten.php') <--------
line 25
else ($keuzewinkel == '3') include('koopmedicijnen.php')
else ($keuzewinkel == '4') include('chatverkoper.php')
else include('koopduiven.php')
}
?>
</body>
</html>
I tryed to debug it but i cant find it.
Maybe you can help me?
Jul 17 '05 #1
3 14952
Marten van Urk wrote:
I got the following error in my page Parse error: parse error,
unexpected T_ELSE in line 25

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Club</title>
</head>
<style type="text/css">
body {margin : 0px;}
</style>
<body bgcolor="navy">
<font color="white">
Welkom in de winkel. Wat wilt u doen?<br>
<form action="club.php" method="post">
<input type="radio" name="keuzewinkel" value="1">Voer kopen<br>
<input type="radio" name="keuzewinkel" value="2">Bijproducten
kopen<br>
<input type="radio" name="keuzewinkel" value="3">Medicijnen kopen<br>
<input type="radio" name="keuzewinkel" value="4">Praatje maken met de
verkoper<br>
<input type="radio" name="keuzewinkel" value="5">Duiven verkopen /
kopen<br>
&nbsp<br>
<input type="submit" value="Verder">
</form>
<?
if (isset($submit)) {
if ($keuzewinkel == '1') include('koopvoer.php')
else ($keuzewinkel == '2') include('koopbijproducten.php') <--------
line 25
else ($keuzewinkel == '3') include('koopmedicijnen.php')
else ($keuzewinkel == '4') include('chatverkoper.php')
else include('koopduiven.php')
}
?>
</body>
</html>
I tryed to debug it but i cant find it.
Maybe you can help me?


Try terminating php lines with ';' when required, and see if that helps?

Groetjes

Steve
Jul 17 '05 #2
Marten van Urk <ur**@nlr.nl> wrote:
I got the following error in my page Parse error: parse error,
unexpected T_ELSE in line 25 .... <?
if (isset($submit)) {
if ($keuzewinkel == '1') include('koopvoer.php')
else ($keuzewinkel == '2') include('koopbijproducten.php') <--------
line 25
else ($keuzewinkel == '3') include('koopmedicijnen.php')
else ($keuzewinkel == '4') include('chatverkoper.php')
else include('koopduiven.php')
}
?> I tryed to debug it but i cant find it.
Maybe you can help me?


This is not how if/else works, please RTFM about control structures:
http://www.php.net/manual/en/languag...-structures.if
and
http://www.php.net/manual/en/control...tures.else.php
and specifically
http://www.php.net/manual/en/control...res.elseif.php

Alternatively http://www.php.net/manual/en/control...res.switch.php
(see example 16-1, that is almost exactly what you are trying to
accomplish).
Jul 17 '05 #3
You are using else statements in an incorrect manner.... you problem
want to use else if in this case... Refer to the links posted by Daniel
Tryba

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Ehartwig | last post by:
I recently created a script for user verification, solved my emailing issues, and then re-created the script in order to work well with the new PHP 5 that I installed on my server. After...
8
by: Wescotte | last post by:
The error message Parse error: syntax error, unexpected $end in FILE on line X is one I run into frequently and I know the cause is I missed an ending quote. Is there an easy way to determine...
5
by: Anna MZ | last post by:
I am new to php and have written the following mysql code to enter the details of a new user in the admin subdomain of my website: $sql = "INSERT INTO 'users' ('userid', 'username', 'upassword')...
1
by: soidariti | last post by:
database error - parse error, unexpected $, expecting kEND AddUserAuthorisationToUsers.rb migration file 1. class AddUserAuthorisationToUsers < ActiveRecord::Migration 2. def self.up ...
2
by: bex1985001 | last post by:
Hi I have produced the code below however I am getting the error in the title and have no idea what it means, I think its the only thing stopping the code from running. Any help please! Ive been...
5
by: goodguyjam | last post by:
Hi I'm trying to apply user authentication with HTTP on my site but i get the above error. Can anyone say whats wrong?? I cant figure it out. Here's my code below: <?php /* Program: Auth.php *...
1
by: sheenrose | last post by:
<? $uname = $_REQUEST; $pass = $_REQUEST; /*Connecting, selecting database */ $LogStatus = 0; $link = mysql_connect("localhost","root","kushal") or die();
2
by: Lawrence Krubner | last post by:
Imagine a template system that works by getting a file, as a string, and then putting it through eval(), something like this: $formAsString = $controller->command("readFileAndReturnString",...
4
by: mmiller | last post by:
I have a pretty limited knowledge of PHP. My scenario is: I want one form to have two (2) submit buttons. I want one button to submit an email to a specific address then redirect to a page, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.