Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [CSS][PHP]Wygląd formularza
Forum PHP.pl > Forum > Przedszkole
UszaTek
Witam. Posiadam formularz kontaktowy lecz chciałbym zmienić jego wygląd.
Obecnie wygląda tak:



Taki efekt chciałbym:



Mój kod:
Kod
<?php
require_once __DIR__.'/maincore.php';
require_once THEMES.'templates/header.php';

if (count($_POST))
{
$email = 'support@cash-online.pl';
$subject = 'Kontakt';
$message = '<div class="shadowbox"><img src="https://nw.ct8.pl/images/favicons/1a.svg" alt="1a.svg (5 KB)" width="165" height="136" /><h2>Dziękujemy za wypełnienie formularza kontaktowego.</h2></div>';
$error = 'Wystąpił błąd podczas wysyłania formularza';
$charset = 'utf-8';

$head =
"MIME-Version: 1.0rn" .
"Content-Type: text/plain; charset=$charsetrn" .
"Content-Transfer-Encoding: 8bit";
$body = '';
foreach ($_POST as $name => $value)
{
if (is_array($value))
{
for ($i = 0; $i < count($value); $i++)
{
$body .= "$name=" . (get_magic_quotes_gpc() ?

stripslashes($value[$i]) : $value[$i]) . "rn";
}
}
else $body .= "$name=" . (get_magic_quotes_gpc() ? stripslashes($value) :

$value) . "rn";
}
echo mail($email, "=?$charset?B?" . base64_encode($subject) . "?=", $body, $head) ?

$message : $error;
}
else
{
?><center><div class="shadowbox">
<form action="?" method="post">

E-mail:<p></p>
<input type="text" name="e-mail" /><p></p>

Temat:<p></p>
<input type="text" name="Temat" /><p></p>

Treść wiadomości:<p></p>
<textarea name="Tresc wiadomosci"rows="10" cols="55"required></textarea>
</p>

<input type="submit" />
<button type="reset">Zresetuj</button>
</form></div><div class="shadowbox">
<?php
}
?>

<? require_once THEMES.'templates/footer.php';?>


Kod z którego chciałbym wyciągać wygląd:
Kod
<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) PHP Fusion Inc
| https://phpfusion.com/
+--------------------------------------------------------+
| Filename: contact.php
| Author: Core Development Team
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once __DIR__.'/maincore.php';
require_once THEMES.'templates/header.php';
require_once THEMES."templates/global/contact.tpl.php";

$settings = fusion_get_settings();
$locale = fusion_get_locale('', LOCALE.LOCALESET.'contact.php');
add_to_title($locale['CT_400']);

$input = [
    'mailname'     => '',
    'email'        => '',
    'subject'      => '',
    'message'      => '',
    'captcha_code' => '',
];

if (isset($_POST['sendmessage'])) {
    foreach ($input as $key => $value) {
        if (isset($_POST[$key])) {
            // Subject needs 'special' treatment
            if ($key == 'subject') {
                $input['subject'] = substr(str_replace(["\r", "\n", "@"], "", descript(stripslashes(trim($_POST['subject'])))), 0, 128);
                $input['subject'] = form_sanitizer($input['subject'], $input[$key], $key);
                // Others don't
            } else {
                $input[$key] = form_sanitizer($_POST[$key], $value, $key);
            }
            // Input not posted, fallback to the default
        } else {
            $input[$key] = form_sanitizer($value, $value, $key);
        }
    }

    if (!iADMIN && $settings['display_validation']) {
        $_CAPTCHA_IS_VALID = FALSE;
        include INCLUDES."captchas/".$settings['captcha']."/captcha_check.php"; // Dynamics need to develop Captcha. Before that, use method 2.
        if (!$_CAPTCHA_IS_VALID) {
            fusion_stop();
            addnotice('warning', $locale['CT_424']);
        }
    }

    if (fusion_safe()) {
        require_once INCLUDES."sendmail_include.php";

        $template_result = dbquery("SELECT template_key, template_active, template_sender_name, template_sender_email
            FROM ".DB_EMAIL_TEMPLATES."
            WHERE template_key='CONTACT'
            LIMIT 1
        ");

        if (dbrows($template_result)) {

            $template_data = dbarray($template_result);
            if ($template_data['template_active'] == "1") {
                if (!sendemail_template("CONTACT", $input['subject'], $input['message'], "",
                    $template_data['template_sender_name'], "", $template_data['template_sender_email'],
                    $input['mailname'], $input['email'])) {
                    fusion_stop();
                    addnotice('danger', $locale['CT_425']);
                }
            } else {
                if (!sendemail($settings['siteusername'], $settings['siteemail'], $input['mailname'], $input['email'], $input['subject'], $input['message'])) {
                    fusion_stop();
                    addnotice('danger', $locale['CT_425']);
                }
            }

        } else {
            if (!sendemail($settings['siteusername'], $settings['siteemail'], $input['mailname'], $input['email'], $input['subject'], $input['message'])) {
                fusion_stop();
                addnotice('danger', $locale['CT_425']);
            }
        }

        if (fusion_safe()) {
            addnotice('success', $locale['CT_440']);
            redirect(BASEDIR.'contact.php');
        }
    }
}

$site_email = hide_email(fusion_get_settings('siteemail'));
$info['message'] = str_replace(
    ["[PM_LINK]", "[SITE_EMAIL]"],
    ["<a href='messages.php?msg_send=1'>".$locale['global_121']."</a>", $site_email],
    $locale['CT_401']
);
$info['input'] = $input;

$info['captcha_code'] = '';

if (iGUEST) {
    include INCLUDES.'captchas/'.$settings['captcha'].'/captcha_display.php';
    $captcha_settings = [
        'captcha_id' => 'captcha_contact',
        'input_id'   => 'captcha_code_contact',
        'image_id'   => 'captcha_image_contact'
    ];

    $info['captcha'] = display_captcha($captcha_settings);
    if (!isset($_CAPTCHA_HIDE_INPUT) || (!$_CAPTCHA_HIDE_INPUT)) {
        $info['captcha_code'] = form_text('captcha_code', $locale['CT_408'], '', [
            'required'         => TRUE,
            'autocomplete_off' => TRUE,
            'input_id'         => 'captcha_code_contact'
        ]);
    }
}

echo openform('contactform', 'post');
render_contact_form($info);
echo closeform();

require_once THEMES.'templates/footer.php';
viking
Dopasuj sobie https://jsfiddle.net/sryb92az/
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.