This is my issue...This is part of a bigger script i am working on and what this part of the coding does is it looks to see if the recruiting status for the site is either open or closed...now as you can see if it is closed it is supposed to show that message and if it is open it is supposed to shot the "Join Us" form...now it all works great except for the fact that i want to be able to use a "Form Validator" that will have a pop-up for leaving a feild blank or invalid email format or leaving the checkbox blank...but the issue im having is that i cannot add any code into the "echo ' " with it coming up with syntax errors...if someone could please help me with this you would make me very happy...if you think you got it either send it to me on my msn: [no contact details as per admin's rules]...or just post it on here as i will be watching for replies.

Thanks Guys

/*
BEGINS for JoinUS
*/
 if($_GET['view'] == "JoinUs") {
 require("functions.php");				
$query = @mysql_query("SELECT recruiting, security_status, total FROM status");
$row_status = mysql_fetch_array($query);

if($row_status['total'] >= 350 || $row_status['recruiting'] == 1) {
                    echo' <font color="#76A5D5" size="4" face="verdana"><b>Recruiting Is Closed!</b></font>';
					} else {


 echo '
 ?>
 <form method="post" name="JoinRequest" action="sendit.php">

<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>

<input type="hidden" name="ip" value="<?php echo $ipi ?>"/>
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>"/>
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>"/>
<br />
<b><font color="#76A5D5" size="2" face="verdana">Socom Name:&nbsp;&nbsp;</font></b>
<input name="visitor" type="text" id="visitor" size="35"/>
<br />
<br />
<b><font color="#76A5D5" size="2" face="verdana">Email Address:</font></b>&nbsp;
<input type="text" name="visitormail" size="35"/>
<br />
<br />
<b><font color="#76A5D5" size="2" face="verdana">Version Trying For:</font></b>&nbsp;
<select name="attn" size="1">
<option value=" Socom1 ">Socom </option>
<option value=" Socom2 ">Socom 2 </option>
<option value=" Socom3 ">Socom 3 </option>
<option value=" Socom4 ">Combined Assult </option>
</select>
<br /><br />
<input type="checkbox" name="notes" value="checkbox"/>
<font color="#76A5D5" size="1" face="verdana">I Have Read And Agree To Follow The <strong><a href="index.php?view=Rules">Clan Rules</font></a></strong><br />
<br />
<input type="submit" value="Submit">
</form>
<font color="#FF0000">**</font><font color="#76A5D5" size="1" face="verdana">All  Applications will be reviewed in a timely manner. Any questions or concerns belong on our <b><a href="forum/index.php">Forum</a></b></font><br />
<br />';
}
include('footer.php');
}
/*
ENDS for HowTojoin
*/

    As a note - with the small amount of code you have, it is much easier if you simply include it in your post (wrap [PHP][/PHP] bbcode tags around it!) rather than attaching it. In fact, some may not even bother to download the separate attachment and skip over this thread.

    Your problem is that you're using double quotes as your string delimiter, but you're not escaping literal double quotes inside the string. To solve this, you can either:

    • Escape all double quotes by prepending them with a backslash

    • Change your string delimiter to be a single quote instead (no escaping required - you don't use any single quotes within the string)

    For more information on the basic syntax of strings, see this manual page: [man]language.types.string[/man].

      ok i can change that but it doesn't solve my issue because that is not the only code on the page here is the full coding in the file...and it is too big to post so here is the attachment.

      Lines 182-234 are in question (just for reference)

        You still have the same problem on line 190:

        echo" <font color="#76A5D5" size="4" face="verdana"><b>Recruiting Is Closed!</b></font>";

        See my above post on how to fix this line.

        As for the echo you start on line 194... get rid of it. IIRC, the script closed the PHP tag at this point, so do that. If you're just outputting a bunch of HTML, it's usually simpler to escape out of PHP and then re-open the <?PHP tag when you have to (e.g. on line 229, where you closed your newly added echo statement).

        EDIT: To clarify, in the original version of your code that you posted, the aforementioned line #190 was the only line I saw an error in (i.e. the only line I was suggesting you change).

          ok i can fix that line but how do i go about the rest of it? yaya i know noob lol

            I just edited my post above to clarify (I think we're playing tag with our edits/replies) - the only line you needed to change was line 190.

            Which don't you understand - what line 190 should look like, or why the lines underneath it are wrong now?

            EDIT: Yep, we're definitely playing tag at this point. Okay, basically, you need to revert back to the way those lines were before. Get rid of the echo (don't forget the ending '; you added!), and just escape out of the PHP tags. For an example, look at line 297 (where a bunch of HTML starts) and line 314 (where we go back to PHP code).

              ok can you show me how to code the form and validator so it will all work? that is what i need help with because i dunno what to do anymore

              EDIT:

              ok so would it look like this?

              if($_GET['view'] == "JoinUs") {
               require("functions.php");				
              $query = @mysql_query("SELECT recruiting, security_status, total FROM status");
              $row_status = mysql_fetch_array($query);
              
              if($row_status['total'] >= 350 || $row_status['recruiting'] == 1) {
                                  echo' <font color="#76A5D5" size="4" face="verdana"><b>Recruiting Is Closed!</b></font>';
              					} else {
              
              (then form validator script...would javascript work in here?)
              
              (then form)
              
              ?>
              <form method="post" name="JoinRequest" action="sendit.php">
              
              <?php
              $ipi = getenv("REMOTE_ADDR");
              $httprefi = getenv ("HTTP_REFERER");
              $httpagenti = getenv ("HTTP_USER_AGENT");
              ?>
              
              <input type="hidden" name="ip" value="<?php echo $ipi ?>"/>
              <input type="hidden" name="httpref" value="<?php echo $httprefi ?>"/>
              <input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>"/>
              <br />
              <b><font color="#76A5D5" size="2" face="verdana">Socom Name:&nbsp;&nbsp;</font></b>
              <input name="visitor" type="text" id="visitor" size="35"/>
              <br />
              <br />
              <b><font color="#76A5D5" size="2" face="verdana">Email Address:</font></b>&nbsp;
              <input type="text" name="visitormail" size="35"/>
              <br />
              <br />
              <b><font color="#76A5D5" size="2" face="verdana">Version Trying For:</font></b>&nbsp;
              <select name="attn" size="1">
              <option value=" Socom1 ">Socom </option>
              <option value=" Socom2 ">Socom 2 </option>
              <option value=" Socom3 ">Socom 3 </option>
              <option value=" Socom4 ">Combined Assult </option>
              </select>
              <br /><br />
              <input type="checkbox" name="notes" value="checkbox"/>
              <font color="#76A5D5" size="1" face="verdana">I Have Read And Agree To Follow The <strong><a href="index.php?view=Rules">Clan Rules</font></a></strong><br />
              <br />
              <input type="submit" value="Submit" name="submit_button">
              </form>
              <font color="#FF0000">**</font><font color="#76A5D5" size="1" face="verdana">All  Applications will be reviewed in a timely manner. Any questions or concerns belong on our <b><a href="forum/index.php">Forum</a></b></font><br />
              <br />
              
              (Then Rest?)
              
              include('footer.php');
              }
                Write a Reply...