TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,911
  • Total Topics: 21,307
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 362
  • Total: 363
  • tino

[Done!] Join Us! form

Started by mebymyself, October 19, 2006, 08:10:13 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

JPDeni

Quote
but it seems that it is not liked for some reason

How is the "not liking" manifested? What happens?

Chevy21

#231
Well it is kicking out errors:  here is the latest one:

QuoteParse error: syntax error, unexpected '>' in /home/mysite/public_html/Sources/Load.php(1789) : eval()'d code(246) : eval()'d code on line 265

From Lines 263 - 269 are this:
<TR class ="windowbg">
<TD width = "200px">Car/Truck Number: Please make sure it is available</TD>
<TD><INPUT id="number" name="number" type="text" value ="'<b>
      <font color="#000000"><br>Car Numbers Taken<?php
include /numbers/taken.php ?>
</a></font></b>;
if (isset($_POST['number'])) echo $_POST['number'];   
echo '" /></TD>


Line 265 is:
<TD><INPUT id="number" name="number" type="text" value ="'<b>

JPDeni

The line numbers aren't accurate. The only thing they tell you is that the error is either on that line or some previous line. Could be 10, 20 or even 100 lines above.

I can't tell whether what you've posted is html or php from what you have posted. I can be pretty sure that the input field is wrong.

Try posting the whole code.

Chevy21

Hi JPDeni,

Thanks for the help.

Well the artilce is set as PHP but here is the code.  Also note the little added info came from a php script as well.

global $sourcedir, $user_info, $context ;

require_once($sourcedir . '/Subs.php');
require_once($sourcedir .'/Subs-Post.php');



// CONFIGURATION SECTION

//send the application by email?
$enable_email=true;

// email address of reqruitment staf member
$email_address='admin@cs-racin.com';

//post the application on forum?
$enable_post=true;

//board id to which the application should be posted
$board_id=10.0;

//the id of the this article
$this_article_id = '7';

//article to be redirected when form is submitted
$thank_you_article_id = '6';


//END OF CONFIGURATION SECTION

