Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 11-17-2003, 03:25 PM   #1 (permalink)
Ilya020
Techno Rat
 
Ilya020's Avatar
 
Join Date: Jan 2003
Location: San Diego
Posts: 559
Ilya020 is on a distinguished road
Send a message via AIM to Ilya020
Parse Error

When I try and execute the following code, I get a parse error on like 71 (The last line, after the closing PHP tag). I dont understand whats is wrong with it.

Code:
<?php

error_reporting (E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

$title= $_POST['title'];
$music= $_POST['music'];
$mood= $_POST['mood'];
$message= $_POST['message'];
$date = date("F j,  g:i A ");


//checks to see if the fields are filled

	if (empty($title)) 
	{	// ;)
		$error .= "Title not filled...<br>"; 
	}	 

	if (empty($music)) {
                $music = "Not listening to music";
	{

	if (empty($mood)) {
		$mood = "No currently feeling a mood";
        }

	if (empty($mesage)) {
		$error .= "Message not filled...<br>";
        }


//checks to see if there are any error messages

	if($error) {
		print $error;
		print '<br><br><a href="addpost.php">Retry Blogging<br>';
		exit;
	}


//continues checking


	if($error=="") {
		$info = "<p class=\"forTexts\"><strong>$title</strong><font size=1>$time</font><br><br><br><b>Music:</b>$music<br><b>Mood: </b>$mood<br><br>$message</p>";

//opens file

		$file= fopen("blog.txt", "a");
		flock($file, LOCK_EX);
	

//checks to see if proccess is available

		if(!$file) {
			print "<p>Cant be processed now, try again later...</p>";
			exit;
		}

//writes to file and closes file
	
		fwrite($file, $info);
		flock($file, LOCK_UN);
		fclose($file);

		print '<a href=\"../index.php\">Entry Written</a>';
	

	}
?>
Thanks
__________________
> SELECT * FROM users WHERE clue > 0
0 rows returned
Ilya020 is offline   Reply With Quote
Old 11-17-2003, 04:17 PM   #2 (permalink)
bdl
Senior Contributor
 
Join Date: May 2002
Location: vta.ca.usa
Posts: 555
bdl is on a distinguished road
PHP Code:
if (empty($music)) {
                
$music "Not listening to music";
    { 
You have an opening brace where you should have a closing one. The parser expects to find the closing brace but can't so it errors out past the last line in the script.



BTW you also have a typo:
PHP Code:
if (empty($mesage)) { 
bdl is offline   Reply With Quote
Old 11-17-2003, 05:27 PM   #3 (permalink)
Ilya020
Techno Rat
 
Ilya020's Avatar
 
Join Date: Jan 2003
Location: San Diego
Posts: 559
Ilya020 is on a distinguished road
Send a message via AIM to Ilya020
That, plus some other stuff did the trick.


Thanks,


Ilya
__________________
> SELECT * FROM users WHERE clue > 0
0 rows returned
Ilya020 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is this error? john_tran Standard C, C++ 4 10-20-2004 08:30 PM
{perl} HTTP Error Code Response gty All Other Coding Languages 2 09-08-2004 11:09 AM
C++ compile error Amaranthine Standard C, C++ 5 05-05-2004 08:23 PM
Error Ilya020 Standard C, C++ 7 07-10-2003 07:02 AM


All times are GMT -8. The time now is 03:05 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting