Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

dummy website code not working please help

Featured Replies

I cannot continue with my lessons until I figure out what is wrong with this bit of code.It is not very long and this is the error I get

 

Parse error: parse error, unexpected ';' in C:\htdocs\phpdw\contact.php on line 2

 

<?php
if(array_key_exists('ewcomments',$_POST); (
echo 'you clicked the submit button' 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"]http://www.w3.org/TR...ransitional.dtd[/url]
<html xmlns="[url="http://www.w3.org/1999/xhtml%22>"]http://www.w3.org/1999/xhtml">[/url]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>east west seasons</title>
<?php /*include('style_rules.php');*/ ?>
</head>

<body>
<div id="wrapper">
 <div id="titlebar"><img src="" alt="east west season" name="bluebellstop" width="738" height="32" id="bluebellstop" style="background-color: #00CC99" /></div>
 <div id="Main content">
<div id="nav">
  <ul>
	<li id="thispage"><a href="index.php">Home</a></li>
	<li><a href="index.php">News</a></li>
	<li><a href="index.php">BLog</a></li>
	<li><a href="index.php">Gallery</a></li>
	<li><a href="index.php">Contact</a></li>
  </ul>
</div>
<h1>send us your comments</h1>
<p>Duis aute irure dolor ut labore et dolore magna aliqua. Quis nostrud exercitation sunt in culpa lorem ipsum dolor sit amet. Excepteur sint occaecat ullamco laboris nisi ut labore et dolore magna aliqua. In reprehenderit in voluptate quis nostrud exercitation qui officia deserunt. </p><form action="<?php $_SERVER['PHP_SELF'];?>" method="post" name="Contact form" id="Contact form">
  <p>
	<label for="name">name:</label>
	<br />
	<input type="text" name="name" id="name" />
  </p>
  <p>
	<label for="email">email</label>
	<br />
	<input type="text" name="email" id="email" />
  </p>
  <p>
	<label for="message">message<br />
	</label>
	<textarea name="message" cols="60" rows="6" id="message"></textarea>
  </p>
  <p>
	<input name="ewcomments" type="submit" id="ew comments" value="send comments" />
  </p>
</form>
<p> </p>
<div id="footer">
 <?php include('copyright.php'); ?>
 </div>

 </div>
</div>
</body>
</html>

Edited by Renaissance-Design
Code formatting

The error is giving you a clue. Try removing the ";" on line 2.

Firstly, if you're going to post code on the forum, use the code button - it's the one that looks like this: <>

 

Secondly, as Leonw pointed out you have an unclosed parenthesis on Line 2. In addition, conditionals use curly braces not parentheses and are not terminated with a semicolon.

Edited by Renaissance-Design

Replace your first four lines with this piece of code:

 

<?php
if(array_key_exists('ewcomments',$_POST)) {
echo 'you clicked the submit button' ;}
?>

 

That will get rid of your error message.

Edited by AnnobilsWebDesign

  • Author

Thank you guys.I still have so much to learn but I decided to read another book in addition to the one I am reading now.The one I am reading now covers php in dreamweaver but I am going to start reading one about only php and learn to hand code everything.I will save this page and try the code tommorrow

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.