$show_form= 'true';
if (isset($_POST['submitted'])) {
// Handle the form

// Check required fields
$enroll_errors = array(); //Initialize error array

// Check for a name
if (empty($_POST['real_name']) ){
$enroll_errors[] = 'You forgot to enter your name.';
}
// Check for an email
if (empty($_POST['email']) ){
$enroll_errors[] = 'You forgot to enter your email address.';
}
// Check for an Series
if (empty($_POST['series']) ){
$enroll_errors[] = 'You forgot to tell us what series you are running.';
}
// Check for an Sierra name
if (empty($_POST['sierra_name']) ){
$enroll_errors[] = 'You forgot to enter your Sierra Nickname.';
}   
// Check for an ARCA name
if (empty($_POST['arca_name']) ){
$enroll_errors[] = 'You forgot to enter your Arca Nickname.';
}
// Check for an age
if (empty($_POST['age']) ){
$enroll_errors[] = 'You forgot to enter your age.';
}
// Check for an Rules
if (empty($_POST['rules']) ){
$enroll_errors[] = 'You forgot to tell us if you read the rules.';
}

if (empty($enroll_errors)) { //Everything seems to be OK
     
        $show_form='false';



// email an application

$subject = 'Driver Application';
$body = 'Driver application has been made by ' . $context['user']['name'] .
' from IP Address ' . $user_info['ip'] . '
Real Name:  ' . $_POST['real_name'] . '
Email address:  ' . $_POST['email'] . '
Age:  ' . $_POST['age'] . '
Gender: ' . $_POST['gender'] . '
Location:  ' . $_POST['location'] . '
Series:  ' . $_POST['series'] . '
Sierra Name:  ' . $_POST['sierra_name'] . '
Arca Name:  ' . $_POST['arca_name'] . '
Car/Truck Number:  ' . $_POST['number'] . '
Level of Racing Experience:  ' . $_POST['experience'] . '
Racing History:   ' . $_POST['history'] . '
TeamSpeak installed?:  ' . $_POST['ts'] . '
Have microphone/headset:  ' . $_POST['mic'] . '
Would like to help pay for a server?: ' . $_POST['pay'] . '
Why do you want to join our League?  ' . $_POST['why'] . '
Other information:  ' . $_POST['other'].'
Rules:  ' . $_POST['rules'];


$postbody = 'Driver application has been made by ' . $context['user']['name'] .'
[table]
[tr][td]Real Name:[/td][td]  ' . $_POST['real_name'] . '[/td][/tr]
[tr][td]Email address:[/td][td]  ' . $_POST['email'] . '[/td][/tr]
[tr][td]Age:[/td][td]  ' . $_POST['age'] . '[/td][/tr]
[tr][td]Gender: [/td][td]' . $_POST['gender'] . '[/td][/tr]
[tr][td]Location:[/td][td]  ' . $_POST['location'] . '[/td][/tr]
[tr][td]Series:[/td][td]  ' . $_POST['series'] . '[/td][/tr]
[tr][td]Current Sierra Name:[/td][td]  ' . $_POST['sierra_name'] . '[/td][/tr]
[tr][td]Current Arca Name:[/td][td]  ' . $_POST['arca_name'] . '[/td][/tr]
[tr][td]Car/Truck Number:[/td][td]  ' . $_POST['number'] . '[/td][/tr]
[tr][td]Level of Racing Experience:[/td][td]  ' . $_POST['experience'] . '[/td][/tr]
[tr][td]Racing History: [/td][td] ' . $_POST['history'] . '[/td][/tr]
[tr][td]TeamSpeak installed?: [/td][td] ' . $_POST['ts'] . '[/td][/tr]
[tr][td]Have microphone/headset: [/td][td] ' . $_POST['mic'] . '[/td][/tr]
[tr][td]Would like to help pay for a server?:[/td][td] ' . $_POST['pay'] . '[/td][/tr]
[tr][td]Why do you want to join our League? [/td][td] ' . $_POST['why'] . '[/td][/tr]
[tr][td]Other information: [/td][td] ' . $_POST['other']. '[/td][/tr]
[tr][td]Rules: [/td][td] ' . $_POST['rules']. '[/td][/tr]
[/table]';


            if ($enable_email)
mail($email_address, $subject, $body,"From: " . $_POST['email']);



//create new forum post with application

$msgOptions = array(
'id' =>  0 ,
'subject' => '[Pending] Application of ' . $context['user']['name'],
'body' => $postbody ,
'icon' => 'xx',
'smileys_enabled' => true,
'attachments' =>  array(),
);
$topicOptions = array(
'id' => 0 ,
'board' => $board_id,
'poll' =>  null,
'lock_mode' =>  null,
'sticky_mode' =>  null,
'mark_as_read' => true,
);
$posterOptions = array(
'id' => $context['user']['id'],
'name' => $context['user']['name'],
'email' => $user_info['email'],
'update_post_count' => true,
);
   
if ($enable_post)
            createPost($msgOptions, $topicOptions, $posterOptions);

// Redirect to thank you page
header('Location: http://' . $_SERVER['HTTP_HOST'] .'/index.php?page=' . $thank_you_article_id);

} else {
// Redirect to error page
//header('Location: http://' . $_SERVER['HTTP_HOST'] . '/index.php?page=' . $enroll_error_article_id );
echo '<h2 class="error">Error!</h2>';
echo '<p class="error">The following error(s) occured:<br />';

foreach ($enroll_errors as $msg) {
echo " - $msg<br />";
}
   echo "<p>Please, correct all errors and try again.</p>" ;



}
}
//else { // Display the form
echo'
<p align="center"><b><font face="Comic Sans MS" color="#FF0000" size="5">Welcome
to Championship Sim Racin League</font></b></p>
<p align="center"><b><font face="Comic Sans MS" color="#00FFFF">We are glad you
are showing interest in CSRL by filling out this application.  </font></b>
</p>
<p align="center"><b><font face="Comic Sans MS" color="#00FFFF">Please note that
you </font><font face="Comic Sans MS" color="#FF0000">MUST</font><font face="Comic Sans MS" color="#00FFFF">
Fill this application out fully and make sure you read the League Rules before
submitting.  Failure to fill in all spaces will cause your application to
be put on hold until one of our Admins make contact with you concerning the
information not filled in.  </font></b></p>
<p align="center"><b><font face="Comic Sans MS" color="#00FFFF">If you do not
Read the League Rules you will be held accountable for you actions on the track
as well as in the Forums.  </font></b></p>
<p align="center"> </p>
<p align="center"><b><font face="Comic Sans MS" color="#00FFFF">As of May 1st,
2008 all new applicants will have to start in the Rookie Series and will not be
able to run the Pro Series until the following:</font></b></p>
<p align="center"><font face="Comic Sans MS" color="#FFFF00">All new drivers
will be placed in the Rookie Series upon acceptance to CSRL. They will race
there for 4 weeks. After that, those drivers deemed qualified will be promoted
to the Pro Series on a provisional basis for another 4 weeks of evaluation.
During this provisional period, drivers may be subject to demotion to the Rookie
Series for another 4-week period. This Pro Series provisional period is designed
to see how a new driver reacts to larger fields and better drivers.</font><br>
</p>

