Results 1 to 7 of 7

Thread: Form help

  1. #1
    Join Date
    Oct 2007
    Posts
    702
    Tokens
    0

    Default Form help

    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

  2. #2
    Join Date
    May 2007
    Location
    Brisbane, Australia
    Posts
    796
    Tokens
    0

    Default

    Post the code and ill help - Its very easy!
    Thanks,
    Chris
    Free Image Uploading

    __________________


    [/url]

    [/FONT]

  3. #3
    Join Date
    Oct 2007
    Posts
    702
    Tokens
    0

    Default

    oh yes, sorry, I forgot you guys can't view php in the source codes..

    PHP Code:
    <?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..
    }
    ?>

  4. #4
    Join Date
    May 2007
    Location
    Brisbane, Australia
    Posts
    796
    Tokens
    0

    Default

    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..
    }
    ?>
    Last edited by chrisgocrazyH; 04-04-2008 at 01:12 AM.
    Thanks,
    Chris
    Free Image Uploading

    __________________


    [/url]

    [/FONT]

  5. #5
    Join Date
    Oct 2007
    Posts
    702
    Tokens
    0

    Default

    Actually I wanted it smaller verdana size 8.

  6. #6
    Join Date
    May 2007
    Location
    Brisbane, Australia
    Posts
    796
    Tokens
    0

    Default

    This will work

    HTML Code:
    <?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:
    HTML Code:
    <font face="Verdana" size="1">
    Now that works in .htm and SOMETIMES php

    but if you want to be safe use:
    HTML Code:
    <font face=\"Verdana\" size=\"1\">
    You need to add \ slash's before the last " and at the = sign
    Last edited by chrisgocrazyH; 04-04-2008 at 01:22 AM.
    Thanks,
    Chris
    Free Image Uploading

    __________________


    [/url]

    [/FONT]

  7. #7
    Join Date
    Oct 2007
    Posts
    702
    Tokens
    0

    Default

    Thanks perfect. +rep

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •