Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Css stopped my php form from working?

Featured Replies

hi guys, Have a contact for i use quite often. It work just fine before i styled it, so i was wondering if anybody could see anything wrong. Thanks.

 

Mail.php reads

 

 

<?php

 

$subject = "Real Motoring Tuition | Website Contact Form Submission";

 

$name = $_POST['f_name'];

$postcode = $_POST['f_postcode'];

$email = $_POST['f_email'];

$number = $_POST['f_number'];

$message = $_POST['f_message'];

 

$message1 = "From: " . $name . "\n\n" . "Contact number: " . $number . "\n\n" . "postcode: " . $postcode . "\n\n" . "email: " . $email . "\n\n" . "Message: " . $message;

 

$from = "From: " . $_POST['f_name'];

 

 

 

ini_set("sendmail_from", "myemail@.co.uk ");

 

 

 

 

 

mail ( "myemail@.co.uk", $subject, $message1, $from );

header("Location: ../sent.php?name=" . $name ."");

?>

 

 

Heres the Contact form

 

 

<div id="contact_form">

<form action="mail.php" method="post">

<table width="" border="0" cellspacing="0" cellpadding="10">

<tr>

<td class="contact-text">Full Name</td>

<td><input name="f_name" type="text" class="contact_field" /></td>

</tr>

<tr>

<td class="contact-text">Postcode</td>

<td><input name="f_postcode" type="text" class="contact_field" /></td>

</tr>

<tr>

<td class="contact-text">Email</td>

<td><input name="f_email" type="text" class="contact_field" value="" /></td>

</tr>

<tr>

<td class="contact-text">Phone Number</td>

<td><input name="f_number" type="text" class="contact_field" value="" /></td>

</tr>

<tr>

<td class="contact-text">Message</td>

<td><textarea name="f_message" rows="6" class="contact_box"></textarea></td>

</tr>

<tr>

<td></td>

<td><input type="submit" class="send" value="Send" /></td>

</tr>

</table>

</form>

</div>

 

 

the includes

 

 

<?php include('includes/contact_form.php'); ?>

 

 

and the css

 

 

 

#contact_form {

margin-top:0;

margin-right:0;

height:380px;

width:465px;

font: 18px Arial, Helvetica, sans-serif;

 

}

#contact_form tr {

height: 15px;

}

.contact-text {

width:140px;

font-family: 16px/1.5em Arial, Helvetica, sans-serif;

 

color:#fff;

padding-top:0;

}

.contact_field {

border: 1px solid #CCC;

height: 30px;

font: 14px/1.5em Arial, Helvetica, sans-serif;

color: #333;

padding: 5px;

width: 270px;

background-color:#fff;

margin-top:0;

margin-left:0;

}

.contact_box {

border: 1px solid #CCC;

height: 100px;

font: 16px/1.5em Arial, Helvetica, sans-serif;

 

color: #333;

padding: 0;

margin-top: 0;

margin-left:0;

width:280px;

background-color:#fff;

}

.send {

margin-top:-20px;

margin-right:0px;

height:25px;

color:#000;

font: 14px/1.5em Arial, Helvetica, sans-serif;

float:right;

background-color:#fff;

background-color: rgba(255, 255, 255, 1);

border:3px solid rgba(255, 255, 255, 0.5);

border-bottom-left-radius:7px;

-moz-border-radius-bottomleft:7px;

border-bottom-right-radius:7px;

-moz-border-radius-bottomright:7px;

}

 

 

 

Any help would be reeeeealy appreciated. thanks :)

not sure what the issue is with the code as such, but your contact form is open to abuse from spammers since you don't filter any of your data at all

  • Author

Im putting that in Later on. Im new to php so at the moment just getting it working would be a milestone ;)

  • Author

Lol it is going to be flagged with spam haha nvm :D i will sort that soon!

  • Author

Right, i took out the css and its still not working. does it have something to do with my php includes line in my html?

  • Author

Well i am i aren't.

 

this is a link to the basic contact_form.php and mail.php files

 

http://www.ko-graphics.co.uk/rmt/includes/contact_form.php

 

simple contact form.

 

if you fill that in i will recieve it, i can guarantee you lol. and no error shows up.

 

this link which has a php line - <?php include('includes/contact_form.php'); ?> - to include it on the contact page.

 

 

You fill the form in on the contact page you get error 404

 

i just dont understand it.

 

unless there is something wrong on the includes line.

I don't understand what's wrong neither page seems to be actually submitting data. Or it just doesn't tell me that it has submitted.

 

Wanna post some source code?

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.