';
echo '
<form action="index.php?page='  . $this_article_id  . '" method="post">
        <INPUT id="submitted" name="submitted" type="hidden" value="TRUE" />
<TABLE class = "bordercolor" cellSpacing="1" cellPadding="1" width="95%" border="0">
<TR class ="windowbg">
<TD width = "200px">* Your Name:</TD>
<TD><INPUT id="real_name" name="real_name" type="text" value ="';
if (isset($_POST['real_name'])) echo $_POST['real_name'];
echo '" /></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">* Email address:</TD>
<TD><INPUT id="email" name="email" type="text" value ="';
if (isset($_POST['email'])) echo $_POST['email']; else echo $user_info['email']; 
echo '" /></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">* Age:</TD>
<TD><INPUT id="age" name="age" type="text" value ="';
if (isset($_POST['age'])) echo $_POST['age'];   
echo '" /></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Gender:
</TD>
<TD><SELECT id = "gender" name = "gender" style="WIDTH: 152px" value ="';
if (isset($_POST['gender'])) echo $_POST['gender'];   
echo '" />
<OPTION value="No Answer" selected>--------------------------</OPTION>
<OPTION value="M">Male</OPTION>
<OPTION value="F">Female</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Location:</TD>
<TD><INPUT id="location" name="location" type="text" value ="';
if (isset($_POST['location'])) echo $_POST['location'];   
echo '" /></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Which Series do you want to Run?</TD>
<TD><SELECT id="series" name="series" style="WIDTH: 160px" value ="';
if (isset($_POST['series'])) echo $_POST['series'];   
echo '" />
<OPTION value="No answer" selected>--------------------------</OPTION>
<OPTION value="N2K3">N2K3</OPTION>
<OPTION value="Arca">Arca</OPTION>
<OPTION value="Both">Both</OPTION>
</SELECT></TD>
</TR>

<TR class ="windowbg">
<TD width = "200px">* Current Sierra Name:</TD>
<TD><INPUT id="sierra_name" name="sierra_name" type="text" value ="';
if (isset($_POST['sierra_name'])) echo $_POST['sierra_name'];
echo '" /></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">* Current Arca Name:</TD>
<TD><INPUT id="arca_name" name="arca_name" type="text" value ="';
if (isset($_POST['arca_name'])) echo $_POST['arca_name'];
echo '" /></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Car/Truck Number: Please make sure it is available</TD>
<TD><INPUT id="number" name="number" type="text" value ="'<b>
      <font color="#000000"><br>Car Numbers Taken<?php
include /numbers/taken.php ?>
</a></font></b>;
if (isset($_POST['number'])) echo $_POST['number'];   
echo '" /></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Level of Racing Experience?</TD>
<TD><SELECT id="experience" name="experience" style="WIDTH: 160px" value ="';
if (isset($_POST['experience'])) echo $_POST['experience'];   
echo '" />
<OPTION value="No answer" selected>--------------------------</OPTION>
<OPTION value="0-6mos">0-6mos</OPTION>
<OPTION value="6mos - 1year">6mos - 1year</OPTION>
<OPTION value="1year - 3years">1year - 3years</OPTION>
<OPTION value="3+ Years">3+ Years</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Racing History:</TD>
<TD><TEXTAREA id="history" name="history" rows="4" cols="40" value ="';
if (isset($_POST['history'])) echo $_POST['history'];   
echo '" ></' . 'TEXTAREA></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Do you have TeamSpeak installed?:</TD>
<TD><SELECT id="ts" name="ts" style="WIDTH: 160px" value ="';
if (isset($_POST['ts'])) echo $_POST['ts'];   
echo '" />
<OPTION value="No answer" selected>--------------------------</OPTION>
<OPTION value="YES">Yes</OPTION>
<OPTION value="NO">No</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Do you have microphone/headset:</TD>
<TD><SELECT id="mic" name="mic" style="WIDTH: 160px" value ="';
if (isset($_POST['mic'])) echo $_POST['mic'];   
echo '" />
<OPTION value="No answer" selected>--------------------------</OPTION>
<OPTION value="YES">Yes</OPTION>
<OPTION value="NO">No</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">Would you help pay for a server?:</TD>
<TD><SELECT id="pay" name="pay" style="WIDTH: 160px" value ="';
if (isset($_POST['pay'])) echo $_POST['pay'];   
echo '" />
<OPTION value="No answer" selected>--------------------------</OPTION>
<OPTION value="Monthly">Yes, monthly</OPTION>
<OPTION value="Occasionally">Yes, occasionally</OPTION>
<OPTION value="Not">No, not now</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Why do you want to join Championship Sim Racin League?</TD>
<TD><TEXTAREA id="why" name ="why" rows="4" cols="40" value ="';
if (isset($_POST['why'])) echo $_POST['why'];   
echo '" ></' . 'TEXTAREA></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Any other information you think can help us to make a decision:</TD>
<TD><TEXTAREA id="other" name = "other" rows="4" cols="40" value ="';
if (isset($_POST['other'])) echo $_POST['other'];   
echo '" ></' . 'TEXTAREA></TD>
</TR>
<TR class ="windowbg2">
<TD width = "200px">* Did you read the Rules?:</TD>
<TD><SELECT id="rules" name="rules" style="WIDTH: 160px" value ="';
if (isset($_POST['rules'])) echo $_POST['rules'];   
echo '" />
<OPTION value="No answer" selected>--------------------------</OPTION>
<OPTION value="YES">Yes</OPTION>
<OPTION value="NO">No</OPTION>
</SELECT></TD>
</TR>
<TR class ="windowbg2">
<TD colspan="2" align="center">
<INPUT type="submit" value="Submit">
<INPUT type="reset" value="Reset"></TD>
</TR>
</TABLE>
</form>

