473,554 Members | 4,294 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.ph p" method="post">
<input type="radio" name="keuzewink el" value="1">Voer kopen<br>
<input type="radio" name="keuzewink el" value="2">Bijpr oducten
kopen<br>
<input type="radio" name="keuzewink el" value="3">Medic ijnen kopen<br>
<input type="radio" name="keuzewink el" value="4">Praat je maken met de
verkoper<br>
<input type="radio" name="keuzewink el" value="5">Duive n verkopen /
kopen<br>
&nbsp<br>
<input type="submit" value="Verder">
</form>
<?
if (isset($submit) ) {
if ($keuzewinkel == '1') include('koopvo er.php')
else ($keuzewinkel == '2') include('koopbi jproducten.php' ) <--------
line 25
else ($keuzewinkel == '3') include('koopme dicijnen.php')
else ($keuzewinkel == '4') include('chatve rkoper.php')
else include('koopdu iven.php')
}
?>
</body>
</html>
I tryed to debug it but i cant find it.
Maybe you can help me?
Jul 17 '05 #1
3 15046
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.ph p" method="post">
<input type="radio" name="keuzewink el" value="1">Voer kopen<br>
<input type="radio" name="keuzewink el" value="2">Bijpr oducten
kopen<br>
<input type="radio" name="keuzewink el" value="3">Medic ijnen kopen<br>
<input type="radio" name="keuzewink el" value="4">Praat je maken met de
verkoper<br>
<input type="radio" name="keuzewink el" value="5">Duive n verkopen /
kopen<br>
&nbsp<br>
<input type="submit" value="Verder">
</form>
<?
if (isset($submit) ) {
if ($keuzewinkel == '1') include('koopvo er.php')
else ($keuzewinkel == '2') include('koopbi jproducten.php' ) <--------
line 25
else ($keuzewinkel == '3') include('koopme dicijnen.php')
else ($keuzewinkel == '4') include('chatve rkoper.php')
else include('koopdu iven.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('koopvo er.php')
else ($keuzewinkel == '2') include('koopbi jproducten.php' ) <--------
line 25
else ($keuzewinkel == '3') include('koopme dicijnen.php')
else ($keuzewinkel == '4') include('chatve rkoper.php')
else include('koopdu iven.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
19015
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 submitting user information into my creation script, I get the following error from the page that is suppose to insert the user data into the database,...
8
46169
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 where the inital " started? I find myself adding /* */ blocks or cutting/pasting sections of code out in order to find where the error occured. ...
5
13141
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') VALUES ('$_POST', '$_POST', '$_POST') mysql_query($sql)"; When I view the code in Internet Explorer I get the following error message: ...
1
6829
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 3. drop_table :users 4. 5. create_table :users, :options => 'ENGINE=InnoDB DEFAULT CHARSET=utf8' do |t| 6. t.column...
2
5848
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 looking for ages and I cannt find the mistake! <title> Grade Point Converter </title> </head> <body> <h1>Use the form below to work out your...
5
2480
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 * Desc: Program that prompts for a user name and * password from the user using HTTP authentication. * The program then tests...
1
4881
by: sheenrose | last post by:
<? $uname = $_REQUEST; $pass = $_REQUEST; /*Connecting, selecting database */ $LogStatus = 0; $link = mysql_connect("localhost","root","kushal") or die();
2
3210
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", $formName); // 06-22-07 - the next commands try to import all the functions that the
4
1863
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 I want the second one to submit to the same email, then redirect to a different page. I've downloaded some code, so I can't take credit for it, but...
0
7539
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8055
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7897
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6170
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5446
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5165
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3589
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2030
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1149
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.