Jump to content

Saving data from a webform


butty22

Recommended Posts

Hey Guys, am new to php and new some help.

 

i have got a form designed for our site(it is really big with various sections on the fom). i have also created multiple tables on the MySql database matching the various sections on this form.

 

my question is how do i link these multiple tables together so that when the form is filled and completed, the data on the form is written to the database. At the moment, when the form is submitted, it currently sends the data to an email address but i would also like it to write to the database for future reference.

 

Note: each of the tables have their individual ids and the total number of tables is about 8.

 

Any help is greatly appreciated. thanks

Link to comment
Share on other sites

Something like this:

 

mysql_query("INSERT INTO table1,table2,table3 (table1.something, table2.somethingelse, table3.anotherthing) VALUES ('something', 'something', 'something')") or die(mysql_error());

 

At least, I think you can do that.

Link to comment
Share on other sites

Do you want to insert it into 1 table or 2? I'm unsure, now rereading your original post.

 

Ok, say you have this:

<input type="text" name="something" />

 

And you want to insert it into your database, do this:

$something = $_POST['something'];
mysql_query("INSERT INTO yourtable (field) VALUES ('$something')");

 

I suggest you look up a mysql tutorial if you are unable to adapt this.

Link to comment
Share on other sites

<?php

if (isset($_POST['submitbutton']))
{
  $value1 = mysql_real_escape_string($_POST['value1']);
  $value2 = mysql_real_escape_string($_POST['value2']);

  mysql_query("INSERT INTO table (value1, value2) VALUES ('$value1', '$value2')");
}

?>

<html>
<head>
<title>My Form</title>
</head>
<body>

<form method="post">
<input name="value1" type="text">
<input name="value2" type="text">
<input name="submitbutton" type="submit" value="Submit Form">
</form>

</body>
</html>

Link to comment
Share on other sites

i have inserted the code as advised but when i tried to fill the form and clicked submit, nothing was saved on the tables in mysql database. below is the code i used

<?php

if (isset($_POST['submitbutton']))
{
  $name=proposeduni = mysql_real_escape_string($_POST['name=proposeduni']);
  $name=proposedcourse = mysql_real_escape_string($_POST['name=proposedcourse']);

  mysql_query("INSERT INTO table courses (proposed coluni, proposed course) VALUES ('$name=proposeduni', '$name=proposedcourse')");
}

?>

and this is the code for my form

 

thanks

Link to comment
Share on other sites