';

Chevy21

It worked fine before I added the:
<b>
      <font color="#000000"><br>Car Numbers Taken<?php
include /numbers/taken.php ?>
</a></font></b>


In the original code, but there was no way of checking what car numbers were actually available unless they left the application, visited the forums or whatever.

With this code it would be able to display the numbers already taken right there on the application.

JPDeni

Now I see what you did. This will not work, for several reasons.

Change this:


echo '" /></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Car/Truck Number: Please make sure it is available</TD>
<TD><INPUT id="number" name="number" type="text" value ="'<b>
      <font color="#000000"><br>Car Numbers Taken<?php
include /numbers/taken.php ?>
</a></font></b>;


to this


echo '" /></TD>
</TR>
<TR class ="windowbg">
<TD width = "200px">Car/Truck Number: Please make sure it is available</TD>
<TD><INPUT id="number" name="number" type="text" value ="';
include '/numbers/taken.php';



I don't know that the program will actually do what you want it to, but this should take care of your syntax errors.

Chevy21

Yup got rid of the errors, but like you mentioned it didn't do what I want it to do.  since this is saved as a PHP Page basically, is there a way to do this? 

JPDeni

I would have to know what's in the code in "taken.php." That might tell me what you are trying to accomplish, but I'm not sure. Can you explain exactly what you want to do?

Chevy21

Ok what I have done was create a database.  The car number that is chosen by the new applicant is placed into this database as taken once the application has been submitted.  The taken.php script basically is supposed to pull the car numbers listed in that database and posted on this application so it isn't chosen again.  Next to the entry box for the question asked what car number do you want to use.

Here is the code from the taken.php script:

<?
include 'db.php';

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Car Numbers Taken</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
table{font-family: Verdana; color: #cc9933}
-->
</style>
</head>
<body bgcolor="#C0C0C0">

<div align="left">
<table border="0" cellpadding="5" cellspacing="0" style="font-size: 9pt; border-collapse:collapse" bgcolor="#C0C0C0" bordercolor="#111111">



<?
$sql = "SELECT * FROM taken ORDER BY number";

$result = mysql_query($sql);

mysql_close($connection);

//Loop through records and display users

while ($column = mysql_fetch_array($result))
{
?>
<th>
<b><th align="left"><font color="#000000"><?echo $column["number"];?></b></td>
</th>
<? }
?>
</table></center>
</div>
<br>


</body>





<html>


When looking at the application it should look like this:

Car/Truck Number: Please make sure it is available | Entry Box | 21, 48, 75, etc (car numbers already) listed in db

Colors are used to show different things only in this reply

Hope this helps.

Chevy21

here is an image of what I am trying to accomplish.  Maybe easier to explain to display it.

TO the left you will see numbers manually entered in that are taken, but I want the taken.php script to display them to the right of the entry box.


This website is proudly hosted on Crocweb Cloud Website Hosting.