Solved

what's wrong with code

Posted on 2007-11-22
2
178 Views
Last Modified: 2008-02-01
whats wrong with this php script i made?
<?php
$popu      = $_POST['popularity'];
$webu      = $_POST['weburl'];
$fname      = $_POST['fname'];
$cemail      = $_POST['cemail'];
$minfo      = $_POST['minfo'];
 
 
if($popu == "" || $webu == "" || $fname == "" || $cemail == "" || $minfo == "") {
echo "<center><b>Please fill this out.</b><br><br></center>";
} else {
$line		.= "<b>----------------------------------</b>";
$addit     .= "Site: $webu<br>";
$addit     .= "Name: $fname<br>";
$addit     .= "Email: $cemail<br>";
$addit     .= "Popularity: $popu<br>";
$addit     .= "Comments: $minfo<br>$line<br>";
 
$file = "applications.html";
$fh = fopen($file, "a");
fwrite ($fh, "$addit");
fclose($fh);
echo "<center><font color='red'><b>Thanks! Application has been sent.</b></font><br><br></center>";
}
}
?>

Open in new window

0
Comment
Question by:fapathy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
HiTechFail earned 500 total points
ID: 20336804
Remove one of the last brackets at the end. That is also a bad way of doing applications, but if you just want to fix this one then just remove bracket.
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20336865
HiTech and fapathy,

Seems these accounts both come from the same place, and it seems that it is mis appropriation of the point system.

Can you please explain what you are doing?

Thanks

Computer101
EE Admin
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question