PDA

View Full Version : Form help



Alexz0r
04-04-2008, 12:55 AM
Hey how do I make the font and font size on this page different, it keeps giving errors when ever I insert the html into it?

https://myhabbo.sslpowered.com/HabbosVoice/jobs.php

chrisgocrazyH
04-04-2008, 01:01 AM
Post the code and ill help - Its very easy!

Alexz0r
04-04-2008, 01:08 AM
oh yes, sorry, I forgot you guys can't view php in the source codes..



<?php
if(isset($_POST['contact']))
//Uses the isset function to determine if the forms been posted or not.
{
$name = $_POST['name'];
$email = $_POST['email'];
$subj = $_POST['subj'];
$msg = $_POST['msg'];
$ip = $_SERVER['REMOTE_ADDR'];
//Creates variables for the post data and the users ip address.
if(!$name || !$email || !$msg)
//Checks for blank fields.
{
die("Error! Some fields were left blank! Please go back.");
//Alert the user. and kill the script.
}
else
//There's no blank fields so we continue..
{
$mail = "[email protected]";
//Change to your email address..
$subject = "$name - $subj";
//The subject of the email..
$messg = "
Name: $name
Email Address: $email
IP Address: $ip\n
Message:
$msg";
//The email message..
mail("$mail", $subject, $messg);
//Uses the mail function to send the email.
echo("Thank you for applying for <b>$subj</b> we will get back to you within 1 weeks time. Please be patient as we are very busy during this process.
<br><br>
<i>Thanks,<br>
HabbosVoice management</i>");
//The thank you message.
}
}
else
//The form hasn't been submitted..
{
echo("<p align=\"center\">
<p><form method=\"post\">
<table width=\"600\" cellspacing=\"2\" cellpadding=\"0\">
<tr><td width=\"150\">Habbo Name:</td>
<td width=\"450\"><input type=\"text\" name=\"name\" size=\"30\" /></td></tr>
<tr><td width=\"150\">Email Address:</td>
<td width=\"450\"><input type=\"text\" name=\"email\" size=\"30\" /></td></tr>
<tr><td width=\"150\">Job:</td>
<td width=\"450\"><select name=\"subj\">
<option>DJ</option>
<option>Radio Manager</option></select></td></tr>
<tr><td width=\"150\">Why do you want to work for us:</td>
<td width=\"450\"><textarea name=\"msg\" cols=\"44\" rows=\"7\"></textarea></td></tr>
<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" name=\"contact\" value=\"Apply\" /></td></tr>
</table></form></p>");
//The form..
}
?>

chrisgocrazyH
04-04-2008, 01:11 AM
So you want to make the text bigger right?
(what size)

Try this i put font to Verdana and Size to 2

<?php
if(isset($_POST['contact']))
//Uses the isset function to determine if the forms been posted or not.
{
$name = $_POST['name'];
$email = $_POST['email'];
$subj = $_POST['subj'];
$msg = $_POST['msg'];
$ip = $_SERVER['REMOTE_ADDR'];
//Creates variables for the post data and the users ip address.
if(!$name || !$email || !$msg)
//Checks for blank fields.
{
die("Error! Some fields were left blank! Please go back.");
//Alert the user. and kill the script.
}
else
//There's no blank fields so we continue..
{
$mail = "[email protected]";
//Change to your email address..
$subject = "$name - $subj";
//The subject of the email..
$messg = "
Name: $name
Email Address: $email
IP Address: $ip\n
Message:
$msg";
//The email message..
mail("$mail", $subject, $messg);
//Uses the mail function to send the email.
echo("Thank you for applying for <b>$subj</b> we will get back to you within 1 weeks time. Please be patient as we are very busy during this process.
<br><br>
<i>Thanks,<br>
HabbosVoice management</i>");
//The thank you message.
}
}
else
//The form hasn't been submitted..
{
echo("<font face=\"Verdana\" size=\"2\"><p align=\"center\">
<p><form method=\"post\">
<table width=\"600\" cellspacing=\"2\" cellpadding=\"0\">
<tr><td width=\"150\">Habbo Name:</td>
<td width=\"450\"><input type=\"text\" name=\"name\" size=\"30\" /></td></tr>
<tr><td width=\"150\">Email Address:</td>
<td width=\"450\"><input type=\"text\" name=\"email\" size=\"30\" /></td></tr>
<tr><td width=\"150\">Job:</td>
<td width=\"450\"><select name=\"subj\">
<option>DJ</option>
<option>Radio Manager</option></select></td></tr>
<tr><td width=\"150\">Why do you want to work for us:</td>
<td width=\"450\"><textarea name=\"msg\" cols=\"44\" rows=\"7\"></textarea></td></tr>
<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" name=\"contact\" value=\"Apply\" /></td></tr>
</table></form></p></font>");
//The form..
}
?>

Alexz0r
04-04-2008, 01:19 AM
Actually I wanted it smaller verdana size 8.

chrisgocrazyH
04-04-2008, 01:20 AM
This will work :)



<?php
if(isset($_POST['contact']))
//Uses the isset function to determine if the forms been posted or not.
{
$name = $_POST['name'];
$email = $_POST['email'];
$subj = $_POST['subj'];
$msg = $_POST['msg'];
$ip = $_SERVER['REMOTE_ADDR'];
//Creates variables for the post data and the users ip address.
if(!$name || !$email || !$msg)
//Checks for blank fields.
{
die("Error! Some fields were left blank! Please go back.");
//Alert the user. and kill the script.
}
else
//There's no blank fields so we continue..
{
$mail = "[email protected]";
//Change to your email address..
$subject = "$name - $subj";
//The subject of the email..
$messg = "
Name: $name
Email Address: $email
IP Address: $ip\n
Message:
$msg";
//The email message..
mail("$mail", $subject, $messg);
//Uses the mail function to send the email.
echo("Thank you for applying for <b>$subj</b> we will get back to you within 1 weeks time. Please be patient as we are very busy during this process.
<br><br>
<i>Thanks,<br>
HabbosVoice management</i>");
//The thank you message.
}
}
else
//The form hasn't been submitted..
{
echo("<font face=\"Verdana\" size=\"2\"><p align=\"center\">
<p><form method=\"post\">
<table width=\"600\" cellspacing=\"2\" cellpadding=\"0\">
<tr><td width=\"150\"><font face=\"Verdana\" size=\"1\">Habbo Name:</font></td>
<td width=\"450\"><input type=\"text\" name=\"name\" size=\"30\" /></td></tr>
<tr><td width=\"150\"><font face=\"Verdana\" size=\"1\">Email Address:</font></td>
<td width=\"450\"><input type=\"text\" name=\"email\" size=\"30\" /></td></tr>
<tr><td width=\"150\"><font face=\"Verdana\" size=\"1\">Job:</font></td>
<td width=\"450\"><select name=\"subj\">
<option>DJ</option>
<option>Radio Manager</option></select></td></tr>
<tr><td width=\"150\"><font face=\"Verdana\" size=\"1\">Why do you want to work for us:</font></td>
<td width=\"450\"><textarea name=\"msg\" cols=\"44\" rows=\"7\"></textarea></td></tr>
<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" name=\"contact\" value=\"Apply\" /></td></tr>
</table></form></p></font>");
//The form..
}
?>

The reason why your Html wasent working is because: A normal Html code looks like this:

<font face="Verdana" size="1">
Now that works in .htm and SOMETIMES php

but if you want to be safe use:

<font face=\"Verdana\" size=\"1\">
You need to add \ slash's before the last " and at the = sign

Alexz0r
04-04-2008, 01:24 AM
Thanks perfect. +rep :)

Want to hide these adverts? Register an account for free!