Jump to content

[SOLVED] having trouble (new b)


Lambneck

Recommended Posts

Having trouble storing form info to database.

 

here is the form:

<form name="Jobs" Method="POST">
<table id="table1" border="0" cellpadding="0" cellspacing="0">

<tr>
<td>

<tr>
<td>

<u>SELECT THE LOCATION OF YOUR SCHOOL:</u>

</td>
</tr>

<tr>
<td>

<INPUT TYPE="radio" Name="country" VALUE="China">China<br>
<INPUT TYPE="radio" Name="country" VALUE="Japan">Japan<br>
<INPUT TYPE="radio" Name="country" VALUE="Korea">Korea<br>
<INPUT TYPE="radio" Name="country" VALUE="Thailand">Thailand<br>
<INPUT TYPE="radio" Name="country" VALUE="Other">Other<br>

<br><br>

</td>
</tr>
<tr>
<td>

<u>COMPANY INFORMATION</u>

</td>
</tr>
<tr>
<td>


Company Name:


</td>
</tr>
<tr>
<td>

<INPUT TYPE="text" NAME="company_name" SIZE=30>
<br><br>
</td>
</tr>
<tr>
<td>

Address:

</td>
</tr>
<tr>
<td>

<TEXTAREA NAME="company_address" COLS=30 ROWS=3></textarea>
<br><br>
</td>
</tr>
<br><br>
<tr>
<td>

<u>YOUR INFORMATION</u>


</td>
</tr>
<tr>
<td>


Name as it appears on your credit card:


</td>
</tr>
<tr>
<td>

<INPUT TYPE="text" NAME="billing_name" SIZE=30>
<br><br>
</td>
</tr>
<tr>
<td>


Credit card billing address:


</td>
</tr>
<tr>
<td>

<INPUT TYPE="text" NAME="billing_address" SIZE=30>
<br><br>
</td>
</tr>
<tr>
<td>

Phone number:


</td>
</tr>
<tr>
<td>

<INPUT TYPE="text" NAME="phone_number" SIZE=30>
<br><br>
</td>
</tr>
<tr>
<td>


E-Mail address:


</td>
</tr>
<tr>
<td>

<INPUT TYPE="text" NAME="email" SIZE=30>
<br><br>
</td>
</tr>

<br><br>

<tr>
<td>


<u>CREDIT CARD INFORMATION</u>


</td>
</tr>
<tr>
<td>


Credit card number:


</td>
</tr>
<tr>
<td>

<INPUT TYPE="text" NAME="card_number" SIZE=30>
<br><br>
</td>
</tr>
<tr>
<td>


Credit card type:


</td>
</tr>
<tr>
<td>

<INPUT TYPE="radio" Name="cardtype" VALUE="Mastercard">Mastercard<br>
<INPUT TYPE="radio" Name="cardtype" VALUE="Visa">Visa<br>
<br>
</td>
</tr>
<tr>
<td>


Expiration date:


</td>
</tr>
<tr>
<td>

<INPUT TYPE="text" NAME="card_expiration" SIZE=30><font face="Times New Roman">MM/YY</font>
<br><br>
</td>
</tr>
<tr>
<td>


Special Instructions:


</td>
</tr>
<tr>
<td>

<TEXTAREA NAME="special_instructions" COLS=30 ROWS=3></textarea>
<br><br>
</td>
</tr>
<tr>
<td>


<i>If there are any billing problems or questions about
your ad, we will contact you.</i>


<br>
<br>
</td>
</tr>
<tr>
<td>


<u>JOB LISTING</u>
<br>
(This is your actual ad. Please enter all appropriate information.)
<br>

</td>
</tr>
<tr>
<td>


Job location:


</td>
</tr>
<tr>
<td>

<INPUT TYPE="text" NAME="subject" SIZE=50>
<br><br>
</td>
</tr>
<tr>
<td>


Job listing, including contact information:


</td>
</tr>
<tr>
<td>

<TEXTAREA NAME="message" COLS=100 ROWS=20></TEXTAREA>
<br><br>
</td>
</tr>

<br>

<tr>
<td>

<INPUT TYPE="Submit" VALUE="Submit Message" Name="submit">

  

<INPUT TYPE="Reset" VALUE="Reset Message" Name="reset">
<br><br>
</td>
</tr>
</table>
</form>

 

 

 

 

and here is the php:

 

mysql_connect($db_host, $db_user, $db_pwd);
mysql_select_db($database);

if (isset($_POST['Submit'])) 
{
$country = $_POST['country'];
$compname = $_POST['company_name'];
$compadd = $_POST['company_address'];
$billname = $_POST['billing_name'];
$billadd = $_POST['billing_address'];
$phone = $_POST['phone_number'];
$email = $_POST['email'];
$cardnum = $_POST['card_number'];
$cardtype = $_POST['cardtype'];
$cardexp = $_POST['card_expiration'];
$instructions = $_POST['special_instructions'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$submission_date = date("l M dS, Y, H:i:s");
$ip = getenv ('REMOTE_ADDR');

mysql_query("INSERT INTO $table (col_1, col_2, col_3, col_4, col_5, col_6, col_7, col_8, col_9, col_10, col_11, col_12, col_13, col_14, submission_date, ip_address) VALUES ('country', '$compname', '$compadd', '$billname', '$billadd','$phone','$email','$cardnum','$cardtype','$cardexp','$instructions','$subject','$message', '$submission_date','$ip')")or die(mysql_error());


    echo '<table id=table1><tr><td><b>Thank you, your information was was submitted.</b></td></tr>';

 

the database and table are predefined, if you see any errors in the script please help.

also if you know how i might produce an error message that could clue me into what might be the problem please enlighten me what it is and where to put it. right now when the submit button is hit the page just refreshes, with no responses, errors messages, or change other than the form being cleared.

any help is greatly appreciated.

 

Link to comment
Share on other sites

Do you have error reporting enabled?

 

You might want to put

ini_set('error_reporting', E_ALL);

As the first line of your PHP script.

 

 

And you have no action specified for the form in your HTML code

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.