View Full Version : Website forms
Admiral Huddy
29-11-2007, 11:46
I'm a complete noob when it comes to website building so I need some help with forms.
I've created a test page here.. (ignore the heading)
http://www.admiralcomputers.co.uk/test.shtml
Ok so basically I need to know how to consolidate the data and place into a database or and email, either is fine, when pressing the submit button.
Any advice would be appreciated.
Thanks
Davey_Pitch
29-11-2007, 12:32
The way it generally works is that the form interacts with a CGI or PHP script which is hosted on your site. The script will format the data in the form and email it to an address that you specify. There are tons of scripts on the web which will work easily (and freely), so all you'll need to know is whether your host supports PHP or CGI scripting.
Admiral Huddy
29-11-2007, 12:40
I know it supprts PHP scripting as I've some on their already :)
The first form I came up with used this to make it all... http://phpformgen.sourceforge.net/
It was pretty good and gives you a step by step interface to create the form.
I now use something totally different but it won't help you as it uses at backend package to capture the data.
Admiral Huddy
29-11-2007, 12:48
What sort of backend package? For retail?
Nope. It's a customer relationship manager (CRM) called SugarCRM.
Admiral Huddy
29-11-2007, 14:09
Ok here's the generated form...
http://www.admiralcomputers.co.uk/form.html
:)
No i've ported the code to on of my templates
http://www.admiralcomputers.co.uk/form2.shtml
something not quite right with the info message not folding.. Appears to looking for a class called InfoBox which I can't find... Must be there somewhere because the generated one works..
looks like you just need to add a class to your CSS called 'infobox' and style it however you want, then you'll be sorted :) well after also restyling the email boxes anyway :)
*
obviously the easiest way is to take the same css as the generated page -
a.info:hover .infobox {
font-weight: normal;
display:block;
position:absolute;
top:20px;;
left:25px;
width:205px;
height:70px;
border: 1px solid #ccc;
background:#f4f4f4 url(question.gif) no-repeat bottom right;
color:#000;
text-align:left;
font-size:0.7em;
padding-left:10px;
padding-top:10px;
}
Admiral Huddy
29-11-2007, 15:30
blimmy.. I'm glad i'm on your side.. :D
Ok I'll take that on but how come the generated one works as they are both in the same domain directory..
Admiral Huddy
29-11-2007, 15:55
sorted.. I was missing the rel="Stylesheet" in the header???
I've amended the style.css file as you indicated.. looks a little better..
LeperousDust
29-11-2007, 18:29
You menu bar still clips the main text on all those :p Fix that first ;)
Admiral Huddy
29-11-2007, 20:53
You menu bar still clips the main text on all those :p Fix that first ;)
I might need some hep with that as it was just some downloaded code. :confused:
Ok I'll take that on but how come the generated one works as they are both in the same domain directory..
nothing to do with the domain dir or owt like that...
just the CSS stylesheet on the generated code had a class to tell that description how to display, but then your test form was missing that block of code, so it didn't know what to display as...
btw, i learnt just about all i know about php/css from www.sampsonvideos.com
the guys awesome :D
american - but he's sound and does like 20/30min video tutorials
watch one on CSS and you'll soon pick it up :)
Admiral Huddy
30-11-2007, 10:35
I must admit, looking at the way css is structured, it looks far easier to minipulate and control than that of php and HTML... the problem is embedding it with HTML and php... There just seems so much for an old legacy programmer like me :p :D
Thanks for the link and advice..
I need to validate the email address are the same now.. is that easy enough?
For a cool CSS demonstration, take a look at http://www.csszengarden.com/
It's just one HTML page but there are links to select different CSS styles that people have made. It's quite impressive.
the problem is embedding it with HTML and php...
<head>
<link rel="stylesheet" type="text/css" href="/css/stylesheet.css" />
</head>
:D
Admiral Huddy
30-11-2007, 12:03
What I meant was that you have to have a good knowledge in more than one language / script and it all gets a bit confussing for an old codger like me.. :D
lol newb :P
go take a look at them videos i was on about.... if you've learnt how to code before you can do it again i'm sure.
Yup. I'm entirely self-taught on CSS/HTML/PHP and I've been programming for 20+ years. :p :)
Admiral Huddy
30-11-2007, 13:15
I will do :)
Admiral Huddy
03-12-2007, 14:38
scrubbed
Admiral Huddy
03-12-2007, 16:44
scrub the above.. I've found this that works much better and easier to understand..
http://www.admiralcomputers.co.uk/Help.shtml
Now the only problem I have is the submission: I get a message that says cannot use POST??
Admiral Huddy
03-12-2007, 17:10
#smacks own arse#
Admiral Huddy
04-12-2007, 11:53
Anyone.? I'm really stuck on this.
http://www.admiralcomputers.co.uk/Help.shtml
I can't get it to submit the details:
<form action="" name="myform" action=processor.php>
if a put a method=post, then i get an error.
Method Not Allowed
The requested method POST is not allowed for the URL /Help.shtml.
Apache/1.3.39 Server at www.admiralcomputers.co.uk (http://www.admiralcomputers.co.uk) Port 80
here's the processor php >
<?php
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/ (http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/)"));
mail("contact@admiralcomputers.co.uk","phpFormGenerator (contact@admiralcomputers.co.uk) - Form submission","Form data:
First name: " . $_POST['FirstName'] . "
Surname: " . $_POST['LastName'] . "
E-Mail address: " . $_POST['Email'] . "
Phone: " . $_POST['Phone'] . "
Operating System: " . $_POST['OperatingSystem'] . "
Problem description: " . $_POST['Problem'] . "
powered by phpFormGenerator.
");
include("index.shtml");
?>
Admiral Huddy
04-12-2007, 15:26
Anyone?
I found this but It means nothing to me:
http://vijaymodi.wordpress.com/2007/03/31/method-not-allowed-the-requested-method-post-is-not-allowed-for-the-url/
LeperousDust
04-12-2007, 16:23
Huddy i seriously would suggest doing some major reading up, rather than trying th patch copied code from multiple places. That or just pay someone to make your site. Either would a lot less hassle and much more reliable than current trends. I'd love to help but i know i can't properly with php. There are hundreds of good guides out there i don't know which is the best, but here (http://www.google.co.uk/search?hl=en&q=w3c+php&btnG=Google+Search&meta=) is probably a good bet and a good start :) As they are excellent for HTML and CSS (since they make the rules and all).
Admiral Huddy
04-12-2007, 16:50
LD no problem dude. :) Thanks for the advice you have given anyway.
but you are right. Multiple ways of doing one thing and for an old dog of a programmer like me, it gets a bit confussing to say the least.
I got rid of that code validation script in the html as you suggested :D
I was told that the CSS code I used for the nav bar was the best for what I needed but it appears that it's that that been playing up in firefox, Opera etc..
Anyway, I appear to have fixed it..
<form action="" name="myform" action=processor.php>
Dooh..
I'm an inquistive bugger and sometimes that ain't a good thing.
If you could come up with any suggestions on the nav bar that's in css, i would be greatful :)
LeperousDust
04-12-2007, 18:16
I will possibly have a go Huddy, but i'm pushed for time with exams at the minute, and working on a half built website working out what you want and have done is not my idea of fun. Much nicer building from te ground up with detailed plans set aside in my experience. You don't really have much content to lsoe on your website, so i still think it would be a good idea to go over thte basics of HTML and CSS while its still an easy fix. I bet the Beeb wish they'd done that before they launched into tables decades ago...
vBulletin® v3.7.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.