<HTML>
<HEAD><TITLE>Spear New Candidate Registration Form</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content=Word.Document name=ProgId>
<META content="Microsoft Word 12" name=Originator><LINK href="index_files/filelist.xml" rel=File-List><LINK href="index_files/editdata.mso" rel=Edit-Time-Data><LINK href="index_files/oledata.mso" rel=OLE-Object-Data>
<STYLE>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</STYLE>
<LINK href="index_files/themedata.thmx" rel=themeData><LINK href="index_files/colorschememapping.xml" rel=colorSchemeMapping>
<STYLE>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1073750139 0 0 159 0;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:1627400839 -2147483648 8 0 66047 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman","serif";
mso-fareast-font-family:"Times New Roman";}
p.MsoHeader, li.MsoHeader, div.MsoHeader
{mso-style-priority:99;
mso-style-unhide:no;
mso-style-link:"Header Char";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
tab-stops:center 225.65pt right 451.3pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
mso-fareast-font-family:"Times New Roman";}
p.MsoFooter, li.MsoFooter, div.MsoFooter
{mso-style-priority:99;
mso-style-unhide:no;
mso-style-link:"Footer Char";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
tab-stops:center 225.65pt right 451.3pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
mso-fareast-font-family:"Times New Roman";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-unhide:no;
mso-style-link:"Balloon Text Char";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";
mso-fareast-font-family:"Times New Roman";}
span.MsoPlaceholderText
{mso-style-noshow:yes;
mso-style-priority:99;
mso-style-unhide:no;
color:gray;}
span.z-TopofFormChar
{mso-style-name:"z-Top of Form Char";
mso-style-priority:99;
mso-style-unhide:no;
mso-style-locked:yes;
mso-style-link:"z-Top of Form";
mso-ansi-font-size:8.0pt;
mso-bidi-font-size:8.0pt;
font-family:"Arial","sans-serif";
mso-ascii-font-family:Arial;
mso-hansi-font-family:Arial;
mso-bidi-font-family:Arial;
display:none;
mso-hide:all;}
span.z-BottomofFormChar
{mso-style-name:"z-Bottom of Form Char";
mso-style-priority:99;
mso-style-unhide:no;
mso-style-locked:yes;
mso-style-link:"z-Bottom of Form";
mso-ansi-font-size:8.0pt;
mso-bidi-font-size:8.0pt;
font-family:"Arial","sans-serif";
mso-ascii-font-family:Arial;
mso-hansi-font-family:Arial;
mso-bidi-font-family:Arial;
display:none;
mso-hide:all;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-unhide:no;
mso-style-locked:yes;
mso-style-link:"Balloon Text";
mso-ansi-font-size:8.0pt;
mso-bidi-font-size:8.0pt;
font-family:"Tahoma","sans-serif";
mso-ascii-font-family:Tahoma;
mso-hansi-font-family:Tahoma;
mso-bidi-font-family:Tahoma;}
span.white1
{mso-style-name:white1;
mso-style-unhide:no;
mso-ansi-font-size:8.5pt;
mso-bidi-font-size:8.5pt;
color:white;
mso-text-animation:none;
text-decoration:none;
text-underline:none;
text-decoration:none;
text-line-through:none;}
span.text
{mso-style-name:text;
mso-style-unhide:no;}
span.HeaderChar
{mso-style-name:"Header Char";
mso-style-priority:99;
mso-style-unhide:no;
mso-style-locked:yes;
mso-style-link:Header;
mso-ansi-font-size:12.0pt;
mso-bidi-font-size:12.0pt;}
span.FooterChar
{mso-style-name:"Footer Char";
mso-style-priority:99;
mso-style-unhide:no;
mso-style-locked:yes;
mso-style-link:Footer;
mso-ansi-font-size:12.0pt;
mso-bidi-font-size:12.0pt;}
span.SpellE
{mso-style-name:"";
mso-spl-e:yes;}
span.GramE
{mso-style-name:"";
mso-gram-e:yes;}
/* Page Definitions */
@page
{mso-footnote-separator:url("index_files/header.htm") fs;
mso-footnote-continuation-separator:url("index_files/header.htm") fcs;
mso-endnote-separator:url("index_files/header.htm") es;
mso-endnote-continuation-separator:url("index_files/header.htm") ecs;}
@page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
mso-header-margin:35.4pt;
mso-footer-margin:35.4pt;
mso-title-page:yes;
mso-header:url("index_files/header.htm") h1;
mso-footer:url("index_files/header.htm") f1;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</STYLE>
</HEAD>
<BODY lang=EN-GB style="BACKGROUND: #ffffff; MARGIN: 15px 10px; tab-interval: 36.0pt">
<FORM action="http://www.spearventures.net/cgi-bin/FormMail.pl " method=post><INPUT type=hidden value=edu.enquiries@spearventures.net name=recipient> <INPUT type=hidden value="New Cand Form" name=subject> <INPUT type=hidden value=http://www.spearventures.net name=redirect> 
<DIV class=Section1>
<TABLE class=MsoNormalTable style="WIDTH: 1408px; BORDER-COLLAPSE: collapse; HEIGHT: 26px; mso-border-alt: solid #7BA0CD 1.0pt; mso-yfti-tbllook: 1184; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-border-insideh: 1.0pt solid #7BA0CD; mso-border-insidev: 1.0pt solid #7BA0CD" cellSpacing=0 cellPadding=0 border=1>
<TBODY>
<TR>
<TD style="BORDER-RIGHT: #7ba0cd 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: medium none; PADDING-LEFT: 5.4pt; BACKGROUND: #a7bfde; PADDING-BOTTOM: 0cm; BORDER-LEFT: #7ba0cd 1pt solid; WIDTH: 426.1pt; PADDING-TOP: 0cm; BORDER-BOTTOM: #7ba0cd 1pt solid; mso-border-top-alt: solid #7BA0CD 1.0pt" vAlign=top width=568>
<P class=MsoNormal style="TEXT-ALIGN: center" align=center><B><SPAN style="FONT-SIZE: 14pt; FONT-FAMILY:" Calibri?,?sans-serif??><FONT color=#0000c0>NEW CANDIDATE REGISTRATION FORM<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></SPAN></B></P></TD></TR></TBODY></TABLE>
<P class=MsoNormal style="tab-stops: 332.25pt"><SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY:" Calibri?,?sans-serif??><SPAN style="mso-spacerun: yes">                   </SPAN><SPAN style="mso-spacerun: yes">                </SPAN><o:p></o:p></SPAN></P>
<TABLE class=MsoNormalTable style="WIDTH: 100%; mso-yfti-tbllook: 1184; mso-padding-alt: 3.0pt 3.0pt 3.0pt 3.0pt; mso-cellspacing: 1.5pt; mso-table-lspace: 2.25pt; mso-table-rspace: 2.25pt; mso-table-anchor-vertical: paragraph; mso-table-anchor-horizontal: column; mso-table-left: left" cellPadding=0 width="100%" align=left border=0>
<TBODY>
<TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes">
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #1569ad; PADDING-BOTTOM: 3pt; WIDTH: 99.3%; PADDING-TOP: 3pt" width="99%" colSpan=2>
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> </SPAN><SPAN class=white1><B><SPAN style="FONT-SIZE: 8.5pt; FONT-FAMILY:" Arial?,?sans-serif??>Courses:</SPAN></B></SPAN><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??><o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 1">
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #efefef; PADDING-BOTTOM: 3pt; WIDTH: 49.26%; PADDING-TOP: 3pt" width="49%">
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <B>Proposed University / College:</B><o:p></o:p></SPAN></P></TD>
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #efefef; PADDING-BOTTOM: 3pt; WIDTH: 49.68%; PADDING-TOP: 3pt" width="49%">
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??><INPUT maxLength=150 size=49 name=proposeduni><o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 2">
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #efefef; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt">
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <B>Proposed Course Title:</B><o:p></o:p></SPAN></P></TD>
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #efefef; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt">
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??><INPUT maxLength=100 size=49 name=proposedcourse><o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 3">
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #efefef; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt">
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <B>Permanent home address:</B><o:p></o:p></SPAN></P></TD>
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #efefef; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt">
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??><TEXTAREA name=permaddress cols=37></TEXTAREA><o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 13">
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #efefef; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt">
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <B>Tel:</B>  (including dialling codes)<o:p></o:p></SPAN></P></TD>
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #efefef; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt">
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??><INPUT size=30 name=tel><o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 14">
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #efefef; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt">
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <B>Fax:</B>  (including dialling codes)<o:p></o:p></SPAN></P></TD>
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #efefef; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt">
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??><INPUT size=30 name=fax><o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 15">
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #efefef; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt">
<P class=MsoNormal style="TEXT-ALIGN: center; mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly" align=center><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <INPUT maxLength=255 size=18 name=proname2><o:p></o:p></SPAN></P></TD>
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #f7f7f7; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt" vAlign=top>
<P class=MsoNormal style="TEXT-ALIGN: center; mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly" align=center><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <TEXTAREA name=prosubjects2 cols=24></TEXTAREA><o:p></o:p></SPAN></P></TD>
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #f7f7f7; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt" vAlign=top>
<P class=MsoNormal style="TEXT-ALIGN: center; mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly" align=center><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <INPUT maxLength=255 size=15 name=prolevel2><o:p></o:p></SPAN></P></TD>
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #f7f7f7; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt" vAlign=top>
<P class=MsoNormal style="TEXT-ALIGN: center; mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly" align=center><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <INPUT size=15 name=proyeartaken2><o:p></o:p></SPAN></P></TD></TR></TBODY></TABLE>
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??><o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 21">
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #efefef; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt" colSpan=2>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt; mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <B>Work Experience:</B><o:p></o:p></SPAN></P>
<TABLE class=MsoNormalTable style="BACKGROUND: #cccccc; WIDTH: 100%; mso-yfti-tbllook: 1184; mso-padding-alt: 3.0pt 3.0pt 3.0pt 3.0pt; mso-cellspacing: .7pt" cellSpacing=1 cellPadding=0 width="100%" border=0>
<TBODY>
<TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes">
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #f7f7f7; PADDING-BOTTOM: 3pt; WIDTH: 21.16%; PADDING-TOP: 3pt" width="21%" rowSpan=2>
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <B>Job Title:</B><o:p></o:p></SPAN></P></TD>
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #f7f7f7; PADDING-BOTTOM: 3pt; WIDTH: 21.16%; PADDING-TOP: 3pt" width="21%" rowSpan=2>
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <B>Name of<BR> Organisation:</B><o:p></o:p></SPAN></P></TD>
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #f7f7f7; PADDING-BOTTOM: 3pt; WIDTH: 18.08%; PADDING-TOP: 3pt" width="18%" rowSpan=2>
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <B>Full time or<BR> Part time:</B><o:p></o:p></SPAN></P></TD>
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #f7f7f7; PADDING-BOTTOM: 3pt; WIDTH: 19.28%; PADDING-TOP: 3pt" width="19%" colSpan=2>
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <B>From:</B><o:p></o:p></SPAN></P></TD>
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #f7f7f7; PADDING-BOTTOM: 3pt; WIDTH: 19.28%; PADDING-TOP: 3pt" width="19%" colSpan=2>
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <B>To:</B><o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 1">
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #f7f7f7; PADDING-BOTTOM: 3pt; WIDTH: 9.42%; PADDING-TOP: 3pt" width="9%">
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <B>Month:</B><o:p></o:p></SPAN></P></TD>
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #f7f7f7; PADDING-BOTTOM: 3pt; WIDTH: 9.7%; PADDING-TOP: 3pt" width="9%">
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <B>Year:</B><o:p></o:p></SPAN></P></TD>
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #f7f7f7; PADDING-BOTTOM: 3pt; WIDTH: 9.42%; PADDING-TOP: 3pt" width="9%">
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <B>Month:</B><o:p></o:p></SPAN></P></TD>
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #f7f7f7; PADDING-BOTTOM: 3pt; WIDTH: 9.7%; PADDING-TOP: 3pt" width="9%">
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <B>Year:</B><o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 2">
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #f7f7f7; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt">
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <INPUT maxLength=255 size=18 name=jobtitle1><o:p></o:p></SPAN></P></TD>
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #f7f7f7; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt">
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <INPUT maxLength=255 size=18 name=orgname1><o:p></o:p></SPAN></P></TD>
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #f7f7f7; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt">
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <INPUT maxLength=50 size=11 name=fullpart1><o:p></o:p></SPAN></P></TD>
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #f7f7f7; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt">
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN style="FONT-SIZE: 8.5pt; COLOR: #333333; FONT-FAMILY:" Arial?,?sans-serif??> <INPUT size=5 name=frommonth1><o:p></o:p></SPAN></P></TD>
<TD style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; BACKGROUND: #f7f7f7; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt">
<P class=MsoNormal style="mso-element: frame; mso-element-frame-hspace: 2.25pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: column; mso-height-rule: exactly"><SPAN class=text></SPAN><SPAN style="FONT-SIZE: 8pt"></SPAN><SPAN style="FONT-SIZE: 8pt"></SPAN><SPAN style="FONT-SIZE: 8pt"><FONT face="Arial, Helvetica, Sans-Serif"></FONT></SPAN> </P>
<P class=MsoNormal><SPAN style="FONT-SIZE: 8pt"><FONT face="Arial, Helvetica, Sans-Serif">Candidate’s Signature:<INPUT value="Put your name here" name=cansig>      Date: <INPUT name=cansigdate></FONT> 
<P></P><INPUT type=submit value=SUBMIT name=submit> </SPAN>
<P></P>
<P class=MsoFooter><SPAN style="FONT-SIZE: 8.5pt; FONT-FAMILY:" Arial?,?sans-serif??></SPAN> </P>
<P class=MsoFooter><SPAN style="FONT-SIZE: 8.5pt; FONT-FAMILY:" Arial?,?sans-serif??></SPAN> </P>
<P class=MsoFooter><SPAN style="FONT-SIZE: 8.5pt; FONT-FAMILY:" Arial?,?sans-serif??>
<TABLE style="LEFT: 116px; POSITION: absolute; TOP: 3819px; BORDER-COLLAPSE: collapse" borderColor=#000000 height=19 cellSpacing=0 cellPadding=0 width=79 border=1>
<TBODY>
<TR></TD></TR></TBODY></TABLE></SPAN><SPAN style="FONT-SIZE: 8.5pt; FONT-FAMILY:" Arial?,?sans-serif??></SPAN><SPAN style="FONT-SIZE: 8.5pt; FONT-FAMILY:" Arial?,?sans-serif??></SPAN><SPAN style="FONT-SIZE: 8.5pt; FONT-FAMILY:" Arial?,?sans-serif??></SPAN></P>
<P class=MsoFooter><SPAN style="FONT-SIZE: 8.5pt; FONT-FAMILY:" Arial?,?sans-serif??></SPAN> </P>
<P class=MsoFooter><SPAN style="FONT-SIZE: 8.5pt; FONT-FAMILY:" Arial?,?sans-serif??></SPAN> </P>
<P class=MsoFooter><SPAN style="FONT-SIZE: 8.5pt; FONT-FAMILY:" Arial?,?sans-serif??></SPAN> </P>
<P class=MsoFooter><SPAN style="FONT-SIZE: 8.5pt; FONT-FAMILY:" Arial?,?sans-serif??></SPAN> </P>
<P class=MsoFooter><SPAN style="FONT-SIZE: 8.5pt; FONT-FAMILY:" Arial?,?sans-serif??></SPAN> </P>
<P class=MsoFooter><SPAN style="FONT-SIZE: 8.5pt; FONT-FAMILY:" Arial?,?sans-serif??>© Spear Ventures Ltd<o:p></o:p></SPAN></P></SPAN><o:p></o:p></SPAN></TD></TR></TBODY></TABLE>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal><o:p> </o:p></P></DIV></FORM></BODY>

 

 

 

