Jump to content


Photo

submit forum = blanks?


  • Please log in to reply
9 replies to this topic

#1 letskill

letskill
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 26 July 2006 - 12:31 AM

It's a form but whatever you enter into the fields comes up blank in the database. Thanks in advance


<?php
$link = mysql_connect(-----------);
if (!$link) {
  die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
$database = mysql_select_db('cs');

print_r($_POST);
$name = $_POST['textfield'];
$specialty = $_POST['specialty'];
$company = $_POST['company'];
$address = $_POST['address'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$telephone = $_POST['telephone'];
$email = $_POST['email'];
$licensure = $_POST['licensure'];
$certifications = $_POST['certification'];
$addcertifications = $_POST['addcertification'];
$addcomments = $_POST['addcomment'];
print($name);

/*echo("$name");
echo('\n');
$sql  = "INSERT INTO `Resume`  VALUES('','" . $name . "'," . $specialty . ",'$company','$address','$city','$state','$zip','$telephone','$email','$licensure','$certifications','$addcertifications','$addcomments')";
echo($sql);
$error = mysql_query($sql);

if ($error == TRUE)
echo('\nfucking shit worked');
else
echo(mysql_error());
*/
mysql_close($link);
?>


<form name="form1" method="post" action="thankyou.php">
            <table width="100%" height="278" border="0" cellpadding="0" cellspacing="0" class="tablespace">
              <tr>
                <td width="33%" height="278" valign="top" class="topform"><p>Registration
                    <span class="style13">- Join our team of  professionals
                    and find the right job for you</span><br>
                    <br>
                </p>
                  <p><img src="images/groupdoc.gif" width="178" height="123"></p></td>
                <td width="67%" align="left" valign="top"><table width="100%" height="424" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="38%" height="28" align="right" valign="bottom" class="form">Name</td>
                    <td width="62%" align="left" valign="bottom" class="inputspace"><input name="name" type="text"></td>
                  </tr>
                  <tr>
                    <td height="28" align="right" valign="bottom">Specialty</td>
                    <td align="left" valign="bottom" class="inputspace"><select name="specialty">
                      <option value="Allergist">Allergist</option>
                      <option value="Anesthesiology">Anesthesiology</option>
                      <option value="Cardiology">Cardiology</option>
                      <option value="Critical Care">Critical Care</option>
                      <option value="CRNA">CRNA</option>
                      <option value="Dermatology">Dermatology</option>
                      <option value="Emergency Medicine">Emergency Medicine</option>
                      <option value="Endocrinology">Endocrinology</option>
                      <option value="ENT">ENT</option>
                      <option value="Family Practice">Family Practice</option>
                      <option value="General Practice">General Practice</option>
                      <option value="General Surgery">General Surgery</option>
                      <option value="GI">GI</option>
                      <option value="Hematology/Oncology">Hematology/Oncology</option>
                      <option value="Hospitalist">Hospitalist</option>
                      <option value="Infectious Disease">Infectious Disease</option>
                      <option value="Internal Medicine">Internal Medicine</option>
                      <option value="Medical Oncology">Medical Oncology</option>
                      <option value="Neonatology">Neonatology</option>
                      <option value="Nephrology">Nephrology</option>
                      <option value="Neurology">Neurology</option>
                      <option value="NeuroSurgery">NeuroSurgery</option>
                      <option value="Nuclear Medicine">Nuclear Medicine</option>
                      <option value="Nurse Practitioner">Nurse Practitioner</option>
                      <option value="OB/GYN">OB/GYN</option>
                      <option value="Occupational Medicine">Occupational Medicine</option>
                      <option value="Oncology">Oncology</option>
                      <option value="Opthalmology">Opthalmology</option>
                      <option value="Ortho Surgery">Ortho Surgery</option>
                      <option value="Pathology">Pathology</option>
                      <option value="Pediatrics">Pediatrics</option>
                      <option value="Perinatology">Perinatology</option>
                      <option value="Physiatry">Physiatry</option>
                      <option value="Primary Care">Primary Care</option>
                      <option value="Psychiatry">Psychiatry</option>
                      <option value="Psychology">Psychology</option>
                      <option value="Pulmonary">Pulmonary</option>
                      <option value="Radiation Oncology">Radiation Oncology</option>
                      <option value="Radiation Therapy Technician">Radiation
                      Therapy Technician</option>
                      <option value="Radiology">Radiology</option>
                      <option value="Rheumatology">Rheumatology</option>
                      <option value="Thoracic Surgery">Thoracic Surgery</option>
                      <option value="Urology">Urology</option>
                    </select>
                    </td>
                  </tr>
                  <tr>
                    <td height="27" align="right" valign="bottom">Company Name </td>
                    <td align="left" valign="bottom" class="inputspace"><input type="text" name="company"></td>
                  </tr>
                  <tr>
                    <td height="27" align="right" valign="bottom">Address</td>
                    <td align="left" valign="bottom" class="inputspace"><input type="text" name="address"></td>
                  </tr>
                  <tr>
                    <td height="27" align="right" valign="bottom">City</td>
                    <td align="left" valign="bottom" class="inputspace"><input type="text" name="city"></td>
                  </tr>
                  <tr>
                    <td height="29" align="right" valign="bottom">State</td>
                    <td align="left" valign="bottom" class="inputspace"><input type="text" name="state"></td>
                  </tr>
                  <tr>
                    <td height="28" align="right" valign="bottom">Zip</td>
                    <td align="left" valign="bottom" class="inputspace"><input type="text" name="zip"></td>
                  </tr>
                  <tr>
                    <td height="30" align="right" valign="bottom">Telephone</td>
                    <td align="left" valign="bottom" class="inputspace"><input type="text" name="telephone"></td>
                  </tr>
                  <tr>
                    <td height="28" align="right" valign="bottom">Email</td>
                    <td align="left" valign="bottom" class="inputspace"><input type="text" name="email"></td>
                  </tr>
                  <tr>
                    <td height="32" align="right" valign="bottom">States of Licensure </td>
                    <td align="left" valign="bottom" class="inputspace"><input type="text" name="licensure"></td>
                  </tr>
                  <tr>
                    <td height="29" align="right" valign="bottom">Board of Certifications Status </td>
                    <td align="left" valign="bottom" class="inputspace"><input type="text" name="certification"></td>
                  </tr>
                  <tr>
                    <td height="30" align="right" valign="bottom">Additional Certifications </td>
                    <td align="left" valign="bottom" class="inputspace"><input type="text" name="addcertification"></td>
                  </tr>
                  <tr>
                    <td height="43" align="right" valign="bottom">Additonal Comments </td>
                    <td align="left" valign="bottom" class="inputspace"><textarea name="addcomment"></textarea></td>
                  </tr>
                  <tr>
                    <td height="38" align="right" valign="bottom">&nbsp;</td>
                    <td align="left" valign="bottom" class="inputspace"><input name="Submit" type="submit" class="inputspace" value="Submit"></td>
                  </tr>
                </table></td>
              </tr>
            </table>
          </form>



#2 Mantis_61

Mantis_61
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 26 July 2006 - 12:42 AM

haven't looked at all your code yet but first test your database selection. I had the same problem and found my code was good but my priviliges were bad. MySQL will deny priviliges if your host and or db and table privs aren't specific. there are other ones that will load first. ie. annonymous. especially if there are more than one account with the same name.

#3 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 26 July 2006 - 12:52 AM

Does the fact that you commented out the whole section to add to the database suggest a solution?
Legend has it that reading the manual never killed anyone.
My site

#4 High_-_Tek

High_-_Tek
  • Members
  • PipPipPip
  • Advanced Member
  • 72 posts

Posted 26 July 2006 - 02:09 AM

Add an 'OR DIE ('Could not Execute Query Because: '.mysql_error()); to the end of your mysql_query statement

#5 letskill

letskill
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 26 July 2006 - 02:32 AM

haven't looked at all your code yet but first test your database selection. I had the same problem and found my code was good but my priviliges were bad. MySQL will deny priviliges if your host and or db and table privs aren't specific. there are other ones that will load first. ie. annonymous. especially if there are more than one account with the same name.


Thanks, ill check that tomorrow and reply.

#6 Rich464

Rich464
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 26 July 2006 - 09:54 AM

why have  you commented all this out?

/*echo("$name");
echo('\n');
$sql  = "INSERT INTO `Resume`  VALUES('','" . $name . "'," . $specialty . ",'$company','$address','$city','$state','$zip','$telephone','$email','$licensure','$certifications','$addcertifications','$addcomments')";
echo($sql);
$error = mysql_query($sql);

if ($error == TRUE)
  echo('\nfucking shit worked');
else
  echo(mysql_error());
  */

How is your query going to work when you've commented the code out?

AndyB got it straight away but you don't seem to have realised....

#7 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 26 July 2006 - 09:59 AM

/*
In php when we want to echo a lot about the code we work on
we use the fowardslash and astrack and then when finshed the long
echoed message we use astrack  then backslash to finish our long 
echoed message.

This message is in the php format for an example remeber no code will 
exicute in this php format.
*\

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#8 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 26 July 2006 - 12:57 PM

C'mom - read my earlier post.  The code that you have commented out is NEVER going to be executed.
Legend has it that reading the manual never killed anyone.
My site

#9 letskill

letskill
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 26 July 2006 - 04:39 PM

Sigh guys, i realize that, but it still does the same thing.

#10 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 26 July 2006 - 05:15 PM

OK, then post the current code you have running on your server.  If nothing is going into the database then it sure looks like there's a database error of some sort.  If I encounter that type of problem, I echo the query then try exactly the same query in phpMyAdmin.

Might sound stupid, but you have uploaded the modified files to the right folder on your server, etc. haven't you?
Legend has it that reading the manual never killed anyone.
My site




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users