Link to comment
Share on other sites

at the moment, i have inserted the below code

<?php
function MySQLDB(){
      /* Make connection to database */
      $this->connection = mysql_connect(localhost, x_n, x) or die(mysql_error());
      mysql_select_db(spearventures_n, $this->connection) or die(mysql_error());

if (isset($_POST['submitbutton']))
{
  $name=proposeduni = mysql_real_escape_string($_POST['name=proposeduni']);
  $name=proposedcourse = mysql_real_escape_string($_POST['name=proposedcourse']);
  mysql_query("INSERT INTO courses (proposed_coluni, proposed_course) VALUES ('$name=proposeduni', '$name=proposedcourse')")or die(mysql_error();
}
?>
<HTML>
<HEAD><TITLE>Spear New Candidate Registration Form</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">

 

however i am getting the attached screen error message

 

 

[attachment deleted by admin]

Link to comment
Share on other sites

When asking for help you need to be as specific as possible to the problem and give as much information as possible to help with the issue as none of us here have crystal balls and we can't see your screen.

 

Please post any error messages you're getting and when given a line number, that line of code in the script and the previous view lines as well as errors in PHP can originate from an earlier place in the code.

Link to comment
Share on other sites

Yeah, why attach stuff? Can you not just post your error message?

I can't even open that file on this pc (I'm at school).

 

And either your haven't posted your entire code, or your connect function is missing a } bracket, and it's half object oriented.

Link to comment
Share on other sites

right at the moment, this is my current code...managed to get rid of the error message but its still not writing to my database...just to clarify wha i want is once the form is submitted, it writes the data within the form to the database as well as emailing the data to us... at the moment the email bit works but it doesnt write to the database... i inserted this code at the beginning of my code before the <html> tags began but it didnt do anything...rightnow it is inserted within the body of the form where i have got form action...

<BODY lang=EN-GB style="BACKGROUND: #ffffff; MARGIN: 15px 10px; tab-interval: 36.0pt">
<FORM action="http://www.spearventures.net/cgi-bin/FormMail.pl " method=post><INPUT type=hidden value=edu.enquiries@spearventures.net name=recipient> <INPUT type=hidden value="New Cand Form" name=subject> <INPUT type=hidden value=http://www.spearventures.net name=redirect> 
<?php
if (isset($_POST['submitbutton']))
{
$connection = mysql_connect('localhost', 'xxxx','xxxx') or die(mysql_error());
mysql_select_db('spearventures_n', $connection) or die(mysql_error());
  $proposeduni = mysql_real_escape_string($_POST['proposeduni']);
  $proposedcourse = mysql_real_escape_string($_POST['proposedcourse']);
  mysql_query("INSERT INTO courses (proposed_coluni, proposed_course) VALUES ('$proposeduni', '$proposedcourse')")or die(mysql_error();
}
?>
<DIV class=Section1>

 

thanks

Link to comment
Share on other sites

i dont get anything... i have just changed the code to the following

<FORM action="http://www.spearventures.net/cgi-bin/FormMail.pl " method=post><INPUT type=hidden value=edu.enquiries@spearventures.net name=recipient> <INPUT type=hidden value="New Cand Form" name=subject> <INPUT type=hidden value=http://www.spearventures.net name=redirect><action="input.php"> 

 

and my input.php code is

<?php
if (isset($_POST['submitbutton']))
{
$connection = mysql_connect("localhost", "xxxx","xxxx");
if (!$connection)
  {
die('Could not connect: ' . mysql_error());
  }
mysql_select_db("spearventures_n", $connection) or die(mysql_error());
  $proposeduni = mysql_real_escape_string($_POST['proposeduni']);
  $proposedcourse = mysql_real_escape_string($_POST['proposedcourse']);
  $query = "INSERT INTO courses (proposed_coluni, proposed_course) VALUES ('$proposeduni', '$proposedcourse')";
  if (mysql_query($query)) {
     print 'Successfully inserted<br />';
} else {
     print 'Not inserted<br />';
  } // mysql_query
}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.